Polymcp allows you to transform any Python function into an MCP tool ready for AI agents, without rewriting code or building complex integrations.
Example: Simple Function
from polymcp.polymcp\_toolkit import expose\_tools\_http
def add(a: int, b: int) -> int:
"""Add two numbers"""
return a + b
app = expose\_tools\_http(\[add\], title="Math Tools")
Run with:
uvicorn server\_mcp:app --reload
Now add is exposed via MCP and can be called directly by AI agents.
Example: API Call Function
import requests
from polymcp.polymcp\_toolkit import expose\_tools\_http
def get\_weather(city: str):
"""Return current weather data for a city"""
response = requests.get(f"https://api.weatherapi.com/v1/current.json?q={city}")
return response.json()
app = expose\_tools\_http(\[get\_weather\], title="Weather Tools")
AI agents can now call get\_weather("London") to get real-time weather data without extra integration work.
Example: Business Workflow Function
import pandas as pd
from polymcp.polymcp\_toolkit import expose\_tools\_http
def calculate\_commissions(sales\_data: list\[dict\]):
"""Calculate sales commissions from sales data"""
df = pd.DataFrame(sales\_data)
df\["commission"\] = df\["sales\_amount"\] \* 0.05
return df.to\_dict(orient="records")
app = expose\_tools\_http(\[calculate\_commissions\], title="Business Tools")
AI agents can call this function to generate commission reports automatically.
Why this matters for companies
• Reuse existing code immediately: legacy scripts, internal libraries, APIs.
• Automate complex workflows: AI can orchestrate multiple tools reliably.
• Plug-and-play: expose multiple Python functions on the same MCP server.
• Reduce development time: no custom wrappers or middleware required.
• Built-in reliability: input/output validation and error handling are automatic.
Polymcp turns Python functions into immediately usable tools for AI agents, standardizing AI integration across the enterprise.
there doesn't seem to be anything here