The AgentBridge MCP server speaks stdio. Most modern MCP clients
can launch a local stdio process directly, so the same server entry
(npx -y @marmarlabs/agentbridge-mcp-server) plugs into every client
listed below — only the surrounding config syntax changes.
npx @marmarlabs/agentbridge-cli mcp-configprints copy-pasteable snippets for each supported client. Pick the one that fits your setup and paste it into the right config file.
Two paths — a one-line CLI command, or a config.toml block. Both
target the same stdio launcher.
codex mcp add agentbridge -- npx -y @marmarlabs/agentbridge-mcp-serverVerify with /mcp inside Codex. Detailed walkthrough, troubleshooting,
and a project-scoped variant live in
docs/codex-setup.md.
[mcp_servers.agentbridge]
command = "npx"
args = ["-y", "@marmarlabs/agentbridge-mcp-server"]
startup_timeout_sec = 20
tool_timeout_sec = 60
enabled = trueDrop into ~/.codex/config.toml (global) or
.codex/config.toml at a repo root (project-scoped). Ready-made files:
examples/codex-config/.
macOS: edit ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: edit %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"agentbridge": {
"command": "npx",
"args": ["-y", "@marmarlabs/agentbridge-mcp-server"],
"env": {
"AGENTBRIDGE_ALLOW_REMOTE": "false"
}
}
}
}{
"mcpServers": {
"agentbridge": {
"command": "node",
"args": [
"/absolute/path/to/agentbridge-protocol/apps/mcp-server/dist/index.js"
],
"env": {
"AGENTBRIDGE_ALLOW_REMOTE": "false"
}
}
}
}Run npm run build first to produce apps/mcp-server/dist/index.js.
Restart Claude Desktop. You should see agentbridge in the tools panel
with these surfaces:
| Surface | Items |
|---|---|
| Tools | discover_manifest, scan_agent_readiness, list_actions, call_action, get_audit_log |
| Resources | agentbridge://manifest, agentbridge://readiness, agentbridge://audit-log, agentbridge://spec/manifest-v0.1 |
| Prompts | scan_app_for_agent_readiness, generate_manifest_from_api, explain_action_confirmation, review_manifest_for_security |
Cursor supports MCP servers natively. Settings → MCP → Add server, then
use the same command and args shape as other clients:
- command:
npx - args:
["-y", "@marmarlabs/agentbridge-mcp-server"]
Or paste the JSON form directly:
{
"mcpServers": {
"agentbridge": {
"command": "npx",
"args": ["-y", "@marmarlabs/agentbridge-mcp-server"]
}
}
}Anything that can launch a stdio MCP server runs AgentBridge as-is. The raw command:
npx -y @marmarlabs/agentbridge-mcp-serverIf your client expects a JSON server descriptor, the same shape used by
Claude Desktop and Cursor (command: "npx", args: ["-y", "@marmarlabs/agentbridge-mcp-server"]) works in most clients.
If your client only supports HTTP MCP — typically hosted/centralized
MCP clients that cannot launch a local subprocess — the bundled
server now exposes an opt-in Streamable HTTP transport at
POST /mcp. The default remains stdio; HTTP is enabled per-process
via AGENTBRIDGE_TRANSPORT=http.
Minimal local-dev launch:
export AGENTBRIDGE_TRANSPORT=http
export AGENTBRIDGE_HTTP_AUTH_TOKEN=$(openssl rand -hex 32)
# Optional: only needed if a browser-based MCP client will connect.
export AGENTBRIDGE_HTTP_ALLOWED_ORIGINS=http://localhost:5173
npx -y @marmarlabs/agentbridge-mcp-server
# → listens on http://127.0.0.1:3333/mcpClients authenticate with Authorization: Bearer <token>. Tokens
in URL query strings are rejected with HTTP 400. The full env-var
table and threat coverage are in
docs/security-configuration.md and
docs/designs/http-mcp-transport-auth.md.
The HTTP transport is experimental in v0.4.0. stdio remains the default and the recommended path for local desktop clients (Codex, Claude Desktop, Cursor). Production hosting of the HTTP transport is on the v1.0 path; today it is appropriate for local development, controlled-internal staging, and integration with hosted MCP clients in non-production environments. See docs/production-readiness.md.
The AgentBridge MCP server enforces the same safety story regardless of which client is talking to it:
- Low-risk actions may execute directly when the agent calls
call_actionwith valid input. - Medium- and high-risk actions return
{ status: "confirmationRequired", confirmationToken, summary, ... }on the first call. The agent must re-call withconfirmationApproved: trueand the sameconfirmationToken(single-use, input-bound, default 5-minute TTL) to actually run. - Origin pinning. Action endpoints must share origin with the
manifest's
baseUrl. A poisoned manifest cannot redirect calls. - Loopback-only by default. Only
localhost/127.0.0.1/::1URLs are allowed by default. To permit other hosts you have two opt-ins:- Production-recommended: set
AGENTBRIDGE_ALLOWED_TARGET_ORIGINS=https://app.example.com,https://admin.example.com— strict, exact-origin allowlist. Prefix attacks (https://example.com.evil.test) are rejected. - Broad escape hatch:
AGENTBRIDGE_ALLOW_REMOTE=truepermits any remote http(s) origin and emits a one-time stderr warning. - The strict allowlist always wins when both are set. Full reference: docs/security-configuration.md.
- Production-recommended: set
- Audit redaction.
authorization,cookie,password,token,secret, andapi_keykeys are stripped recursively before any audit event is persisted. - Demo destructive actions are simulated. The demo app's
execute_refund_order, etc., return{ simulated: true, ... }— no real payment processor is touched anywhere in this codebase.
Boot the demo (npm run dev), then ask your agent something like:
What can the app at http://localhost:3000 do? Just discover the manifest, don't call anything yet.
The agent should call discover_manifest, then list_actions, and
report back: 5 actions, 3 risky, all required confirmations declared.
Then ask:
Refund order ORD-1001 for $24 because the item arrived damaged.
You should see the agent:
- Call
call_actionfordraft_refund_order(returnsconfirmationRequired+ token). - Show you the human-readable summary:
Draft a refund of $24 on order ORD-1001 (reason: damaged on arrival). - Wait for your approval before re-calling with
confirmationApproved: true+ the token. - Same flow for
execute_refund_order(high risk).
The server starts but no tools appear
- Run
npx -y @marmarlabs/agentbridge-mcp-server < /dev/nulland confirm it exits cleanly. If it errors, fix that before reattaching to your client. - For the local-checkout path, confirm the path is absolute and points
at
apps/mcp-server/dist/index.js(the compiled bin, not the TS source). Runnode /your/path/apps/mcp-server/dist/index.js < /dev/nulldirectly.
Only loopback URLs allowed errors
- Default behaviour. To talk to a remote AgentBridge surface, the
recommended option is to set
AGENTBRIDGE_ALLOWED_TARGET_ORIGINS=https://your-app.example.comin theenvblock of your MCP config (or your shell when launching the client). For ad-hoc testing you can use the broaderAGENTBRIDGE_ALLOW_REMOTE=true, which also permits remote URLs and emits a stderr warning.
Target origin … is not in AGENTBRIDGE_ALLOWED_TARGET_ORIGINS
- The strict allowlist rejected the origin. Add the exact origin
(scheme + host + port) to the comma-separated value, or fall
back to the broader
AGENTBRIDGE_ALLOW_REMOTE=truefor testing. See docs/security-configuration.md.
Confirmation tokens "expired" too quickly
- Default TTL is 5 minutes. Tokens are stored at
data/confirmations.jsonso they survive a server restart, but not arbitrarily long. Re-callcall_actionwithoutconfirmationApprovedto receive a fresh token.
Idempotency conflicts
- The same
idempotencyKeywas used with different inputs. Use a new key for the new request.
Codex-specific issues
- See docs/codex-setup.md for
Codex-specific timeouts, registration, and
/mcpverification.