Skip to content

MCP server

The MCP server gives a connected agent 13 tools. It runs on your machine and needs no shadowclone credentials.

The shadowclone plugin registers the server and starts shadowclone mcp after you install the CLI. For another agent that supports stdio servers, add a server that runs shadowclone mcp, then restart the agent session.

For OpenCode, add this entry to ~/.config/opencode/opencode.json. OpenCode 1.x and 2.x both accept this shape.

{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"shadowclone": { "type": "local", "command": ["shadowclone", "mcp"], "enabled": true }
}
}

To reach your clones from the Claude app or another machine, use the hub. It serves the two clone tools over HTTPS with OAuth, and shadowclone_pair for your live sessions. On a machine that joined a hub, shadowclone mcp sends the two clone tools to the hub, so they cover every machine.

The server reads one JSON-RPC 2.0 message from standard input on each line. It uses MCP protocol version 2024-11-05 and the methods initialize, tools/list, and tools/call. The tools follow your consent settings and managed policy. If policy turns shadowclone off, they return “shadowclone context is disabled.”, an error, or no results. Opening the server makes no model request.

  • shadowclone_context returns the learned skills and native routing for the repository where the server runs, the same text as shadowclone context.
  • shadowclone_remember takes text (1 to 8,192 characters) and scope (repository or global). It records the preference locally and returns “Recorded preference” with its key. The tool description tells the agent never to infer consent from a task or an interruption.
  • shadowclone_history returns a JSON list of revision identifiers with their times and counts.
  • shadowclone_skills_status returns JSON with roots (the enabled skill roots), managed (the skills that shadowclone maintains), and pending (the items that wait for review). It makes no model call.
  • shadowclone_bot configures the Actions bot or reads its status.
  • shadowclone_clone_setup pushes skills for clones, sets them up on this machine, or checks them.
  • shadowclone_sessions lists the clones on this machine, or returns one clone. It is read only.
  • shadowclone_clone starts, steers, answers, or stops a clone.
  • shadowclone_peer sends a note to the live session that the owner paired with this session.
  • shadowclone_ask lets a live session ask the owner a question, and waits for the answer.
  • shadowclone_project connects a native session to a local project. An IDE agent joins with the one-time code that the owner gives it.
  • shadowclone_project_work reads the goal and the threads of a project. The lead and its workers take and give back board steps with it.
  • shadowclone_project_context returns the context path, one file, or the board of a project. It works for a project that the owner named, or one where the session holds a seat.

Tools other than shadowclone_context reject unlisted input fields.

shadowclone_bot takes these inputs:

  • operation: setup or status. Required.
  • repository: the repository as owner/repository.
  • bot: the GitHub login of the machine account.
  • approveSkills: true only after the owner approved the listed skill files.
  • provider: anthropic (default), openai, openai-compatible, or cursor.
  • baseUrl and model: the https base URL and the model for openai-compatible. model also works with the other providers.

The behavior depends on the inputs:

  • status with a saved repository returns the open setup steps. When every step is done, it starts the check run and waits up to 45 seconds. A later status call continues a check run that is still in progress. Without repository, it returns the saved bot status as JSON.
  • setup with bot and repository sets up a machine account bot, and opens the GitHub signup page if the account does not exist. The first call returns the skill files that setup will push. Show the list to the owner, and call again with approveSkills set to true only after the owner agrees. The last answer gives one environment link for the bot token and the API key, and the setup pull request link.
  • setup without bot or repository returns an error that asks for them.

The owner adds the bot token and the API key on GitHub, never in the tool. See the Actions bot guide.

shadowclone_clone_setup takes operation and these inputs:

  • skills: push the equipped skills of the current checkout. The first call returns the files. Call again with approve set to true only after the owner agrees.
  • setup with repository and provider. Add baseUrl and model when the provider needs them. attribution: false turns off the trailer.
  • status with repository runs the check in Docker.

The tool rejects a token field. The owner adds tokens in the secrets file that setup names. See clones.

shadowclone_clone takes operation:

  • start with repository and task, the owner’s task or the plan that the owner approved. Add issue or pull to work on one, or review: true with pull to review a pull request. The answer gives the clone id, or the reason that the node refused it.
  • send with id and text gives a running clone the owner’s message.
  • answer with id, question, and text answers an open question of the clone.
  • stop with id stops the clone. A running clone pushes its unfinished work first.

With live sessions on, the tools also cover your own Claude Code and Codex sessions, with live- ids. send reaches a live session. answer answers the open question of a live session, named by question. stop does not reach a live session. list also names the open pairs of live sessions, and shows the open question of each live session with its options.

With task briefs on, list adds the brief of each idle session whose last message made the brief. The session line then shows the kind and the name. The next lines give the goal, what the agent did, the need, and any options. A line before them marks the brief as a summary by a model and as data. See name each task.

shadowclone_sessions takes operation:

  • list, with an optional repository, returns each clone with its state, branch, and pull request.
  • get with id returns one clone with its task, questions, report, and recent events. The answer starts with a line that marks the clone text as data.

Through the hub, list and the get of a live session also return structuredContent for the session board. shadowclone mcp returns only the text, and links to no view.

shadowclone_sessions carries the readOnlyHint annotation, so a client can run it without a question. shadowclone_clone does not.

shadowclone_ask needs live sessions and task briefs on (shadowclone live briefs enable). With task briefs on, the SessionStart hook gives each session one line of context with its live- id. The line tells the agent to call shadowclone_ask when a decision is the owner’s and the task text does not answer it.

The tool takes these inputs, all required:

  • session: the live- id from the session start line.
  • question: the decision, at most 2000 characters.
  • options: 2 to 4 choices, each at most 200 characters.
  • recommended: the option that the agent recommends. It must be one of the options.

The session shows needs-you with the question, and the call waits up to 50 seconds. When the owner answers with shadowclone_clone answer, the call returns the answer. If no answer arrives in time, the call tells the agent to end its turn with the question and to take no option. The question stays open, and a later answer reaches the session as an owner message, as send does.

A session can have one open question. A second call returns an error that names the open question. The question closes when the session gets the answer, when the session ends, or when you type a prompt into the session after the wait.

shadowclone_peer takes operation (send), key, and text. The key comes from the pairing note that a session gets after the owner pairs it. The answer says whether shadowclone typed or queued the note, and how many notes the pair has left. A wrong key, a pair with no notes left, and an ended session return an error.

Only the hub serves shadowclone_pair. It takes operation: pair with two live- ids in sessions, unpair with pair, or list. See the hub.

An enrolled agent uses shadowclone_project to join, receive and acknowledge work. It uses shadowclone_project_work to read threads, assign steps, report results, ask questions and publish files. A project has one lead and any number of worker seats, with up to 4 workers live at once. Workers are named worker, worker-2, and so on. The lead sends a thread or a step to one worker by its role. The owner’s messages go to the lead. The local server handles both tools when connected to a hub. See the Projects guide.

shadowclone_project_context finds the project that links the repository of the MCP server. Operation here returns the context path and the file list. Operation read returns one context file, for an agent whose sandbox blocks the context folder. It reads only files inside that project context. Operations board, claim, and release show the plan steps and take or give back a step for a named session.