@codella/pi-mcp-support
v0.1.1
Published
Generic Model Context Protocol support extension for Pi.
Maintainers
Readme
@codella/pi-mcp-support
Generic Model Context Protocol (MCP) support extension for Pi.
It connects configured MCP servers and registers each server tool as a Pi tool named:
mcp_<server>_<tool>It also exposes helper tools for MCP status, resources, and prompts.
Install
pi install npm:@codella/pi-mcp-supportConfiguration
Create a project config:
.pi/mcp.jsonOr a global config:
~/.pi/agent/mcp.jsonLegacy global config is also supported:
~/.pi/mcp.jsonExample:
{
"servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
},
"remote": {
"url": "http://localhost:3000/mcp",
"transport": "streamable-http",
"headers": {
"Authorization": "Bearer ${MCP_TOKEN}"
}
}
}
}Server config
type ServerConfig = {
command?: string;
args?: string[];
env?: Record<string, string>;
cwd?: string;
url?: string;
transport?: "stdio" | "streamable-http" | "sse";
headers?: Record<string, string>;
disabled?: boolean;
};- If
urlis present, transport defaults tostreamable-http. - Without
url, transport defaults tostdioand requirescommand. - Environment variables in config values can be referenced as
${NAME}.
Commands
/mcp- Show loaded config, connected MCP servers, and registered tools.
Built-in helper tools
mcp_statusmcp_read_resourcemcp_list_resourcesmcp_list_promptsmcp_get_prompt
License
MIT
