pi-mcp-client0.12.0
MCP tools for Pi, discovered on demand and called natively through the official SDK.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
π Pi MCP Client
Connect Pi to MCP servers so the model can use their tools and read their resources. You can also browse, preview, and use server-provided prompts.
[!NOTE] On Pi 0.99.1 and later, this extension is no longer needed for basic MCP use: Pi has built-in support for server tools, resources, and OAuth. Keep this extension if you need OS-backed credential storage or the additional features below.
βοΈ Do you need this extension?
Comparison with Pi 1.0.0.
| Feature | Built-in MCP | Pi MCP Client |
|---|---|---|
| HTTP and stdio server tools | β | β |
| OAuth sign-in and token refresh | β | β |
| Tool namespaces and codemode calls | β | β |
| Resource listing, URI templates, and reads | β | β |
| Separate OAuth accounts at the same endpoint | β | β |
| OAuth credentials in the OS credential store | β | β |
| DPoP-bound OAuth tokens | β | β |
| Server prompts with preview before use | β | β |
| Resource argument completion | β | β |
| Resource change watches | β | β |
| Server requests for user input (elicitation) | β | β |
| Configuration imports with preview | β | β |
| OAuth clients requiring a client secret | β | β |
| OAuth authorization-server metadata override | β | β |
HTTP authentication with a provider's /login token |
β | β |
Both read the same mcp.json files, but OAuth credentials don't transfer between
implementations. See
switching to built-in MCP.
π Installation
pi install npm:pi-mcp-client
β¨ Usage
Start a new Pi session, then add Cloudflare's public documentation server:
/mcp add --scope global cloudflare-docs https://docs.mcp.cloudflare.com/mcp
This server doesn't require credentials. Ask Pi:
Search Cloudflare's documentation for how to deploy a Worker.
You configure servers and sign in when needed. The model finds and uses relevant tools and resourcesβyou don't need to select tools before asking a question. When a server needs more information during a tool call, Pi asks you directly and sends only what you submit. See server requests for input.
Use these commands in Pi to manage your connections:
| Command | Purpose |
|---|---|
/mcp |
Check connection status, available-tool counts, and tools loaded for the model when troubleshooting or checking your setup. |
/mcp login <server> |
Sign in to an HTTP server. Only this command opens the login browser. |
/mcp prompt <server> [name] [argument=value ...] |
Browse prompts or open one by name, then review a preview before using it. |
/mcp reload |
Apply changes after editing your MCP configuration files. |
Only configure servers you trust: local servers and secret commands run with your permissions. Tool activation isn't a per-call approval prompt. See trust and permissions.
βοΈ Configuration
Store server definitions in ~/.pi/agent/mcp.json or a trusted project's
.pi/mcp.json, the same files and shape as Pi's built-in MCP support. Project
servers load only in a project that Pi trusts.
Project definitions replace same-named global definitions in full.
You can edit these files or use /mcp add and /mcp remove. To reuse a
Claude/Cursor JSON or Codex TOML file, run /mcp import --scope global <path> and
review the selected connections before saving.
Detailed guides:
- Configuration: HTTP and stdio servers, environment variables, secret commands, tool filters, and timeouts.
- Authentication: OAuth setup, pre-registered clients, remote login, and logout.
- Commands: Server management, tool browsing, prompt selection, and resource watches. These are commands you run in Pi.
- Tool reference: Discovery, activation, resource reads, and argument completions. This is the model's interface, not a user API.
- Behavior: When servers connect, when tools become available, and what permissions they have.
- Troubleshooting: Error codes, recovery, and large results.
𧬠Pi Durable
Custom hosts can use the experimental pi-mcp-client/durable adapter for
metadata discovery, native tool activation, resource reads, and template
completion. It shares configuration and the MCP credential store with this
extension. See the durable host contract for installation,
restart ordering, trust, and UI requirements.
π§° Requirements
- Pi 0.99 or later.
- Node.js 22 or later.
- The server executable for stdio connections.
- An available OS credential store for OAuth. Linux requires a working Secret Service/keyring session.