PolyMCP is more than just an MCP server: it turns existing Python code into agent‑ready tools and gives agents the ability to discover, compose, and orchestrate across multiple services with adaptive planning and real‑world execution support.
Key parts of the ecosystem:
1) Expose Python functions as MCP tools Use existing Python functions directly as MCP tools without rewriting them:
from polymcp.polymcp_toolkit import expose_tools_http
def add(a: int, b: int) -> int: return a + b
app = expose_tools_http([add], title="Math Tools")
Type hints automatically generate structured tool schemas, and input/output validation and error handling are included. Multiple functions can be exposed on the same server.
2) Autonomous agent: PolyClaw PolyClaw goes beyond tool calling. It: • Decomposes complex tasks into executable steps • Selects and orchestrates MCP tools dynamically • Starts or connects to MCP servers on demand • Validates outputs before proceeding • Adapts plans when execution fails • Runs everything in isolated Docker containers
Example run:
polymcp agent run \ --type polyclaw \ --query "Build a sales reporting pipeline and test it end‑to‑end" \ --model minimax‑m2.5:cloud \ --verbose
Under the hood, the system plans, provisions infrastructure as needed, executes steps sequentially or in parallel, and handles adaptive replanning when something fails.
Why this matters
Most AI agent systems today either call tools statically or assume the infrastructure already exists. PolyMCP instead: • Makes existing Python code agent‑ready with minimal friction • Standardizes tools via MCP so multiple agents and services can interact with them • Provides autonomous orchestration across multiple services • Spins up infrastructure dynamically when needed • Validates step results and recovers from failures • Uses Docker for safe, isolated execution
PolyMCP is useful for enterprise automation, DevOps workflows, data pipelines, internal tooling orchestration, and any complex multi‑tool reasoning tasks where agents must plan and execute reliably.
Repo: https://github.com/poly‑mcp/PolyMCP
Happy to answer questions.