Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nicobailon/pi-mcp-adapter/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Each MCP server is configured as an entry in themcpServers object in your mcp.json file. The ServerEntry interface defines all available configuration options.
Configuration Structure
Transport Configuration
MCP servers can use either stdio (local process) or HTTP transport.Stdio Transport
For local servers that communicate via stdin/stdout:The executable to run (e.g.,
"npx", "node", "python", or an absolute path).Command-line arguments for the server process.Example:
Environment variables for the server process. Supports
${VAR} interpolation from the parent process environment.Example:Working directory for the server process. Defaults to the current directory.
HTTP Transport
For remote servers accessed via HTTP:The HTTP endpoint URL. The adapter attempts StreamableHTTP transport first, then falls back to SSE if the server doesn’t support it.Example:
Custom HTTP headers to send with requests.Example:
Authentication
Authentication method for HTTP servers.
"oauth"- Uses OAuth tokens from~/.pi/agent/mcp-tokens/<server-name>.json"bearer"- Uses static bearer tokens frombearerTokenorbearerTokenEnv
Static bearer token for authentication. Not recommended for production (use
bearerTokenEnv instead).Example:Name of an environment variable containing the bearer token. More secure than The adapter reads
bearerToken.Example:process.env.API_SERVER_TOKEN at runtime.Lifecycle Management
Controls when the server connects and how it handles disconnections.
lazy(default) - Don’t connect at startup. Connect on first tool call. Disconnect after idle timeout.eager- Connect at startup but don’t auto-reconnect if the connection drops. No idle timeout by default.keep-alive- Connect at startup. Auto-reconnect via health checks. No idle timeout.
Minutes of inactivity before disconnecting the server. Overrides the global
settings.idleTimeout.- Set to
0to disable idle timeout for this server - Only applies to
lazyandeagermodes (keep-alive servers never idle out)
Resource Handling
Whether to expose MCP resources as callable tools.When
true, each resource becomes a tool named get_<resource_name> that reads the resource content.Example:Direct Tool Registration
Controls whether tools from this server are registered as individual Pi tools instead of being accessed through the
mcp() proxy.true- Register all tools from this server as direct Pi tools["tool_a", "tool_b"]- Register only the specified tools (use original MCP names, not prefixed names)falseor omitted - Proxy only (default)
read and bash. This costs ~150-300 tokens per tool but eliminates the need for search calls.Examples:Direct tools register from the metadata cache at startup. On the first session after configuring
directTools, the cache may not exist yet. Run /mcp reconnect <server> and restart Pi to populate the cache.Debugging
Show server stderr output in the terminal. Useful for troubleshooting server startup or runtime issues.By default, server stderr is suppressed to keep the terminal clean.Example:
Complete Examples
Stdio Server (npx)
Stdio Server (local script)
HTTP Server with Bearer Token
HTTP Server with OAuth
~/.pi/agent/mcp-tokens/github.json.
Keep-Alive Server
Server with Direct Tools
Debug Mode
Related
- Settings - Global MCP configuration
- /mcp Command - Manage servers
- /mcp-auth Command - OAuth authentication
- Types Reference - TypeScript interfaces