Agentkit

io.github.Yacine-ai-tech由 GitHub 帳號 Yacine-ai-tech 發布v0.1.18更新於 Oct 24, 2026

Governed MCP server: YAML-declared tools, typed effects, policy-gated and audited calls.

概覽

AI 產生的概覽

一個受治理的 MCP 伺服器,透過具型別效果與稽核的策略閘控工具,提供宣告式的 KPI 商業智慧查詢能力。

可以做什麼
查詢內建 BI 套件中的 KPI、公司健康度、指標異常、指標預測、可用指標與高階主管摘要,以及從 YAML 工具套件載入、基於自有 Postgres 或 HTTP API 的工具。依領域(財務、人力、營運、客戶、工程、成長、物流、ESG、IT、安全)讀取 KPI 資源,並使用每月高階主管簡報提示。透過預設關閉的受控寫入與破壞性工具記錄或撤回指標註解。所有允許與拒絕的呼叫都會被稽核,變更類工具支援試執行。
適用情境
適合讓助理依據 KPI 資料回答商業智慧問題,或希望把自有 Postgres 或 HTTP 後端工具以具型別效果、策略閘控與稽核的方式提供給 MCP 用戶端時使用。
執行需求
以 stdio 在本機執行,通常透過 uvx 或 pip 安裝 agentkit-mcp 套件(Python)。可選 POSTGRES_URL 連接自有 KPI 資料表,未設定時使用內建種子資料。寫入與破壞性工具需要 AGENTKIT_ALLOW_WRITES 與由人持有的 AGENTKIT_APPROVAL_TOKEN。內建 LLM 工作流程與範例需要 GROQ_API_KEY、ANTHROPIC_API_KEY 或 OPENAI_API_KEY 等供應商金鑰。
安裝前請注意
寫入與破壞性工具會改動資料:annotate_metric 寫入持久註解,retract_annotation 將其軟刪除,受 AGENTKIT_ALLOW_WRITES 與模型看不到的核准權杖約束。POSTGRES_URL 是機密連線字串。預設開啟匿名啟動遙測,可用 TELEMETRY_OPT_OUT 或 DO_NOT_TRACK 關閉。SSE/網路模式需要 MCP_AUTH_TOKEN。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Agentkit,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

AgentKit — A Governed MCP Tool Server

[CI] [License: AGPL v3] [AgentKit MCP server – quality score on Glama] [Live App] [Research] [Benchmarks] [Guide]

An MCP server where tools are declarative, effects are typed, and every action is policy-gated and audited. It works with any MCP client (Claude Desktop, Cursor, LangGraph, Claude Agent SDK, CrewAI).

Live Application: agentkit.ysiddo-ai-projects.app.

Three things distinguish it from a typical MCP server:

  • Declarative tools. Define tools in YAML over your own Postgres or HTTP API, with no Python and no fork. (docs/REUSE.md)
  • Typed effects. Each tool declares an effect (read, write or destructive), and tools that mutate data do mutate it.
  • Guardrails that do not depend on the prompt. Writes are off by default, destructive actions need a human-held approval token the model never sees, every mutating tool supports dry-run, and every call (allowed and denied) is audited. (SECURITY.md)

The bundled business-intelligence tools below are the reference pack. They show the mechanics end to end; they are not the limit of what the server can serve.

What It Does

Reference BI pack (built in):

  • 6 core MCP tools: query_kpis, get_company_health, detect_kpi_anomalies, forecast_metric, list_available_metrics, get_executive_summary — plus any tools loaded from declarative YAML packs (packs/), so the real tool count at runtime is 6 or more, not a fixed number. The bundled annotations pack adds 3 more (list_annotations, annotate_metric, retract_annotation) demonstrating a guarded write/destructive path — see below.
  • 10 MCP resources: kpi://{domain}/latest for each of this project's real seeded domains — Finance, People, Operations, Customer, Engineering, Growth, Logistics, ESG, IT, Security (src/agentkit_mcp/data/seed.py).
  • 1 reusable prompt: monthly_executive_briefing

The domain list, tool-pack set, and resource/prompt registration are all derived from the same data this server serves (src/agentkit_mcp/data/seed.py, packs/*.yaml), not hardcoded, so adding a domain or tool pack extends this list automatically. You can also add your own @mcp.resource / @mcp.prompt decorators. See docs/REUSE.md.

Write and destructive actions. The annotations pack lets an agent record a durable note on a metric (annotate_metric, effect write) and soft-delete one it got wrong (retract_annotation, effect destructive, which requires a human-held AGENTKIT_APPROVAL_TOKEN the model never sees). Both are off by default (AGENTKIT_ALLOW_WRITES=false). See SECURITY.md and RESEARCH.md section 2 for the policy-engine model.

Platform capabilities:

  • Declarative tool packs — add tools over your own Postgres/HTTP in YAML (packs/)
  • Typed effects + policy engine — GET /api/policy publishes the capability envelope
  • Audit trail — GET /api/audit, allowed and denied, with deny reasons
  • Multi-provider LLM routing incl. self-hosted — GET /api/llm-routing
  • LangGraph 3-agent workflow in workflow.py (Planner → Analyst → Reporter)
  • Claude Agent SDK demo in demos/claude_agent_sdk_demo.py
  • CrewAI demo in demos/crewai_demo.py
  • DSPy research scaffold in research/dspy_experiment.py
  • 90+ tests across smoke, API, integration, MCP protocol, policy guardrails, and LangGraph workflow

PyPI Package

bash
pip install agentkit-mcpagentkit-mcp               # starts the server (stdio for MCP clients; set PORT for SSE)

For an MCP client, uvx can run the published package without a checkout:

json
{ "mcpServers": { "agentkit": { "command": "uvx", "args": ["agentkit-mcp"] } } }

Quick Start

bash
python -m venv .venv && source .venv/bin/activatepip install -r requirements.txt      # server only; demos and research scripts: requirements-demos.txtcp .env.example .env  # fill in keys + POSTGRES_URLpython mcp_server.py

Claude Desktop Setup

Add to ~/.config/Claude/claude_desktop_config.json:

json
{  "mcpServers": {    "agentkit": {      "command": "python",      "args": ["/abs/path/to/agentkit/mcp_server.py"],      "env": {        "MCP_TRANSPORT": "stdio",        "POSTGRES_URL": "postgresql://...",        "LOG_LEVEL": "DEBUG",        "TELEMETRY_OPT_OUT": "true"      }    }  }}

MCP_TRANSPORT=stdio is required here — without it mcp_server.py defaults to serving over SSE (a network port) instead of talking JSON-RPC over the pipes Claude Desktop spawns it with, and no tools will appear. Local stdio mode doesn't need MCP_AUTH_TOKEN (the OS process boundary is the auth boundary); that variable only matters for the SSE/network path.

Multi-Provider LLM Routing

The 3-agent LangGraph workflow (workflow.py) and the demos/research scripts route each role to its own model via LiteLLM, configured with plain provider/model strings — no code changes to switch providers:

  • LLM_REASONING — planner + reporter agents (defaults to anthropic/claude-sonnet-4-6)
  • LLM_DEFAULT — the tool-calling analyst agent (defaults to groq/openai/gpt-oss-120b)
  • LLM_JUDGE — used by the eval suite (defaults to anthropic/claude-haiku-4-5)
  • LLM_LOCAL + INFERENCE_MODE=local — route to a local/self-hosted model (e.g. Ollama) instead of a hosted provider

Set the matching provider API key(s) (GROQ_API_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY) for whichever models you reference above. See .env.example.

  • Diagnostics: adjust LOG_LEVEL to DEBUG for verbose logs.
  • Telemetry: one anonymous startup ping (service name, version, random install ID; no prompts, tool calls or application data), on by default for both the MCP console command and the REST facade. TELEMETRY_URL redirects it to your own collector; TELEMETRY_OPT_OUT=true or DO_NOT_TRACK=1 disables it. The Claude Desktop snippet above sets TELEMETRY_OPT_OUT.

Restart Claude Desktop, then ask:

  • "What's our company health right now?"
  • "Forecast revenue for the next 6 months."
  • "Are there anomalies in the Finance KPIs?"

LangGraph Workflow

python
from agentkit_mcp.workflow import analyzeresult = analyze("What drove gross margin in Q1?")print(result["report"])

Architecture

The call funnel, policy model, tool packs and design decisions are described in ARCHITECTURE.md, with an interactive version in the dashboard. The REST facade (/api/...) exposes the same tools, policy, audit and routing views over HTTP for the dashboard and ordinary callers. Every configuration variable is described in .env.example.

        Claude Desktop / Cursor / LangGraph                      │                      ▼ MCP              ┌────────────────────────┐              │     mcp_server.py      │              │  6 core tools (read)   │              │  + N pack tools        │              │    (read/write/        │              │     destructive)       │              │ 10 resources, 1 prompt │              └────────────┬───────────┘                            │        ┌───────────────────┼──────────────────┐        ▼                   ▼                  ▼   pg_store            insights          forecasting   (KPIs, real         (health,          (scikit-learn   domains + write-    anomalies)        LinearRegression   back annotations)                     + Monte Carlo CI)

Design notes

  • One server, two transports. The same tool set is served over stdio (local clients) and SSE (network).
  • Capability policy engine. Effects are separated (read, write, destructive) and enforced below the model, independent of the prompt.
  • Client coverage. Exercised with Claude Desktop, Cursor and Devin configurations (see the integration guides below).

For the full formalization, literature context, and citation details, see RESEARCH.md.

Benchmark Replication Suite

Run the reproducible benchmark evaluation suites:

bash
# Test MCP framework overheadpython3 eval/run_benchmarks.py --seed 42
# Full 43-scenario LangGraph suite across all 10 KPI domainspython3 eval/run_dspy_eval.py
# Comprehensive MCP tool execution metricspython3 eval/run_mcp_tools_benchmark.py

Integration Guides (Claude Desktop, Cursor, Devin)

Automated client verification:

bash
python3 tests/test_mcp_client.py

Support the project

If AgentKit is useful to you, a star on the repository helps other engineers find it, and following @Yacine-ai-tech is the simplest way to hear about new releases. Passing the link to a colleague who has the same problem is just as welcome.

Questions and field notes go to Discussions; reproducible bugs go to Issues.

License & Enterprise Use (Dual-License)

This project is open-source under the AGPL-3.0 License. It is completely free for researchers, students, and open-source hobbyists. Commercial license: see COMMERCIAL.md.

[views]

來源:README.md,提交 7b587d8

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v0.1.18最新Oct 14, 2026
  2. v0.1.17Oct 13, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分