PolyMCP – Expose Python and TypeScript Functions as MCP Tools
PolyMCP – Expose Python and TypeScript Functions as MCP Tools
I built PolyMCP, a framework that lets you transform any Python or TypeScript function into an MCP (Model Context Protocol) tool ready to be used by AI agents — no rewriting, no complex integrations. Examples Python 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 AI agents can now call add(3, 4) directly. TypeScript function: import { z } from 'zod'; import { tool, exposeToolsHttp } from 'polymcp'; const uppercaseTool = tool({ name: 'uppercase', description: 'Convert text to uppercase', inputSchema: z.object({ text: z.string() }), function: async ({ text }) => text.toUpperCase(), }); const app = exposeToolsHttp([uppercaseTool], { title: "Text Tools" }); app.listen(3000); Agents can call uppercase("hello") and get "HELLO" instantly. Business workflow function (Python example): import pandas as pd from polymcp.polymcp_toolkit import expose_tools_http def calculate_commissions(sales_data: list[dict]): 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") Now AI agents can generate reports automatically. Why it matters • Reuse existing code immediately: legacy scripts, internal libraries, APIs. • Automate workflows: AI can orchestrate multiple tools reliably. • Cross-language: expose Python and TypeScript functions on the same MCP server. • Plug-and-play: no custom wrappers or middleware needed. • Built-in reliability: input/output validation and error handling included. PolyMCP makes any Python or TypeScript function immediately usable by AI agents, standardizing integration across enterprise software. Repo: https://github.com/poly-mcp/Polymcp
Share cardActual performance
Launch Intel predictions
Analyze your own launch →Correct prediction on native model
Similar products
Encrypt Data Between Python and TypeScript (AES-GCM and RSA-OAEP)
Lisp implementation in modern Java, Go, C#, TypeScript, Python
Compile Python libraries for TypeScript with type completion (umo)
WebRTC-Echoes: Interop for C#, C++, Python, TypeScript, Go and Servers
The AI SDK for TypeScript and Python
PolyMCP – Expose Python/TS functions as MCP tools easily
Epipy – Python tools for epidemiology
Cerialize – Typescript serialization by annotation
Scala-ts – Scala to TypeScript compiler
DuoCode 1.0 bridges the gap between C# and TypeScript