Skip to main content
Glama

pi-mcp

MCP-Server, der die Coding-Agent-Tools von pi bereitstellt:

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

Erstellt mit Bun und @modelcontextprotocol/server v2. Unterstützt sowohl die Ära 2026-07-28 (server/discover) als auch initialize aus der Ära 2025.

Voraussetzungen

  • Bun >= 1.2

  • rg und fd im PATH (verwendet von grep / find; werden nicht heruntergeladen)

Related MCP server: emcp

Installation

Verwenden Sie einen absoluten Pfad. Übergeben Sie nicht . – Buns globaler Installer kann einen doppelten pi-mcp-Schlüssel und einen leeren Eintrag "": "." in ~/.bun/install/global/package.json / bun.lock schreiben (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 ist ein Alias für bun add -g; der Pfad ist entscheidend. Die Binärdatei landet als pi-mcp im PATH (~/.bun/bin).

Für die lokale Entwicklung verwenden Sie stattdessen bun link in diesem Verzeichnis.

Verwendung

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

Bedeutung

--stdio

Über stdin/stdout bedienen (Standard)

--http

Streamable HTTP bedienen

--host <host>

HTTP-Bind-Host (Standard 127.0.0.1; impliziert HTTP)

--port <port>

HTTP-Bind-Port (Standard 3000; impliziert HTTP)

--cwd <dir>

Arbeitsverzeichnis der Tools

--readonly

Nur schreibgeschützte Tools registrieren

--tools <names>

Kommagetrennte Teilmenge

--shell <path>

Bash-Programm für bash

--allowed-hosts <h>

Kommagetrennte Host-Namen für den HTTP-DNS-Rebinding-Schutz

--stdio kann nicht mit --http / --host / --port kombiniert werden.

Loggen Sie nach stderr. stdout ist der stdio-Protokollkanal.

Host-Konfiguration (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 an den Listener. Moderne Clients (2026-07-28) verwenden server/discover sowie den _meta-Envelope pro Anfrage und die Header Mcp-Method / MCP-Protocol-Version. Clients von 2025 verwenden initialize.

Tools

Tool

Rolle

read

Liest eine Textdatei oder ein Bild (offset / limit für große Dateien)

bash

Führt einen Shell-Befehl in --cwd aus

edit

Exakter Textersatz (gleiche Umwandlungen wie pi: JSON-String edits, einzelnes Edit-Objekt, Legacy oldText/newText)

write

Erstellt/überschreibt eine Datei und erstellt übergeordnete Verzeichnisse

grep

Durchsucht Dateiinhalte mit rg

find

Findet Dateien mit fd per Glob

ls

Listet ein Verzeichnis auf

Das Ausführungsverhalten stammt aus den Coding-Agent-Tools von pi. TUI-Rendering, Photon-Bildskalierung und automatische rg/fd-Downloads sind nicht enthalten.

Entwicklung

bun install
bun src/cli.ts --help

Laufzeitabhängigkeiten: @modelcontextprotocol/server, zod, diff.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    A comprehensive MCP server providing secure tools for filesystem operations, Git management, web search, document conversion, npm/.NET project management, and AI generative capabilities (image/video/audio generation and processing) via PiAPI.ai integration.
    Apache 2.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    MCP server providing filesystem operations, shell execution, and web search capabilities.
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    Local MCP server enabling Codex and ChatGPT to read/write files, execute commands, manage processes, use Git, and inspect images on the user's machine with full privileges.
    Apache 2.0