Skip to main content
Glama
drrycc0625

kpi-mcp-spike

by drrycc0625
README.md
# kpi-mcp-spike

Minimal MCP server (Streamable HTTP) for a Copilot Studio connectivity POC.
One tool: `ping()` -> `{"ok": true, "message": "kpi-mcp-alive"}`. No KPI data. Auth: None.

## Run in GitHub Codespaces (primary)

```bash
pip install -r requirements.txt
python server.py            # listens on 0.0.0.0:8000, endpoint /mcp
```

Then in the **PORTS** tab: right-click port **8000** -> Port Visibility -> **Public**.
The public URL looks like `https://<codespace>-8000.app.github.dev`; the MCP endpoint is that + `/mcp`.

Verify from a second terminal:

```bash
python test_client.py https://<codespace>-8000.app.github.dev/mcp
# expect: tools: ['ping']  /  ping: [... "kpi-mcp-alive" ...]
```

## Copilot Studio

Tools -> Add a tool -> Model Context Protocol.
Server URL: `https://<codespace>-8000.app.github.dev/mcp` (must end with `/mcp`). Authentication: None.

## Render fallback (if the public port can't be used)

Uses `app.py` (ASGI object) instead of `server.py`.
Build command: `pip install -r requirements.txt`
Start command: `python -m uvicorn app:app --host 0.0.0.0 --port $PORT`