
One bad instruction — and it turns on you.
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.

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 youThe 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
English subtitles burned in · Spanish CC on YouTube
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

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.
- 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
Your systems — plugged in safely.
Your database, your documents, your tools: I connect them to your agents behind the same guardrails.


