One bad instruction — and it turns on you.

INTRODUCING · PYTHON

MCP Agent Toolkit

A production-shaped MCP server with guarded tools, an agent that discovers them at runtime, and prompts promoted only by live A/B evidence.

livePythonMCP SDKFastAPIOpenAISQLite
MCP Agent Toolkit console showing a multi-tool agent run
The problem

Tool integrations are bespoke and brittle, tools without guardrails are an attack surface, and prompt changes ship on gut feeling instead of evidence.

and it turns on you
The solution

The open protocol is the boundary: a guarded MCP server exposes four tools, an agent discovers them with tools/list and runs a bounded loop, and every prompt change must beat the current one in a live A/B test before it goes live.

How it works

01
Connect
The agent client spawns the MCP server over stdio and opens a session.
02
Discover
The tools are discovered at runtime and handed to the model; nothing is hard-coded.
03
Call and guard
Each call passes a rate limit, a path sandbox or SQL guard and an output sanitizer; failures come back as typed errors.
04
Answer within bounds
The loop ends with an answer, an iteration limit or a hard budget cap, streaming every step live.
05
Promote with evidence
A new prompt version goes live only after a live A/B run beats the current one; every change is hash-chained.
06
Measure
A 24-question dataset, deterministic checks and an independent judge produce a committed scorecard.
Watch the MCP Agent Toolkit film

English subtitles burned in · Spanish CC on YouTube

Features

Runtime tool discovery.

The agent never hard-codes a tool schema: the server's tool list becomes the model's function list on every run. Remove a tool from the server and the agent adapts on its next run.

Guardrails that fail loudly.

Every call passes a rate limit, a path sandbox or SQL guard and an output sanitizer; a violation returns a typed error to the model. Nothing unsafe runs and nothing fails silently.

Prompts promoted by evidence.

System prompts are versioned files; a new version goes live only after a live A/B run beats the current one. A failed gate blocks promotion unless a human gives an audited reason.

Tamper-evident audit log.

Every registry change is appended to a hash-chained log that flags the first altered line. It is tamper-evident, not tamper-proof.

Quality you can read.

A 24-question dataset, deterministic checks and a judge running on a different model produce a committed scorecard. It did not pass the first time, and the fix went through the same registry.

See the protocol traffic.

A technical view shows the exact calls and typed results the agent exchanged with the server. Engineers can verify the behaviour instead of trusting a summary.

Architecture

Architecture of the MCP Agent Toolkit: React console and CLI feeding a bounded agent loop, MCP client over stdio JSON-RPC, guarded tool handlers, prompt registry and sandboxed file access
Source: project README
Text description of the diagram

The User reaches either the React console (Vite · TypeScript · Tailwind) or the mcp-toolkit-agent CLI. The console talks to the FastAPI web adapter — one MCP child per process — over POST /api/chat and GET /api/chat/stream (SSE). Both the adapter and the CLI feed the bounded agent loop (answer · iteration_limit · budget_limit) inside the Agent client, which talks bidirectionally to the LLM adapter (OpenAI or StubLLM) and onward to the MCP client with tools/list discovery. The Prompt Registry (vN.yaml + audit chain) supplies the promoted prompt resolved per run. The MCP client reaches the MCP server child process over stdio · JSON-RPC: MCPServer → guarded_invoke → rate limit per tool + session → tool handler → sanitizer with a typed result envelope. Handlers fan out to web_search (Tavily · DuckDuckGo · stub), db_query against a read-only demo.db, and read_file/write_file through a path sandbox into the sandbox folder.

Measured. Not claimed.

0
Task success
Live scorecard, dataset v1.2.0 (24 questions), judge on a different model than the agent
0
Adversarial resistance
Attack cases resisted; gate 100%
0
Citation verification
Citation-expecting answers verified against tool output
0
Cost per question
Agent only; the whole 24-question run cost $0.0093
0
Automated tests
Offline backend suite, plus 54 browser e2e and 55 frontend tests; 93% coverage
KNOWN LIMITATIONS
  • The web console is local, single-user and unauthenticated; put an identity layer in front before exposing it.
  • Latency is informational, not gated: p50 1.8 s, p95 13.1 s on the committed live run.
  • The audit log is tamper-evident, not tamper-proof.
  • The dataset is 24 questions: a regression gate, not a benchmark.

Stack

PythonMCP SDKFastAPIOpenAISQLiteReactDocker
NEED AGENTS YOU CAN TRUST IN PRODUCTION?

Your systems — plugged in safely.

Your database, your documents, your tools: I connect them to your agents behind the same guardrails.