# pi-mcp-adapter

pi-mcp-adapter is a skill for the Pi agent that connects MCP servers through one proxy tool instead of loading hundreds of definitions into context. Servers connect on demand.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 202 installs · ★ 9 repo stars
- Author: reason-machines
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/reason-machines/mcp-skills/tree/HEAD/skills/pi-mcp-adapter/SKILL.md
- Updated: 2026-10-09
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/pi-mcp-adapter

## What it does

This skill drops an MCP adapter into the Pi coding agent. A big server would otherwise dump 10k+ tokens of tool definitions into the window; here Pi sees a single `mcp` proxy of roughly 200 tokens and uses it to search, describe or run a tool. Connections open on demand, so the window stays clear. Inside Pi the adapter itself goes in with `pi install npm:pi-mcp-adapter`, then Pi restarts.

Configs stack across four files: `~/.config/mcp/mcp.json`, `~/.pi/agent/mcp.json`, `.mcp.json` and `.pi/mcp.json`, later ones overriding earlier. An entry is either a launch command with args and env, or a URL for HTTP/SSE with headers. OAuth works too: with `autoAuth: true` the handshake runs on the first tool call, otherwise open `/mcp` and press Enter or `ctrl+a`.

Switch on `directTools` and the schemas land in the system prompt, each one costing 150-300 tokens. On a server with hundreds of tools that cancels the savings, so keep the list to what you call constantly. `excludeTools` hides the rest, and `lifecycle` picks between `lazy`, `eager` and `keep-alive`. The default `idleTimeout` is 10 minutes, and zero turns it off.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill pi-mcp-adapter -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/pi-mcp-adapter/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/pi-mcp-adapter/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill pi-mcp-adapter -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/pi-mcp-adapter/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill pi-mcp-adapter -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/pi-mcp-adapter/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install reason-machines/mcp-skills skills/pi-mcp-adapter
```

2. **Manually: put the files in place**
- File: `.github/skills/pi-mcp-adapter/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill pi-mcp-adapter -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/reason-machines/mcp-skills --path skills/pi-mcp-adapter
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/pi-mcp-adapter/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill pi-mcp-adapter -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/reason-machines/mcp-skills/tree/HEAD/skills/pi-mcp-adapter/SKILL.md

## When to use it
- wire an MCP server into Pi without flooding the context window
- keep idle servers from holding a connection open
- expose only the tools the agent actually calls
- run the OAuth handshake for a server on first use
- layer project and global MCP configs in the right order

## Example prompts
- Hook the chrome-devtools MCP server into Pi with pi-mcp-adapter, keep it on the proxy.
- Add a github entry to `.mcp.json` and pull the token from `GITHUB_TOKEN`.
- Turn on OAuth with autoAuth for google-drive so the login happens on the first call.

## Similar
- [authsome](https://affpapa.org/en/nevibecode/skills/authsome.md) — skill · 3000 installs
- [claude-code-proxy-patterns](https://affpapa.org/en/nevibecode/skills/claude-code-proxy-patterns.md) — skill · 106 installs
- [pi-delegate](https://affpapa.org/en/nevibecode/skills/pi-delegate.md) — skill · 3900 installs
- [pi-agent](https://affpapa.org/en/nevibecode/skills/pi-agent.md) — skill · 1500 installs
- [migrating-pi-to-pydantic-ai](https://affpapa.org/en/nevibecode/skills/migrating-pi-to-pydantic-ai.md) — skill · 470 installs
- [opencli-adapter-author](https://affpapa.org/en/nevibecode/skills/opencli-adapter-author.md) — skill · 16600 installs

From the same set: [reason-machines/mcp-skills](https://affpapa.org/en/nevibecode/by/reason-machines/mcp-skills.md) — 98 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
