Skip to main content
Glama
use-pi-mcp

use-pi-mcp

by PeronGH
README.md
# use-pi-mcp

Serves an OAuth MCP server from [pi](https://pi.dev)'s configuration as a stdio MCP server, signed in as pi. For harnesses that handle OAuth MCP servers poorly: sign in once with pi and point the harness at `use-pi-mcp`.

It looks up the server in `~/.pi/agent/mcp.json`, sends the access token pi stored in `~/.pi/agent/mcp-auth.json`, and refreshes it under pi's locks, so pi and any number of proxies keep sharing one sign-in. Messages pass through unchanged in both directions.

## Usage

Add the server to pi and sign in:

```bash
pi mcp add notion --url https://mcp.notion.com/mcp
pi mcp login notion
```

Then configure the harness with a stdio server:

```json
{
  "mcpServers": {
    "notion": { "command": "npx", "args": ["-y", "use-pi-mcp", "notion"] }
  }
}
```

When the sign-in is missing or can no longer be refreshed, requests fail with a message to run `pi mcp login <server>`; the proxy never opens a browser.

Only HTTP servers that pi signs in to with OAuth are supported, from the global `mcp.json` (`PI_CODING_AGENT_DIR` is honoured). The file formats are pi's own, so this version matches pi 1.6.0.