AgentKit
AgentKit is a governed MCP tool server for business-intelligence KPI analysis, with policy-gated writes, destructive-action approvals, and audit trails.
Query historical and real-time KPI time series across domains like Finance, People, Operations, Customer, Engineering, Growth, Logistics, ESG, IT, and Security, with metric/period/domain filters.
Compute company-wide or domain-specific health scores with diagnostic breakdowns.
Detect KPI anomalies using Z-score or IQR methods.
Forecast metrics with trend projection and Monte Carlo confidence intervals.
Discover available metrics, domains, and historical periods.
Generate one-shot executive summaries combining health, key metrics, and anomalies.
List metric annotations and operator notes, including optional retracted entries.
Add durable annotations to metrics as a guarded write action, with dry-run support.
Retract annotations as a destructive action requiring a human-held approval token and dry-run support.
Use the same tools through MCP clients or the REST facade, with declarative YAML tool packs, policy/audit endpoints, multi-provider LLM routing, and LangGraph workflow demos.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AgentKit Forecast revenue for the next 6 months."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AgentKit — A Governed MCP Tool Server
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.
Research Background:
RESEARCH.md/ Online Research DocumentationEmpirical Benchmarks:
BENCHMARK.md/ Online Benchmark DashboardUser Guide: Online User Guide
Self-Hosting Guide:
SELF_HOSTING.md
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,writeordestructive), 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 bundledannotationspack adds 3 more (list_annotations,annotate_metric,retract_annotation) demonstrating a guarded write/destructive path — see below.10 MCP resources:
kpi://{domain}/latestfor 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.promptdecorators. 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/policypublishes the capability envelopeAudit trail —
GET /api/audit, allowed and denied, with deny reasonsMulti-provider LLM routing incl. self-hosted —
GET /api/llm-routingLangGraph 3-agent workflow in
workflow.py(Planner → Analyst → Reporter)Claude Agent SDK demo in
demos/claude_agent_sdk_demo.pyCrewAI demo in
demos/crewai_demo.pyDSPy research scaffold in
research/dspy_experiment.py90+ tests across smoke, API, integration, MCP protocol, policy guardrails, and LangGraph workflow
Related MCP server: autonomad-travel
PyPI Package
pip install agentkit-mcp
agentkit-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:
{ "mcpServers": { "agentkit": { "command": "uvx", "args": ["agentkit-mcp"] } } }Quick Start
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt # server only; demos and research scripts: requirements-demos.txt
cp .env.example .env # fill in keys + POSTGRES_URL
python mcp_server.pyClaude Desktop Setup
Add to ~/.config/Claude/claude_desktop_config.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 toanthropic/claude-sonnet-4-6)LLM_DEFAULT— the tool-calling analyst agent (defaults togroq/openai/gpt-oss-120b)LLM_JUDGE— used by the eval suite (defaults toanthropic/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_LEVELtoDEBUGfor 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_URLredirects it to your own collector;TELEMETRY_OPT_OUT=trueorDO_NOT_TRACK=1disables it. The Claude Desktop snippet above setsTELEMETRY_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
from agentkit_mcp.workflow import analyze
result = 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:
# Test MCP framework overhead
python3 eval/run_benchmarks.py --seed 42
# Full 43-scenario LangGraph suite across all 10 KPI domains
python3 eval/run_dspy_eval.py
# Comprehensive MCP tool execution metrics
python3 eval/run_mcp_tools_benchmark.pyIntegration Guides (Claude Desktop, Cursor, Devin)
Claude Desktop: See claude_desktop_config.example.json and docs/INTEGRATION_GUIDE.md
Cursor IDE: See cursor_mcp.example.json
Devin AI Agent: See devin_mcp.example.json
Automated client verification:
python3 tests/test_mcp_client.pySupport 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.
![]()
Available Tools
9 toolsannotate_metricAnnotate MetricB
Attach a durable operational finding, investigation note, or root-cause explanation to a specific KPI metric and recording period. Requires write permissions enabled.
Effect: WRITE — mutates data. Pass dry_run=true to preview without committing.
Inputs: note (required), metric (required), period (required), author, +2 more.
detect_kpi_anomaliesDetect Kpi AnomaliesA
Detect statistical anomalies, sudden spikes, and unexpected deviations in KPI time-series history.
Analyzes metric historical distributions within a specified business domain using rigorous parametric (Z-Score) or non-parametric (IQR - Interquartile Range) anomaly detection algorithms to identify operational risks, unexpected budget variances, or sudden performance degradation.
Inputs: domain (required), method, threshold. Returns: object
forecast_metricForecast MetricA
Generate forward-looking time-series forecasts with Monte Carlo confidence intervals for a named KPI.
Applies trend analysis and linear projection mathematical modeling over historical monthly metric data to predict future trajectory across specified forward horizon periods, providing upper and lower bound confidence intervals.
Inputs: metric_name (required), periods, confidence_level. Returns: object
get_company_healthGet Company HealthB
Compute composite organizational health scores and diagnostic health index breakdown.
Synthesizes multi-factor business performance indicators into a holistic 0-100 health score with categorized qualitative interpretations ('Optimal', 'Healthy', 'Warning', 'Critical') and sub-component scores across growth rate, profit margins, cash runway, and operational efficiency.
Inputs: domain. Returns: object
get_executive_summaryGet Executive SummaryA
Generate a comprehensive one-shot executive briefing synthesizing health, key metrics, and anomalies.
Executes a high-level cross-domain synthesis combining composite organizational health diagnostics, primary KPI indicators, and active statistical anomalies across Finance, Operations, and Growth into an actionable briefing for leadership.
Returns: A dictionary containing: - 'summary': High-level descriptive briefing title. - 'health_score': Overall company health index (0.0 to 100.0). - 'interpretation': Overall company health classification string ('Optimal', 'Healthy', 'Warning', 'Critical'). - 'components': Breakdown of health scores (growth, margin, cash_score, efficiency). - 'key_metrics': Top 5 representative business KPI metric records. - 'anomalies': Top 5 active statistical anomalies requiring immediate executive review.
Inputs: no named parameters. Returns: object
list_annotationsList AnnotationsA
Read historical metric annotations and operator notes, ordered from most recent to oldest. Allows filtering by a specific KPI metric and optionally including retracted entries.
Inputs: limit, metric, include_retracted.
list_available_metricsList Available MetricsA
Discover all supported KPI metrics, business domains, and available historical time periods.
Essential discovery tool for agents to inspect the metadata schema before formulating specific queries, anomaly detections, or predictive forecasts.
Inputs: domain. Returns: object
query_kpisQuery KpisB
Retrieve historical and real-time Key Performance Indicators (KPIs) from the governed Postgres store.
Fetches structured time-series metrics across enterprise business domains including Finance, People (HR), Operations, Customer (Sales/Support), Engineering, Growth, Logistics, ESG, IT, and Security.
Inputs: limit, domain, period_to, period_from, +1 more. Returns: object
retract_annotationRetract AnnotationA
Soft-delete an erroneous or outdated annotation (stamps retracted_at). Classed as a destructive action requiring a valid operator approval token.
Effect: DESTRUCTIVE — mutates data. Pass dry_run=true to preview without committing. Requires a human-supplied approval_token.
Inputs: annotation_id (required), dry_run, approval_token.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool has a clearly distinct purpose: retraction vs. annotation vs. querying KPIs vs. health scoring vs. anomaly detection vs. forecasting vs. listing metrics vs. executive summary. No two tools overlap in function.
Consistent verb_noun convention (retract_annotation, query_kpis, get_company_health, detect_kpi_anomalies, forecast_metric, list_available_metrics, get_executive_summary, list_annotations, annotate_metric). The verb 'get' vs 'list' vs 'annotate' vs 'retract' is used appropriately based on action type, though 'get_executive_summary' could arguably be 'generate' but it's a read operation.
9 tools is well within the ideal 3-15 range. The set covers discovery, analysis, forecasting, annotation management, and executive summary without redundancy or bloat.
The tool surface covers the full lifecycle for KPI analysis (discovery, query, anomaly detection, forecasting, health scoring, annotations with retraction). However, there is no direct tool for creating or updating KPI metrics themselves (e.g., defining new metrics or modifying existing ones), which may be needed for a governed store. Also, no tool for listing all domains or periods beyond the discovery tool, but that is covered by list_available_metrics.
Maintenance
Related MCP Connectors
Analytics your AI agent can actually use. Track, experiment, and optimize via MCP.
100+ MCP tools for AI agents: content metadata, trade intelligence, business-expertise analysis.
Social media analytics, video analysis, and competitor intel for any MCP-compatible AI agent.
Connect your ads, shop, analytics, social, CRM and finance platforms once, then let Claude, ChatGPT, Cursor or any MCP client read, join and explain your numbers. Public statistics from the World Bank, IMF, Eurostat, OECD, WHO and SEC filings come as context, searchable and chartable from the same tools. Read-only by design, every number carries its source.
Related MCP Servers
- AlicenseAqualityBmaintenanceQuery PostgreSQL and inspect schemas over MCP. Connects to local, Docker, RDS, Neon, Supabase, or a database behind an SSH bastion.51,519 npm25MIT

autonomad-travelofficial
AlicenseAqualityDmaintenanceAI travel agent over MCP — live flights, hotels, activities, and events worldwide, then completes the booking on autonomad.ai.82MIT
agentkit-meshofficial
AlicenseAqualityFmaintenanceEnables agent-to-agent discovery and delegation via MCP, with tools for registering agents, discovering them by keyword matching, and delegating tasks over HTTP.44 npm1MIT- AlicenseNot gradedqualityDmaintenanceEnables AI agents to query live schema, lineage, and query-context across data warehouses, dbt projects, orchestration systems, and BI tools via MCP tools.Apache 2.0