Skip to main content

FastAPI + MCP integration framework

Project description

simcpi

Build MCP servers and AI tool APIs with minimal code.

simcpi combines:

  • FastAPI route creation
  • MCP server generation
  • Swagger-style MCP testing UI
  • LLM + MCP client integration
  • Claude connectivity helpers

into a single framework.


Installation

pip install simcpi

Quick Start

from simcpi import MCPApi
import uvicorn

app = MCPApi(
    provider="openai",
    api_key="your-api-key",
    base_url="https://api.openai.com/v1",
    model="gpt-4o"
)


@app.create_tool_api("/greet-hindi")
def greet_hindi(name: str) -> str:
    """
    Greet the user in Hindi.
    """
    return f"नमस्ते {name} जी!"


@app.create_tool_api("/greet-telugu")
def greet_telugu(name: str) -> str:
    """
    Greet the user in Telugu.
    """
    return f"నమస్కారం {name}!"


if __name__ == "__main__":
    uvicorn.run(app, host="127.0.0.1", port=8000)

Run:

python app.py

Features

1. API + MCP in One Decorator

Create both:

  • FastAPI endpoint
  • MCP tool

using a single decorator.

@app.create_tool_api("/hello")
def hello(name: str) -> str:
    return f"Hello {name}"

This automatically:

  • creates REST endpoint
  • registers MCP tool
  • generates schemas
  • exposes tool to MCP clients

2. MCPark — Swagger UI for MCP

Open:

http://127.0.0.1:8000/mcpark

MCPark provides:

  • MCP tool testing UI
  • HTTP/SSE MCP execution
  • live tool calling
  • conversational testing interface

Also includes standard Swagger docs:

http://127.0.0.1:8000/docs

3. MCP Client + LLM Integration

Run MCP tools through an LLM in a single function.

client = app.get_client()

result = await client.run(
    "Greet Mohan in Telugu"
)

print(result.answer)

Supports:

  • OpenAI-compatible providers
  • tool calling
  • MCP tool orchestration
  • automatic argument extraction

4. Easy Claude Integration

Generate Claude-compatible MCP configuration easily.

app.get_claude_config()

or:

app.connect_claude()

Default MCP Endpoint

The MCP streamable HTTP endpoint is exposed at:

/mcp/mcp

Example:

http://127.0.0.1:8000/mcp/mcp

Supported Providers

Any OpenAI-compatible provider using:

  • base_url
  • api_key

Examples:

  • OpenAI
  • OpenRouter
  • local gateways
  • enterprise AI platforms

Testing Status

Currently tested on:

  • Windows
  • FastAPI
  • FastMCP 3.2.4
  • HTTP/SSE MCP transport
  • OpenAI-compatible providers

Claude Desktop HTTP MCP support is still experimental and may vary depending on Claude Desktop version.


License

License will be added in a future release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simcpi-0.2.0.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simcpi-0.2.0-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file simcpi-0.2.0.tar.gz.

File metadata

  • Download URL: simcpi-0.2.0.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for simcpi-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a217f6ff989518bf9fca7700cf233ec8a62dde7686985f9e06455c2157a51690
MD5 d48b50da18a316344df3fc8b4fd81730
BLAKE2b-256 359502e1ec1601c86e1d12612bfc929eb36d8b31ad182201d6d476fd54be58f0

See more details on using hashes here.

File details

Details for the file simcpi-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: simcpi-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for simcpi-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a04449cc65eda19d938ea3e85f021f306f5b874e289e1ebef340833deda6f541
MD5 f197ce517b73ed418d54ac11d52cba52
BLAKE2b-256 cf43f6d6d3a045b941b2715968e262b1f934787b277b7024ac161a267d2235a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page