OpenAPI tool autogeneration
Convert Robyn routes into MCP tools automatically. Safe GETs become read tools, POSTs become action tools, and input schemas are inferred from your API contracts.
robyn-mcp helps developers expose tools, resources, and prompts from Robyn apps with minimal code. Ship OpenAPI autogeneration, observability, prompt endpoints, resource discovery, and a polished browser playground — without building the protocol layer yourself.
from robyn import Robyn
from robyn_mcp import RobynMCP, RobynMCPConfig
app = Robyn(__file__)
@app.get("/health")
async def health():
return {"status": "ok"}
mcp = RobynMCP(
app,
config=RobynMCPConfig(
auto_expose_openapi=True,
enable_resources=True,
enable_prompts=True,
enable_playground=True,
enable_tool_tracing=True,
),
)
mcp.mount_http()
app.start(port=8080)
Everything users expect from a modern integration layer: automatic discovery, strongly structured tool schemas, browsable resources, reusable prompts, and instant live inspection.
Convert Robyn routes into MCP tools automatically. Safe GETs become read tools, POSTs become action tools, and input schemas are inferred from your API contracts.
Expose structured context through MCP resources and reusable prompt templates so clients can discover more than just callable actions.
Track calls, errors, average latency, and recent events to understand real usage and debug issues faster during local and production testing.
Cache frequent read tools to reduce backend load, then invalidate by cache tags from mutation tools so clients always see fresh data after updates.
Inspect, validate, benchmark, and audit your endpoint with built-in tooling designed to make release checks much easier.
Ship a modern browser-based playground that lets developers initialize sessions, list tools, read resources, resolve prompts, and call methods instantly.
Header forwarding, session management, JSON-RPC handling, transport metadata, and configurable feature flags give you a clean v1 deployment path.
Keep your Robyn app exactly where it is. Add robyn-mcp, mount the endpoint, and let clients discover capabilities over a clean MCP surface.
Create a RobynMCP instance around your existing Robyn application.
Turn on OpenAPI autogen, prompts, resources, playground, and tracing through config flags.
Use mcp.mount_http() and immediately expose discovery, tool calls, resource
access, and prompt retrieval.
curl -s http://localhost:8080/mcp \
-H 'content-type: application/json' \
-H 'accept: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}'
curl -s http://localhost:8080/mcp \
-H 'content-type: application/json' \
-H 'accept: application/json' \
-H 'mcp-session-id: ...' \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'
robyn-mcp is useful anywhere developers want existing APIs to feel discoverable and assistant-ready without rewriting their app stack.
A Nike-style product backend can expose inventory lookup as tools, store context as resources, and sales playbooks as prompts for internal assistants.
Turn health checks, deployment status, environment metadata, and release-note prompts into one MCP surface for faster team workflows.
Expose billing actions, tenant context, diagnostics, and support prompts while keeping the original Robyn API intact under the hood.
Perfect for developers who already have a Robyn application and want MCP support, discovery, observability, and a polished playground with minimal setup.
python -m pip install --upgrade pip
pip install robyn robyn-mcp
robyn-mcp install-note
from robyn import Robyn
from robyn_mcp import RobynMCP
app = Robyn(__file__)
@app.get("/health")
async def health():
return {"status": "ok"}
mcp = RobynMCP(app)
mcp.mount_http()
app.start(port=8080)
The essentials developers usually want to know before adopting the library.
No. robyn-mcp wraps your existing app. You keep your routes and add MCP capabilities around them.
Yes. You can expose MCP resources and prompts, not just callable tools.
Yes. With OpenAPI autogeneration enabled, supported routes can be surfaced as MCP tools automatically.
Yes. The built-in playground provides a modern UI for metadata, tool calls, resources, prompts, and trace inspection.