Typed, sandboxed Code Mode access to configured MCP servers for Pi
View on GitHub ↗Fast, typed, sandboxed Code Mode for every MCP server configured in Pi.
Instead of putting every upstream MCP tool definition into the model context, pi-codemcp gives the agent a small interface for discovery, execution, and reuse:
- codemcpsearch ranks capabilities or pages through a compact inventory without loading full schemas. - codemcpinspect returns exact typed SDK stubs only for selected calls. - codemcpexecute runs one sandboxed Python call graph across one or many MCP servers. - codemcpsavechain turns a repeated call graph into a reusable native Pi tool. - codemcpmanagechains lists chains or performs an explicitly confirmed enable, disable, revalidate, or delete.
Intermediate results stay inside the sandbox. The model receives only the compact value returned by the program.
MCP has an uncomfortable scaling property: the more tools an agent can use, the more tool schemas compete with the actual task for context. Multi-step work also tends to bounce every intermediate result through the model, adding tokens, latency, and opportunities for mistakes.
Cloudflare described a better pattern in Code Mode: give agents an entire API in 1,000 tokens: expose a small search-and-execute surface, let the model write code against a typed SDK, and execute that code in a sandbox. Their work reports a fixed tool footprint and dramatic context savings for very large APIs. The open-source implementation lives in @cloudflare/codemode.
From the project README.
Add the radar badge to your README — it shows your project was picked up by MCP Radar and links to this page:
[](https://mcp.liqiwa.com/s/yolonir--pi-codemcp.html)
Turn scattered notes, docs and transcripts into a queryable Markdown wiki — an LLM knowledge-base compiler with MCP access, no embeddings, self-hosted.
alxgntv/substack-api-mcpMCP server for Substack posts (FastMCP + substack-api-client)
sm18lr88/STT-MCPFast, local speech-to-text MCP server
simonw/mcp-explorerCLI tool for exploring an MCP server
sandeepbazar/ocm-mcp-serverAn MCP server that lets AI agents operate a multi-cluster Kubernetes fleet through an Open Cluster Management hub, with policy, approval, and audit between the model and your clusters.
Vladimir-Human/ru-marketplace-mcpДевять российских маркетплейсов и китайский Taobao как MCP-серверы: Wildberries, Ozon, Яндекс Маркет, Детский мир, Авито, Мегамаркет, Lamoda, DNS, Ситилинк. Плюс сравнение цен по всем сразу. Только чт
The top new MCP servers of the week, every Monday. No spam, unsubscribe anytime.