@vaayne/pi-mcp
Pi extension for MCP (Model Context Protocol) server integration
Package details
Install @vaayne/pi-mcp from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@vaayne/pi-mcp- Package
@vaayne/pi-mcp- Version
0.2.2- Published
- Apr 14, 2026
- Downloads
- 159/mo · 14/wk
- Author
- vaayne
- License
- MIT
- Types
- extension
- Size
- 22.5 KB
- Dependencies
- 1 dependency · 3 peers
Pi manifest JSON
{
"extensions": [
"./index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
MCP Extension
A Pi extension that connects to MCP (Model Context Protocol) servers and provides tools to interact with them.
Tools
mcp_list
List all available MCP tools with names and descriptions.
mcp_inspect
Show full tool signature as a JSDoc function stub.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
tool |
string | Yes | Name of the MCP tool to inspect |
mcp_invoke
Call a single MCP tool with JSON parameters.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
tool |
string | Yes | Name of the MCP tool to invoke |
params |
object | No | Parameters to pass to the tool |
mcp_exec
Execute JavaScript code to orchestrate multiple MCP tool calls with logic.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
code |
string | Yes | JavaScript code using mcp.callTool(name, params) |
Configuration
Create mcp.json in your Pi agent directory to configure MCP servers.
Config file location: $PI_CODING_AGENT_DIR/mcp.json (defaults to ~/.pi/agent/mcp.json)
Requirements
This extension depends on the mh CLI from MCP Hub.
Automatic Installation
The mh binary is automatically installed during npm install via the postinstall script. It will be installed to ~/.local/bin/ (or $XDG_BIN_HOME if set).
Manual Installation
If automatic installation fails, you can install mh manually:
# Using the install script
curl -fsSL https://raw.githubusercontent.com/vaayne/mcphub/main/scripts/install.sh | sh
# Or build from source
git clone https://github.com/vaayne/mcphub.git
cd mcphub
go build -o ~/.local/bin/mh .
Ensure ~/.local/bin is in your PATH:
export PATH="$PATH:$HOME/.local/bin"