# pi-session-mcp [Health: Active]

**Category:** 🤖 Coding Agents  
**Repository:** https://github.com/plagor44-ux/pi-session-mcp  
**GitHub Stars:** 1  
**npm Downloads (last month):** 5058  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/pi-session-mcp

## Description
Local stdio MCP server that lets Codex and Claude Code delegate work to configured Pi coding-agent sessions

## Tools
Capabilities this server exposes over MCP:

- **pi_capabilities_get** — List the configured workspace and execution-profile aliases.
- **pi_session_start** — Start a session for one workspace alias and one execution-profile alias.
- **pi_session_list** — List the sessions of this server process.
- **pi_session_get** — Read one session.
- **pi_session_prompt** — Send a prompt and get a running turn back.
- **pi_turn_get** — Poll a turn until it is `completed`, `failed` or `aborted`.
- **pi_session_abort** — Abort a running turn.
- **pi_session_close** — End a session and release its resources.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "pi-session-mcp": {
    "command": "npx",
    "args": ["-y","pi-session-mcp"]
  }
}
```

## Documentation

## 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.

_Full upstream README: https://allmcps.com/mcp/pi-session-mcp/readme_

