Pi Session MCP logo

Pi Session MCP

Delegates bounded Pi coding-agent sessions from Codex or Claude Code through a local stdio MCP server.

Install Pi Session MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "pi-session-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "pi-session-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y pi-session-mcp

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

pi-session-mcp lets Codex or Claude Code start and manage Pi coding-agent sessions through MCP over local stdin and stdout. It restricts clients to workspace and execution-profile aliases defined in a local configuration, rather than allowing arbitrary directories, models, or permission levels. Sessions remain in memory while the server runs, with separate operations for prompting, polling turns, aborting work, and cleanup. Reach for it when a coding agent needs a second model for code review, repository exploration, or delegated work under configured limits.

Use cases

  • Request a second-model review of source files and tests
  • Delegate repository exploration to a separate Pi session
  • Route routine coding analysis to a selected model
  • Maintain context across follow-up prompts
  • Automate bounded agent turns with explicit cleanup

Key features

  • Local MCP communication over stdio
  • Workspace and execution-profile aliases
  • In-memory session lifecycle management
  • Prompt, polling, abort, and close operations
  • Configurable profile tool and permission limits
  • Provider, model, and thinking-level selection

Tools8

What Pi Session MCP lets your agent do. Expand a tool for its parameters.

Self-reported~119 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 1d ago via OSV.dev · pi-session-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
npm downloads5.1kPackage downloads in the last 30 days.
Last commit8d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Tools exposed8Callable tools this server registers over MCP.

How Pi Session MCP works

What pi-session-mcp does

pi-session-mcp connects Codex or Claude Code to Pi coding-agent sessions through a local, stdio-only MCP server. It embeds the Pi SDK, starts sessions for configured workspaces and execution profiles, and returns the worker's responses to the controlling agent.

The client chooses aliases rather than raw paths, models, or permission settings. An execution profile can bind a provider, model, thinking level, permitted skills, and external MCP tools. A default read-only profile supports repository inspection without granting general write access or command execution.

Typical uses include asking another model for a code review, moving repository exploration out of the primary agent's context, or routing routine work to a selected local or lower-cost model. Follow-up prompts can use the context of an existing session.

How it works

Communication uses MCP over stdin and stdout, and the server is intended to run locally. It keeps active sessions in memory and communicates with Pi through the embedded SDK. A controller can discover aliases, start a session, submit a prompt, poll the resulting turn, and then close the session.

Turns expose a small lifecycle: they can complete, fail, or be aborted. Session and capability metadata, along with errors, avoid including paths, credentials, prompts, or raw provider errors. The worker's assistantText is model output and is returned without sanitization.

Workspace and execution-profile aliases come from local configuration. Provider access is established separately through a provider account sign-in or a key stored in the provider store. Profiles may also opt into a sandboxed shell or grant tools from extensions and external MCP servers.

Setup and configuration

Linux and macOS are supported with Node.js 22.19.0 or newer. The release installer downloads a shell script and checksum, verifies the download, installs the pinned npm package, and starts guided setup. The setup flow can propose profiles from Pi's offline model catalog and asks before probing providers, changing existing configuration, or allowing host writes.

Installation can also be performed from npm or a release tag, followed by manual configuration and client registration. Guided setup can be run without applying changes, and an agent-oriented installation path is available for non-interactive environments.

Provider credentials are handled separately from setup. Users can sign in through pi-session-mcp-provider auth login or store an API key with pi-session-mcp-provider auth set; setup receives only the command's exit status.

Tools and capabilities

  • pi_capabilities_get lists configured workspace and execution-profile aliases.
  • pi_session_start starts a session using one workspace alias and one execution-profile alias.
  • pi_session_list lists sessions owned by the running server process.
  • pi_session_get reads an individual session.
  • pi_session_prompt sends a prompt and returns a running turn.
  • pi_turn_get polls a turn until it completes, fails, or is aborted.
  • pi_session_abort stops a running turn.
  • pi_session_close ends a session and releases its resources.

The server can keep follow-up prompts in the same session, while the final worker response is capped at 64 KiB.

Limitations and notes

This is a pre-1.0 local integration for Linux and macOS, not a remote service. It does not provide persistent sessions across a server restart, multi-user access, or remote access. A coding profile limits Pi's available tools but is not an operating-system sandbox; granted extension or external MCP tools can write or run commands outside the restrictions of the built-in read-only setup.

The controlling client decides which prompts and tool calls to make, and the worker can return incorrect findings. Authentication for the selected provider must be configured separately. Use Pi directly when the goal is to work with Pi interactively rather than delegate through Codex or Claude Code.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Pi Session MCP

pi-session-mcp is an MCP server that connects Codex or Claude Code to configured Pi coding-agent sessions over local stdio. Its main tools discover aliases, start and inspect sessions, send prompts, poll turns, abort work, and close sessions. It keeps active sessions in memory and applies profile-defined workspace and tool limits.

Install it on Linux or macOS with Node.js 22.19.0 or newer using the release installer, then run the guided setup. The installer verifies its checksum, installs the pinned npm package, and launches configuration. You can also install from npm or a release tag and register the client manually.

Define workspace and execution-profile aliases in the local configuration, then register the server with the MCP client. Profiles select a provider, model, thinking level, and allowed skills or external tools. The client can use aliases only; it cannot select arbitrary directories, models, or permission levels.

Yes, pi-session-mcp is intended for Codex CLI and Claude Code. Those clients can call its MCP tools to discover configured aliases, delegate prompts to Pi sessions, poll turns, and close sessions. The server communicates locally over stdio rather than providing remote access.

No, sessions are held in memory by the running server process and do not survive a restart. Close each session when its work is complete to release its resources. The server is also not designed for remote access or multiple users sharing persistent sessions.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewPi Session MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/pi-session-mcp?style=directory)](https://allmcps.com/mcp/pi-session-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/pi-session-mcp"><img src="https://allmcps.com/api/badge/pi-session-mcp?style=directory" alt="Pi Session MCP on AllMCPs" /></a>