FastAPI + MCP integration framework
Project description
simcpi
Build MCP-powered APIs with a single decorator.
simcpi combines FastAPI, MCP tools, LLM tool-calling, and an interactive playground into one framework.
Features Single decorator → REST endpoint + MCP tool Built-in Swagger docs MCP streamable-http transport Interactive MCP playground (/mcpark) OpenAI and Anthropic support Claude Desktop integration In-process MCP client support .mcpb export support Installation pip install simcpi Quick Start from simcpi import MCPApi import uvicorn
app = MCPApi( title="Math API", provider="openai", api_key="your-api-key" )
@app.create_tool_api("/add", method="POST") def add(a: int, b: int) -> int: """ Add two numbers together. Use this when the user asks for sums or totals. """ return a + b
if name == "main": uvicorn.run(app, host="0.0.0.0", port=8000)
Run:
python app.py Automatic Routes Route Purpose /docs Swagger UI /mcpark MCP playground /mcp/mcp MCP streamable-http endpoint MCPark
MCPark is the built-in interface for testing MCP tools with LLMs.
Open:
Capabilities:
View registered tools Run prompts against tools Inspect tool calls and outputs Switch between OpenAI and Anthropic Configure custom base URLs and headers Generate Claude Desktop config snippets MCP Client from simcpi import MCPApi import asyncio
app = MCPApi( provider="openai", api_key="your-api-key" )
@app.create_tool_api("/multiply") def multiply(a: int, b: int) -> int: """Multiply two numbers.""" return a * b
async def main(): client = app.get_client()
result = await client.run(
"What is 12 times 9?"
)
print(result.answer)
print(result.tools_called)
asyncio.run(main()) Claude Desktop Integration app.connect_claude()
Restart Claude Desktop after running the command.
Export .mcpb app.export_mcpb()
Generates a Claude Desktop installable bundle.
Custom LLM Endpoints app = MCPApi( provider="openai", api_key="your-api-key", base_url="https://your-provider.com/v1" )
Custom headers are also supported.
Supported Providers OpenAI Anthropic Requirements Python 3.10+ fastmcp==3.2.4 Why simcpi?
Traditional MCP setups often require:
separate MCP servers separate API frameworks manual tool registration transport setup additional orchestration code
simcpi unifies these into a single workflow.
Write a function once:
it becomes an API endpoint it becomes an MCP tool it becomes callable by LLMs Example Tool @app.create_tool_api("/weather") def weather(city: str) -> str: """ Get weather for a city. Use this when the user asks about weather conditions. """ return f"Sunny in {city}" Roadmap Streaming responses Additional MCP transports OAuth support Multi-agent orchestration Tool analytics Deployment helpers License
License will be added in a future release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simcipi-0.2.0.tar.gz.
File metadata
- Download URL: simcipi-0.2.0.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eefd836381ca1225b170d718f1b62a355ed4fa57816d0bc41c1ca60b7b636f2b
|
|
| MD5 |
66dbe4abcc7f65b360c1cc6bdee80042
|
|
| BLAKE2b-256 |
eb6f89294670c825b5516c93e7a12cbc3d3a96179ddd82854dc99b329d5279c5
|
File details
Details for the file simcipi-0.2.0-py3-none-any.whl.
File metadata
- Download URL: simcipi-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02829b6adb72c68e492eaa9adba26a3c8c60ebcf520c8bbdad7c13bfb685b0c8
|
|
| MD5 |
4709863d4a7ec57679cc0c404a4ff435
|
|
| BLAKE2b-256 |
dc5877841466efe09f0142402c0785b44c42d89614541cbca031d39639e1fb4c
|