Metadata-Version: 2.4
Name: simcpi
Version: 0.2.0
Summary: FastAPI + MCP integration framework
Author: Mohan
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: fastapi>=0.100.0
Requires-Dist: fastmcp==3.2.4
Requires-Dist: pydantic>=2.0.0
Requires-Dist: uvicorn>=0.20.0
Requires-Dist: openai
Requires-Dist: anthropic

# 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

```bash
pip install simcpi
```

---

# Quick Start

```python
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:

```bash
python app.py
```

---

# Features

## 1. API + MCP in One Decorator

Create both:

* FastAPI endpoint
* MCP tool

using a single decorator.

```python
@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:

```text
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:

```text
http://127.0.0.1:8000/docs
```

---

## 3. MCP Client + LLM Integration

Run MCP tools through an LLM in a single function.

```python
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.

```python
app.get_claude_config()
```

or:

```python
app.connect_claude()
```

---

# Default MCP Endpoint

The MCP streamable HTTP endpoint is exposed at:

```text
/mcp/mcp
```

Example:

```text
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.
