Mock MCP Apps Server
by dganesh5
README.md
# Mock MCP Apps Server
A local, no-auth **FastAPI + FastMCP** server exposing MCP over Streamable HTTP at
`POST /v1/mcp`, with a React 18 + Vite widget frontend built on
`@modelcontextprotocol/ext-apps`.
Two mocked tools:
- `get_weather_forecast` — returns a mocked 5-day forecast and renders an interactive widget.
- `list_supported_cities` — plain text list of mocked cities (no widget).
No auth of any kind. Intended for local development and testing against MCP hosts
(ChatGPT dev mode, Claude, MCP Inspector) via a tunnel like `ngrok`.
## Quickstart
```bash
poetry install
cd app/web && npm install && npm run build && cd ../..
./start_mcp.sh
```
This starts:
| Port | What |
|------|------|
| 8000 | FastAPI + MCP (`/v1/mcp`, `/health`, `/apidoc/swagger`) |
| 4444 | Static widget assets (CORS-enabled) |
To expose it to a remote MCP host:
```bash
ngrok http 8000
```
Then add `https://<your-ngrok-domain>/v1/mcp` as a custom connector in the host.
## Smoke test
```bash
curl -s http://localhost:8000/health
curl -s -X POST http://localhost:8000/v1/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```
See `docs/MOCK_MCP_APP_RECREATION_GUIDE.md` for the full spec this project implements.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo issues