pi-subagent-mcp

pi-subagent-mcp

Exposes pi as a sub-agent for MCP-capable coding assistants, enabling task dispatch, messaging, and interactive dialog handling via tools like pi_dispatch, pi_send, and pi_respond.

Category
Visit Server

README

pi-subagent-mcp

MCP server that exposes pi (pi --mode rpc) as a sub-agent for MCP-capable coding assistants (e.g. Kimi CLI).

Build

npm install
npm run build

Tools

Tool Purpose
pi_dispatch Spawn a pi session on a task (task, cwd, model?, name?, interactive?, approve?) → {taskId}
pi_send Message a task (mode: auto/prompt/steer/followUp)
pi_status State, streaming flag, last assistant text, current tool, pendingRequest
pi_read Incremental event buffer read (since seq)
pi_wait Block until the run finishes or a dialog needs answering; returns last assistant text + pendingRequest
pi_respond Answer a pendingRequest dialog (value / confirmed / cancelled)
pi_abort Abort current operation; session stays alive
pi_close Kill the process, drop the task
pi_list All tasks

Extension UI dialogs (bidirectional interaction)

pi extensions can block on select/confirm/input/editor dialogs (extension_ui_request). By default (interactive: true) the server surfaces these as pendingRequest in pi_status/pi_wait — which returns early — and the caller answers with pi_respond. With interactive: false (unattended runs) dialogs are auto-cancelled, preserving the original behavior.

Note: project-local pi extensions (.pi/extensions/) only load when the project is trusted — pass approve: true to pi_dispatch to grant that for the run. Also, pi delays the command response for extension commands that block on a dialog; the server therefore treats dialog activity as command acceptance so pi_dispatch/pi_send return instead of deadlocking.

Configuration

Environment variables:

  • PI_SUBAGENT_SESSION_DIR — where pi session files are stored (default: .pi-subagent/sessions/ next to the package).
  • PI_SUBAGENT_PI_PATH — override the pi binary path (default: pi).

MCP registration (example): point your client at node /path/to/dist/src/server.js.

Test

npm test   # unit + smoke + (if pi is installed and logged in) integration

Additional end-to-end scripts in scripts/ (acceptance-test.mjs, mcp-e2e-test.mjs, dialog-e2e-test.mjs). Issues found during development are logged in docs/issues/.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured