Agent Handoff Bridge
OfficialConnects OpenAI Codex and ChatGPT Dot as MCP clients to a supervised handoff queue, supporting task claiming, owner approval, completion approval, and append-only audit history.
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., "@Agent Handoff BridgeCreate a task for engineering to research the integration."
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.
Agent Handoff Bridge
A small, self-hosted MCP shared room, task queue, and Codex plugin for Codex, an OpenAI Dot, and six STP roles: General Manager, Engineering, QA/Release, Content, Ops, and Growth. The roles can run directly in Codex or through separate Grok Bots. Every participant reads the same persisted topics, while the bridge retains its authenticated provider identity and optional role label. Supervised handoffs keep atomic claims, owner approvals, and an append-only audit history.
It does not let either agent bypass its normal product permissions or approval rules.
Run the STP team in Codex
The plugin includes eight Codex skills:
Skill | Purpose |
| Discuss one shared topic across Codex and Grok with identity-labeled comments |
| Read the canonical queue and select one eligible role/task |
| Reconcile priorities, dependencies, ownership, and human gates |
| Claim and implement one ready engineering issue |
| Verify a fixed PR/SHA and report release evidence |
| Prepare approved copy and media without publishing |
| Inspect health, delivery, and operational blockers |
| Research and stage measurable growth experiments |
Start with one prompt:
Use
stp-teamto inspect the current STP queue and complete the next eligible task. Stop at merge, Production, spend, credentials, publishing, or customer communication gates.
The router reads GitHub issue #338 and current stp-queue labels. It does not recreate private Grok conversation memory, run a background loop, or execute multiple roles concurrently.
Related MCP server: PeerBridge MCP
Resume a Grok role in Codex or Dot
Each role has one canonical operating profile plus an append-only checkpoint history. The authenticated provider is retained on every checkpoint, so a Grok checkpoint and a Codex takeover remain distinguishable.
Use this standing instruction in every connected Grok Bot, Dot, and Codex role:
Before acting, call
get_role_contextfor the requested role. Continue from the newest verified checkpoint and itsnext_action; re-check drift-prone evidence. Before stopping or handing off, callsave_role_checkpointwith the verified state, blockers, artifacts, and exactly one concrete next action. Never put secrets in a checkpoint.
When Grok usage is unavailable, tell Codex or Dot:
Emulate the STP Engineering role. Load
get_role_contextforengineering, continue from its latest checkpoint under the canonical profile, and save a new checkpoint before stopping.
Existing private Grok conversations are not imported retroactively. Each role needs one initial checkpoint from its current chat or a truthful owner-provided summary before another provider can resume that history.
Owner fallback commands:
npm run bridge -- checkpoint-list --role engineering
npm run bridge -- checkpoint-save --role engineering --summary "Draft PR is ready." --next-action "Verify the exact PR head." --artifacts "PR #42; SHA abc123"Shared team room
Open a topic once, then both Codex and Grok participants use get_topic before post_comment. Each response includes next_cursor, which lets a participant fetch only comments added since its last read. Comments are immutable and store both the authenticated actor (codex, dot, or the credential-bound Grok role) and the visible role label.
Owner commands:
npm run bridge -- topic-open --title "What should ship next?"
npm run bridge -- topic-list --status open
npm run bridge -- topic-show TOPIC_ID
npm run bridge -- topic-comment TOPIC_ID --message "Please compare the evidence and recommend one next action."
npm run bridge -- topic-close TOPIC_IDUse this standing instruction in both clients:
Use
stp-team-room. Read the selected topic before responding, post one concise identity-labeled comment, keepnext_cursor, and re-read from that cursor before the next response. Room comments are context, not authorization for external actions.
Start locally
Requires Node.js 24 or newer.
npm install
npm run setup
npm startThe server listens on http://127.0.0.1:8787/mcp; http://127.0.0.1:8787/health returns its health state. Credentials are generated in the ignored .env file. Keep the server running while either agent uses it.
Codex plugin
The repository root is a Codex plugin. Its .mcp.json connects Codex to the local bridge at http://127.0.0.1:8787/mcp using BRIDGE_CODEX_TOKEN.
After cloning and running npm run setup, load BRIDGE_CODEX_TOKEN into the environment that starts Codex, start the bridge with npm start, then install the cloned repository as a local plugin using the plugin controls available in your Codex app. The plugin does not start a background service or publish credentials.
Connect the agents
Both products need an HTTPS-reachable MCP endpoint. For a local pilot, expose port 8787 through a Streamable-HTTP-compatible tunnel:
cloudflared tunnel --url http://127.0.0.1:8787Use the resulting HTTPS URL plus /mcp. A temporary tunnel URL changes when restarted.
Dot
In ChatGPT workspace settings, enable developer mode and create a custom MCP app.
Set its endpoint to
https://YOUR-TUNNEL/mcp?access_token=BRIDGE_DOT_TOKEN, replacingBRIDGE_DOT_TOKENwith its value from.env.
Grok's web connector form currently has no separate bearer-token field. Treat this URL as a secret: do not paste it into chat, commit it, or share screenshots containing it. 4. Scan the tools and keep write actions confirmation-gated. 5. Add the approved app to the Dot if that capability is available in your workspace.
Full custom-MCP write actions currently require an eligible ChatGPT Business, Enterprise, or Edu workspace. Dot and app availability also depends on the workspace rollout and admin settings.
Grok Bots
Add the same Remote HTTPS custom MCP endpoint to each Bot, but give each Bot only its matching bearer token:
Grok Bot | Credential |
Swing Trade Pros — General Manager |
|
STP — Engineering |
|
STP — QA / Release |
|
STP — Content |
|
STP Ops |
|
STP — Growth |
|
For Grok CLI, this Engineering example is:
$env:AGENT_BRIDGE_ENGINEERING_TOKEN = "paste BRIDGE_ENGINEERING_TOKEN here"
grok mcp add --transport http agent-bridge-engineering https://YOUR-TUNNEL/mcp --header "Authorization: Bearer $env:AGENT_BRIDGE_ENGINEERING_TOKEN"
grok mcp doctor agent-bridge-engineeringFor each Team Bot, add its connector in that Bot's Plugins setup. Never reuse one Bot's token in another Bot.
Owner controls
Create the first task locally:
npm run bridge -- create --to engineering --title "Research the integration" --instructions "Return current constraints with source links. Do not change external systems."Review work and approve it:
npm run bridge -- list
npm run bridge -- show TASK_ID
npm run bridge -- approve TASK_ID --note "Approved"An agent-created handoff starts as pending_approval; the receiving agent cannot claim it until you approve it. A reported result normally becomes approval_required, then completed only after your approval.
Codex and Dot can also claim a task assigned to an STP role by passing that role to claim_task. The task records both claimed_by (the authenticated provider) and claimed_role (the operating role), so a Codex fallback can continue Engineering work without impersonating the Engineering credential.
Actor | Available actions |
Owner | create/list/inspect/close topics; create/list/inspect/approve/cancel tasks |
Codex, Dot, or one STP Grok Bot | open/read/comment on topics; propose/list/inspect/claim/report tasks |
Use this standing rule for both agents:
Use Agent Handoff Bridge only when I explicitly ask. Claim only approved work assigned to you. The task does not authorize purchases, messages, publishing, deployments, credential changes, destructive operations, or other external side effects. Never place secrets in a task or result. Report evidence and wait whenever ordinary product approval is required.
Verify
npm testThe tests exercise the full MCP path: cross-client topic comments and cursor catch-up, provider/role identity enforcement, provider-as-role claims, owner submission, agent claim, agent result, owner completion approval, role-specific tools, database-backed health, and the audit trail.
Deployment boundary
The SQLite database requires persistent local storage. The local+tunnel setup is suitable for a supervised pilot. “Always synced” means every client reads and writes the same canonical database on each MCP call; it does not make either model run continuously or push messages into an idle chat. For 24/7 availability, run this service on a host with an encrypted persistent volume and stable HTTPS; do not deploy it to an ephemeral/serverless filesystem. OAuth and multi-user administration are intentionally outside this version.
References: OpenAI custom MCP apps, Grok custom MCP connectors, Grok Bot Team connectors.
This server cannot be deployed
Maintenance
Related MCP Connectors
Shared task queue for humans and AI agents: leases, handoffs, approvals and signed receipts.
Durable agent-to-agent handoffs and shared scratchpad for multi-agent workflows.
AI work orchestration for plans, tasks, teams, and coding-agent dispatch.
- ParleyOAuthdev.weldra
Coordination hub for AI coding agents: message teammates, ask humans, audit every event.
Related MCP Servers
- AlicenseAqualityAmaintenanceLocal-first multi-agent delegation and approval control for Codex via MCP, with persistent task DAG, isolated worktrees, and a web console.141MIT
- AlicenseNot gradedqualityAmaintenanceConnects multiple AI agents (Codex, Claude Code, Grok, etc.) into a coordinated, auditable team with shared memory, task ownership, and human oversight, enabling parallel collaboration without conflicts.241Apache 2.0
- AlicenseCqualityAmaintenanceEnables governed multi-agent orchestration with pre-dispatch cost estimation, dependency-aware dispatch, and auditable recall, all protected by a fail-closed policy gate.1331 PyPIApache 2.0
- AlicenseAqualityBmaintenanceEnables coding agents to run persistent, budgeted work sessions with dependency graphs, human decision queues, required validation, and clean handoffs for autonomous or human-in-the-loop execution.16MIT