Skip to main content
Glama

t3-shadow-mcp

English | 简体中文 | Antigravity V3 Lossless Patch (macOS & Windows)

Zero-dependency local MCP server for T3 Code that equips every agent (Claude Code, Codex, Antigravity, etc.) with parallel hot-memory shadow-cloning, SL conversation rollback (including delegated subagents), and batch sidebar cleanup — with zero modifications to T3 Code for Claude Code & Codex, plus a bundled cross-platform Antigravity V3 Lossless Patch Suite (macOS & Windows) to bring Antigravity to the exact same 100% lossless tier.


Why t3-shadow-mcp?

T3 Code's built-in MCP lets agents delegate blank subagents (delegate_task) or fork a single thread (t3_thread_transfer), but leaves two major gaps for multi-agent orchestration:

  1. No programmatic rollback: T3's built-in MCP does not expose checkpoint.rollback. When a subagent or branch goes off-track or pollutes its context with dead-end tool output, orchestrators cannot rewind it — forcing them to either drag dirty history forward or burn tokens starting from scratch.

  2. Clunky warm fan-out & sidebar clutter: Spawning N parallel workers from a warm subagent that already understands a large codebase requires chaining multiple manual calls, lacks cold-start staggering, doesn't verify native_fork vs lossy portable_context fallback, and leaves finished clones scattered across the sidebar.

t3-shadow-mcp speaks T3 Code's native local WebSocket RPC (orchestration.getThreadProjection & orchestration.dispatchCommand) directly, packaging all four operations into clean MCP tools plus a reusable shadow-clone Skill.


Related MCP server: agent-intern

Works on Stock T3 Code (Zero Source Patching Required)

Provider

Stock T3 Code (shadow_fork_batch)

Stock T3 Code (shadow_rollback)

Notes

Claude Code

100% lossless native_fork (0 Context handoff)

100% lossless (checkpoint.rollback)

Full hot-memory cloning & rewind out of the box

Codex

100% lossless native_fork (0 Context handoff)

100% lossless (checkpoint.rollback)

Full hot-memory cloning & rewind out of the box

Antigravity

Works (portable_context summary handoff + explicit warning)

Supported when adapter exposes rollback

Use the bundled antigravity-patch/ V3 Suite (macOS & Windows) to unlock 100% lossless native_fork + lossless checkpoint.rollback + deadlock self-heal


Requirements

  • Node.js >= 22.0.0 (uses built-in native WebSocket; zero external npm dependencies)

  • A running local T3 Code server (~/.t3/userdata/server-runtime.json) and the t3 CLI available locally (used once to mint a single reusable scoped bearer session)


Installation

Clone the repository anywhere on your machine:

git clone https://github.com/kbykb/t3-shadow-mcp.git ~/.local/share/t3-shadow-mcp
chmod +x ~/.local/share/t3-shadow-mcp/server.mjs

Verify the MCP server over stdio:

node --check ~/.local/share/t3-shadow-mcp/server.mjs

Register as an MCP Server

Antigravity (~/.gemini/config/mcp_config.json)

{
  "mcpServers": {
    "t3-shadow": {
      "command": "node",
      "args": ["/absolute/path/to/t3-shadow-mcp/server.mjs"],
      "tools": {
        "shadow_list_checkpoints": { "eager": true },
        "shadow_fork_batch": { "eager": true },
        "shadow_rollback": { "eager": true },
        "shadow_cleanup": { "eager": true }
      }
    }
  }
}

Claude Code (claude mcp add or .mcp.json)

claude mcp add --transport stdio t3-shadow -- node /absolute/path/to/t3-shadow-mcp/server.mjs

Or in .mcp.json:

{
  "mcpServers": {
    "t3-shadow": {
      "command": "node",
      "args": ["/absolute/path/to/t3-shadow-mcp/server.mjs"]
    }
  }
}

Codex (~/.codex/config.toml)

[mcp_servers.t3-shadow]
command = "node"
args = ["/absolute/path/to/t3-shadow-mcp/server.mjs"]

T3 Code MCP Settings

You can also register t3-shadow directly in T3 Code's MCP server configuration (Settings → MCP Servers, or via T3's t3_mcp_server_update tool) with command node and args ["/absolute/path/to/t3-shadow-mcp/server.mjs"].

Optional: Install the shadow-clone Skill

Copy or symlink skills/shadow-clone into your harness's global skills directory so orchestrator agents know the exact fan-out, rollback, sharding, and cleanup protocol:

# Antigravity global skills
mkdir -p ~/.gemini/config/skills
ln -sfn ~/.local/share/t3-shadow-mcp/skills/shadow-clone ~/.gemini/config/skills/shadow-clone

# Claude Code global skills
mkdir -p ~/.claude/skills
ln -sfn ~/.local/share/t3-shadow-mcp/skills/shadow-clone ~/.claude/skills/shadow-clone

Tools Reference

1. shadow_list_checkpoints

Inspects any top-level thread or delegated subagent (thread:delegated-task:...) and returns its rollback/fork-eligible checkpoints (newest first), excluding repository-only scopes, stale checkpoints, and already rolled_back runs.

Parameter

Type

Required

Default

Description

threadId

string

Yes

—

Top-level or thread:delegated-task:... thread ID

limit

integer

No

15

Max recent checkpoints to return (1..100)

2. shadow_fork_batch

Forks a warm thread or subagent into 1..16 parallel branches sharing its full hot memory, optionally dispatches each branch's first prompt with configurable cold-start staggering, and verifies whether each branch resolved as native_fork or downgraded to portable_context.

Parameter

Type

Required

Default

Description

sourceThreadId

string

Yes

—

Source T3 thread ID (top-level or delegated subagent)

sourcePoint

object

No

{ "type": "latest_stable" }

{ type: "latest_stable" | "run" | "checkpoint", runId?, checkpointId? }

branches

array

Yes

—

1–16 objects: { title: string, prompt?: string, model?: string }

staggerMs

integer

No

1800

Delay in ms between launching branch prompts (0..15000)

Tip: Keep branches[i].model within the same provider instance to preserve native_fork. Forked threads do not auto-wake the parent — collect results with t3_thread_wait + t3_thread_read, then archive with shadow_cleanup.

3. shadow_rollback

Rewinds a top-level thread or delegated subagent back N turns or to an explicit checkpointId.

Parameter

Type

Required

Default

Description

threadId

string

Yes

—

Target T3 thread ID

lastNTurns

integer

One of lastNTurns / checkpointId

—

Number of recent turns to undo (>= 1)

checkpointId

string

One of lastNTurns / checkpointId

—

Explicit checkpoint ID from shadow_list_checkpoints

restoreFiles

boolean

No

false

Keep false for pure conversation/hot-memory rollback on shared workspaces

4. shadow_cleanup

Batch-archives finished shadow-clone threads so they don't clutter your T3 Code sidebar.

Parameter

Type

Required

Default

Description

threadIds

string[]

Yes

—

Array of thread IDs to archive


Typical Multi-Agent Workflows

Pattern A: Warm Subagent Parallel Fan-Out

  1. A research subagent (thread:delegated-task:...) reads 40 files across a monorepo and finishes Turn 1.

  2. The coordinator calls shadow_fork_batch with sourceThreadId = <subagentThreadId> and 3 branches (e.g., Security Review, Performance Audit, Test Plan) — all 3 inherit the warm context immediately via native_fork with zero redundant file reads.

  3. The coordinator collects outputs with t3_thread_wait + t3_thread_read, then calls shadow_cleanup on the 3 clone IDs.

Workspace isolation for editing clones: thread.fork inherits the source thread's checkout directory. Read-only clones can share it safely; code-writing clones should either operate on strictly disjoint files/directories or move into their own git worktree (t3_worktree_handoff) before editing.

Pattern B: Off-Track Subagent SL Rollback

  1. A long-running subagent goes down a dead end on Turn 5 and fills its context with failed build logs.

  2. The coordinator calls shadow_rollback({ threadId: "<subagentThreadId>", lastNTurns: 1, restoreFiles: false }).

  3. The coordinator sends a refined prompt via t3_thread_send — the subagent retains all knowledge from Turns 1–4 while completely forgetting the bad Turn 5.


Configuration (Environment Variables)

Variable

Description

Default

T3_USER_DATA_DIR

Path to T3 Code's userdata directory containing server-runtime.json

~/.t3/userdata (or %LOCALAPPDATA%\t3\userdata on Windows)

T3_SHADOW_STATE_DIR

Directory where the cached single bearer session.json is stored (0600)

$XDG_DATA_HOME/t3-shadow-mcp / ~/.local/share/t3-shadow-mcp (or %LOCALAPPDATA%\t3-shadow-mcp on Windows)

T3_CLI_BIN

Explicit path to the t3 CLI binary

Auto-detected (~/.local/bin/t3, ~/.t3/bin/t3, Homebrew, app bundle, or PATH)


Security & Safety Design

  • Zero auth_sessions leak: Uses an atomic lockfile (session.lock) and caches a single scoped bearer session (orchestration:read, orchestration:operate, 30-day TTL) in session.json with mode 0600 (directory 0700). When refreshed, the old session is automatically revoked. Tokens are never printed to stdout or stderr.

  • Safe shared-workspace rollback: shadow_rollback defaults to restoreFiles: false so rolling back a delegated subagent or shared-directory clone never hits SHARED_WORKSPACE_RESTORE_MESSAGE or clobbers sibling threads' workspace edits.

  • Cold-start stagger: shadow_fork_batch defaults to staggerMs: 1800 between branch launches, mitigating concurrent cold-start races on providers that share an app-data directory.

  • Strict stdio hygiene: stdout is strictly reserved for newline-delimited JSON-RPC 2.0 frames; diagnostics go to stderr only.


License

MIT

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      A
      maintenance
      An MCP server that bridges Claude Code with Antigravity CLI using a Swarm Agent architecture to optimize local development workflows and minimize LLM token costs. Includes a web UI for monitoring agent workflows.
      33
      604 PyPI
      35
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      An MCP server that lets multiple AI coding agents share state, preserve context across sessions, and coordinate via a knowledge graph, messaging, and branch-preserving checkpoint/resume with conflict handling.
      62 npm
      1
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Local MCP server for specialist personas, reusable Markdown workflows, task-scoped subagent contracts and per-repository memory. Runs on your own computer with Python 3.11+ and a locally installed embedding model; its Claude Code plugin launches that separate installation.
      48
      15
      MIT