Skip to main content
Glama

jcode-mcp

An MCP server that lets Claude (Desktop or Code) orchestrate jcode agent sessions. Claude plans and verifies. jcode agents do the work in parallel, one git worktree each.

Connected to your own jcode, the sessions it creates are normal jcode sessions: they appear in the jcode TUI and in jcode Desktop, where you can watch or steer them.

Claude Desktop / Claude Code
        |  MCP (stdio)
        v
    jcode-mcp  --- @1jehuang/jcode-sdk --->  jcode harness API bridge  ---> jcode daemon
                                                                              |  |  |
                                                                  agent sessions (worktrees)
                                                                              ^
                                                              jcode TUI / jcode Desktop

Install

Requires Node 20 or newer. The jcode runtime ships inside the SDK package, so no separate jcode install is needed (installing jcode yourself works too).

git clone https://github.com/ymatrix1/jcode-mcp
cd jcode-mcp
npm ci && npm run build

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "jcode": {
      "command": "node",
      "args": ["/absolute/path/to/jcode-mcp/dist/src/cli.js"],
      "env": { "JCODE_MCP_AUTOSTART_BRIDGE": "1" }
    }
  }
}

Claude Code

claude mcp add jcode -e JCODE_MCP_AUTOSTART_BRIDGE=1 -- node /absolute/path/to/jcode-mcp/dist/src/cli.js

Optionally copy skills/orchestrate-jcode into your skills directory so Claude follows a consistent delegate, wait, verify workflow.

Related MCP server: z-code-mcp

Tools

Tool

Purpose

spawn_agent

Start a jcode session on a task, optionally in a fresh git worktree and branch. Returns at once.

wait_agents

Block up to 50 s until any or all agents finish or ask for a permission.

agent_status / list_agents

State, tool counts, token usage, pending permissions, warnings.

agent_output

Last final message, optionally the last N transcript messages.

message_agent

Soft-interrupt a running agent, or start a new turn on an idle one.

respond_permission

Allow or deny a pending tool permission request.

cancel_agent

Interrupt the current turn.

close_agent

Stop tracking; optionally archive the session and remove the worktree.

list_jcode_sessions

Sessions the jcode daemon knows, including ones not spawned here.

States: starting, running, idle, failed, cancelled, disconnected, closed. After a daemon reload, running agents show disconnected; message_agent re-attaches and starts a new turn.

Configuration

Variable

Default

Meaning

JCODE_MCP_MODE

connect

connect attaches to your jcode so sessions are visible in Desktop and the TUI. launch starts a private instance (not visible to your own clients, dies with this process).

JCODE_MCP_AUTOSTART_BRIDGE

off

Set 1 to start jcode api-bridge if nothing is listening. Opening jcode Desktop also starts it.

JCODE_MCP_INHERIT_LOGINS

1

launch mode: copy your provider logins into the private instance. 0 starts with none.

JCODE_MCP_SOCKET

SDK default

Harness API socket path.

JCODE_MCP_BINARY

bundled

Path to a jcode binary.

JCODE_MCP_WORKTREE_ROOT

~/.jcode-mcp/worktrees

Where worktrees are created.

JCODE_MCP_ALLOWED_ROOTS

unrestricted

Colon-separated directories agents may work in. Strongly recommended.

Seeing sessions in jcode Desktop

In connect mode this server talks to the same harness API socket that jcode Desktop uses, and Desktop lists sessions from the daemon. Two things to know:

  • Desktop refreshes its session list every workspace.session_refresh_seconds (default 60, minimum 5). A new session can take that long to appear.

  • Desktop's nested swarm tree is built from jcode's own swarm ownership. Sessions spawned here are ordinary top-level sessions, named label: title.

Safety

  • jcode agents run as your OS user with your provider logins. Per-session tool limits are not a sandbox. Use JCODE_MCP_ALLOWED_ROOTS, keep auto_approve off by default, and review diffs before merging.

  • jcode picks up provider credentials it finds on the machine. If an agent turn ends with a warning about no output, check which provider jcode is using.

  • Using a Claude subscription login through third-party harnesses may be restricted by Anthropic's terms. Prefer an API key.

Development

npm test                      # unit tests with a fake jcode client and real git
JCODE_MCP_E2E=1 npm test      # also runs the real jcode binary in throwaway state

Tests cover the worktree helpers, agent state machine (including reconnect, cancel, permissions, wait), config, and the MCP tool layer through an in-memory MCP client. The e2e test needs no model credentials, so it proves session creation, naming and listing, not model output.

License

MIT

Available Tools

10 tools
agent_outputB

The agent's last final message, plus optionally the last N transcript messages. Do not treat a worker's claim of success as proof: check its diff and run the tests yourself.

Inputs: id (required), tail.

agent_statusA

State of one agent: running, idle, failed, cancelled, disconnected.

Inputs: id (required).

cancel_agentA

Interrupt the agent's current turn. The session stays open and can be messaged again.

Inputs: id (required).

close_agentA

Stop tracking an agent. Optionally archive the jcode session (hides it in Desktop) and remove its git worktree. Removing a worktree with uncommitted changes needs force=true.

Inputs: id (required), force, archive, remove_worktree.

list_agentsB

List agents spawned through this server, with state, tool counts and pending permission requests.

Inputs: include_closed.

list_jcode_sessionsB

List sessions known to the connected jcode daemon, including ones this server did not spawn.

Inputs: limit.

message_agentA

Send text to an agent. A running agent gets it as a soft interrupt (urgent=true skips pending tool calls); an idle agent starts a new turn with it.

Inputs: id (required), text (required), urgent.

respond_permissionC

Answer a pending tool permission request shown in agent_status.pending_permissions.

Inputs: id (required), decision (required), request_id (required).

spawn_agentA

Start a jcode agent session on a task and return immediately. The session is a normal jcode session (visible in jcode Desktop and the TUI when connected to the user's jcode). Give it a git worktree so parallel agents do not edit the same files. Poll with agent_status, or block briefly with wait_agents.

Inputs: label (required), prompt (required), model, title, +3 more.

wait_agentsA

Block up to timeout_seconds (max 50) until any or all agents stop running or ask for a permission. Prefer this over repeated polling.

Inputs: ids (required), mode, timeout_seconds.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 10 tools

    Disambiguation4/5

    Each tool has a distinct role in the agent lifecycle (spawn, observe, interact, terminate), and descriptions clearly differentiate them. The only mild overlap is between list_agents, agent_status, and list_jcode_sessions, though the descriptions distinguish server-spawned agents from daemon-wide sessions.

    Naming Consistency4/5

    Eight of ten tools follow a verb_noun pattern (spawn_agent, list_agents, wait_agents, message_agent, cancel_agent, close_agent, respond_permission, list_jcode_sessions). agent_status and agent_output break the pattern with noun-first naming, a minor but noticeable deviation.

    Tool Count5/5

    Ten tools is well-scoped for an agent orchestration server, covering exactly the lifecycle phases a caller needs. No tool appears redundant or vestigial.

    Completeness4/5

    The surface covers spawn, monitor, message, wait, cancel, close, and permission handling — a full lifecycle. Minor gaps include no tool to fetch an agent's diff or worktree state (descriptions tell you to inspect manually) and no resume/restart operation for a closed agent.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables Claude Code to orchestrate a team of independent Claude Code sessions within iTerm2 for parallel task execution and isolated git worktree management. It provides tools to spawn, monitor, and message worker sessions while maintaining full visibility and control over their terminal windows.
      48
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      Enables Claude Code to launch and supervise multiple concurrent Claude Code sessions in tmux, sending them briefs, reading their progress, answering their prompts, and managing isolated git worktrees.
      20
      2
      MIT