claude-sessions-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@claude-sessions-mcpspawn a session to review the open PRs and report back"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
claude-sessions-mcp
An MCP server for creating and driving Claude Code sessions inside a running Remote Control server, over the REST API the bridge itself uses.
An agent can call in a colleague that is not running yet, hand it a prompt, and have it start working — as a session that belongs to the project's server, with its worker under that server, visible in claude.ai and reachable from the other sessions on the machine. The same tools let you survey and steer every agent running there from a session opened on a phone.
Runs as a single process per machine (streamable-HTTP on 127.0.0.1), not as a
stdio subprocess per session.
See the design for the verified API surface, how bridge servers are discovered without any host-specific configuration, the tools, and the safety rails around spawning agents.
Usage
Build
npm install
npm run buildInstall as a systemd user service
Copy the unit into your systemd user directory and adjust the two paths to where you checked out this repository:
cp deploy/claude-sessions-mcp.service ~/.config/systemd/user/Edit WorkingDirectory= and ExecStart= in the copied unit if the repository
does not live directly under your home directory (the shipped unit assumes
~/claude-sessions-mcp). Then enable and start it:
systemctl --user enable --now claude-sessions-mcpRegister it with Claude Code
claude mcp add --transport http --scope user sessions http://127.0.0.1:8765/mcpEnvironment variables
Variable | Default | Meaning |
|
| Interface to bind. Only |
|
| Port the server listens on (loopback only). |
|
| Ceiling on sessions this server may have spawned and left active per bridge. |
|
| Where Claude Code keeps its config, including bridge pointer files. |
|
| Path to the claude.ai OAuth credentials file. |
Requirements
Node.js 22 or newer (the code is ESM and uses ES2023 library features).
Linux only — bridge discovery reads /proc to find running Remote Control
servers and their workers. The server must run as the same user as the
bridges it talks to: it reads their process table and the shared credentials
file, both of which are only visible to that user.
The server keeps no state between calls: no session registry, no database, no
files of its own. wait_for_idle holds an event stream open for the duration
of that one call, and alongside it polls the session's status, because
archiving a session cuts its turn short without emitting anything on the
stream. Both end with the call: nothing is subscribed or watched between
calls.
Safety rails
permission_modeacceptsauto,acceptEdits,plan,manualordontAskonly.bypassPermissionsis refused outright, never downgraded.Sessions can be spawned only in bridges discovered on this machine, never in a raw environment id.
CLAUDE_SESSIONS_MCP_MAX_SPAWNEDbounds how many active sessions this server may have created per bridge; if that count cannot be established completely, the spawn is refused rather than allowed.Every created session is tagged
mcp:claude-sessions-mcpandspawned-by:<caller>.
Related MCP server: Claude Code MCP
Releasing
The version lives in one place, package.json; the server reports it in the
MCP handshake, and a test asserts the two agree.
npm run release -- patch | minor | major | X.Y.ZThe script refuses a dirty tree or a branch other than master, checks that
the target tag is free and that origin is not ahead, runs the build and the
tests, then bumps the version, commits and tags vX.Y.Z. Pushing is left to
you — it prints the command.
Pushing the tag opens a draft release with generated notes
(.github/workflows/release-draft.yml); edit it into something worth reading
and publish it by hand. Nothing else reacts to a tag: there is no build to
trigger and nothing to deploy.
Every push and pull request runs the build and the test suite
(.github/workflows/ci.yml).
Inside Claude Code, /build [patch|minor|major|X.Y.Z] walks the whole cycle:
release script, tag push, both workflows, the draft notes, and a restart of the
local service if one is installed. It stops short of publishing the release.
License
MIT — see LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
- mcp-serverOAuthai.cdbx
Build Apps and run code in 30 languages — sandboxed, with persistent sessions for agent loops.
Drive real devices from your AI Coding tool. Embed a client SDK (Unity, Godot, Flutter, iOS/macOS, Android, React Native, Web) in your app, then capture screenshots, traverse the UI tree, inject taps and key events, and run automated test tasks on the physical device over a secure relay.
On-demand GPU nodes for agents: create nodes, run commands, and submit jobs, billed by the minute.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables MCP clients to spawn and control Codex CLI and Claude Code sessions on the host machine, with session management and filesystem access.4MIT
- AlicenseAqualityDmaintenanceEnables AI agents to interact programmatically with Claude Code CLI, managing sessions, streaming outputs, and handling permission requests.75 npm1MIT
- AlicenseAqualityBmaintenanceLocal MCP bridge that lets Codex operate local Claude Code sessions, including listing, starting, resuming, forking, prompting, and stopping conversations via the Remote Control CLI.14MIT
- FlicenseNot gradedqualityBmaintenanceEnables MCP hosts like Claude Code and Codex to spawn, manage, and interact with persistent, reusable Pi coding-agent sessions, supporting task dispatch, status checks, and session lifecycle control.2 npm-