Skip to main content
Glama

pi-mcp

MCP server that exposes pi coding-agent tools:

read, bash, edit, write, grep, find, ls

Built with Bun and @modelcontextprotocol/server v2. Serves both the 2026-07-28 era (server/discover) and 2025-era initialize.

Requirements

  • Bun >= 1.2

  • rg and fd on PATH (used by grep / find; not downloaded)

Install

Use an absolute path. Do not pass . — Bun's global installer can write a duplicate pi-mcp key and an empty "": "." entry into ~/.bun/install/global/package.json / bun.lock (oven-sh/bun#19559, oven-sh/bun#24207).

bun add -g /absolute/path/to/pi-mcp
# same thing from the checkout:
bun add -g "$(pwd)"

bun install -g is an alias of bun add -g; the path is what matters. The binary lands on PATH as pi-mcp (~/.bun/bin).

For local development, bun link in this directory instead.

Usage

pi-mcp                         # stdio (default)
pi-mcp --http --port 3000      # Streamable HTTP
pi-mcp --cwd /path/to/project
pi-mcp --readonly              # read, grep, find, ls
pi-mcp --tools read,grep,ls
pi-mcp --shell /bin/bash

Flag

Meaning

--stdio

Serve over stdin/stdout (default)

--http

Serve Streamable HTTP

--host <host>

HTTP bind host (default 127.0.0.1; implies HTTP)

--port <port>

HTTP bind port (default 3000; implies HTTP)

--cwd <dir>

Tool working directory

--readonly

Register only read-only tools

--tools <names>

Comma-separated subset

--shell <path>

Bash executable for bash

--allowed-hosts <h>

Comma-separated Host names for HTTP DNS-rebinding protection

--stdio cannot be combined with --http / --host / --port.

Log to stderr. stdout is the stdio protocol channel.

Host config (stdio)

{
  "mcpServers": {
    "pi": {
      "command": "pi-mcp",
      "args": ["--cwd", "/path/to/project"]
    }
  }
}

HTTP

pi-mcp --http --host 127.0.0.1 --port 3000

POST JSON-RPC to the listener. Modern (2026-07-28) clients use server/discover plus the per-request _meta envelope and Mcp-Method / MCP-Protocol-Version headers. 2025 clients use initialize.

Tools

Tool

Role

read

Read a text file or image (offset / limit for large files)

bash

Run a shell command in --cwd

edit

Exact text replacement (same coercions as pi: JSON-string edits, single edit object, legacy oldText/newText)

write

Create/overwrite a file, creating parent directories

grep

Search file contents with rg

find

Glob files with fd

ls

List a directory

Execute behavior is taken from pi's coding-agent tools. TUI rendering, photon image resizing, and automatic rg/fd downloads are not included.

Development

bun install
bun src/cli.ts --help

Runtime dependencies: @modelcontextprotocol/server, zod, diff.

-
license - not tested
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • An MCP server that gives your AI access to the source code and docs of all public github repos

  • MCP server exposing the Backtest360 engine API as tools for AI agents.

  • A MCP server built for developers enabling Git based project management with project and personal…

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zhaob1n/pi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server