codex-hermes-a2a-bridge
One-line summary: The server exposes an MCP bridge to a Hermes A2A agent for starting, tracking, and managing durable chat tasks over conversations.
Check bridge persistence, Hermes health, connectivity, and Agent Card summary (
hermes_status).Start or continue a Hermes conversation in auto/sync/async mode, returning a durable task and A2A context mapping (
hermes_chat), with optional context_id, idempotency key, and conversation key.Retrieve a task/result, optionally refreshing non-terminal tasks and acknowledging a consumed result with origin verification (
hermes_task_get).List durable bridge tasks filtered by conversation and status (
hermes_tasks_list).Wait for task progress or results via stream, A2A subscribe, then polling fallback (
hermes_task_wait).Request best-effort task cancellation, with explicit notice that Hermes may keep computing (
hermes_task_cancel).List, inspect, or close bridge-owned conversation/context mappings without deleting Hermes data (
hermes_contexts).
Integrates with Hermes Agent through its A2A gateway, allowing agents to check Hermes status, send chat messages, retrieve and wait on tasks, cancel tasks, and manage conversation context mappings.
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., "@codex-hermes-a2a-bridge Ask Hermes to draft a weekly status update for the team."
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.
Codex Hermes A2A Bridge
A local bridge so Codex can be the “front desk”: Codex calls MCP tools over stdio, the bridge turns requests into A2A v1.0/JSON-RPC to the Hermes profile default, then keeps conversation/task mapping in SQLite. Hermes remains the “brain” that runs the agent loop, memory, skills, tools, and internal orchestration.
Current version: v0.1.1. Only loopback endpoints are bound/called; there are no tools for model switching, plugins, configuration, updates, a shell, or controlling the Hermes service.
Independent project: this is independent community software, not an official product, not sponsored, and not representative of Nous Research/Hermes Agent or OpenAI/Codex. Brand names are used only to describe interoperability.
Architecture
Codex client --MCP stdio--> MCP server --> bridge core --> Hermes A2A :9900
\--> SQLite context/task mappingPython 3.11 and a dedicated venv, not Hermes' venv.
Official Python MCP SDK,
httpxasync, Pydantic, and SQLite stdlib.Each
conversation_keyopens a map entry to a HermescontextId; subsequent turns reuse that mapping.Original prompts are not persisted; the bridge stores fingerprint, route, state, result, and minimal errors.
Related MCP server: Hermes Bridge
Requirements and quick setup
Python 3.11.
Hermes Agent 0.20.5 with the A2A gateway running on loopback.
A Codex client with MCP stdio support.
cd /absolute/path/to/codex-hermes-a2a-bridge
python3.11 -m venv .venv
.venv/bin/python -m pip install -e .
.venv/bin/codex-hermes-a2a-bridge doctorContributors can install additional testing tools with python -m pip install -e '.[dev]'. See .env.example for overrides; do not commit a real .env file.
Safe default configuration:
Environment variable | Default | Meaning |
|
| A2A root resource; only loopback URLs are accepted. |
| Empty | Bearer token read from the environment, never through tool arguments. |
|
| SQLite file mode |
|
| Default timeout, clamped to 300 seconds maximum. |
|
| How long |
|
| Inline wait limit for |
|
| Lifetime of the SSE worker to keep the A2A task ID/result after the initial timeout. |
|
| Read-only fallback when the in‑memory TaskStore is gone. |
|
| Turn budget/context to avoid agent loops. |
|
| Number of concurrent outbound calls. |
Enabling Hermes A2A and registering Codex
On initially installed Hermes 0.20.5:
hermes plugins enable a2a-platform --no-allow-tool-override
hermes config set gateway.platforms.a2a.enabled true
hermes gateway run --no-superviseWhen the foreground process, a user service can be installed (no sudo):
hermes gateway install --start-now --start-on-loginRegister the bridge in Codex shared MCP config:
codex mcp add codex-hermes-a2a-bridge -- \
/absolute/path/to/codex-hermes-a2a-bridge/.venv/bin/codex-hermes-a2a-bridge serve
codex mcp get codex-hermes-a2a-bridgeA new Codex client must be opened/restarted to pick up the fresh entry. MCP stdio writes only protocol frames to stdout; diagnostics go to stderr.
Seven MCP tools in v0.1
Tool | Purpose |
| Health, Agent Card summary, DB counts, and connection. |
| Create/continue brings conversation; |
| Reconcile state, result, error, or |
| List durable bridge tasks by conversation / state. |
| Wwait on an active stream, subsub SSE into SSE, then poll fallback. |
| Sent best-effort cancel; does not claim computation stopped. |
| List/inspect/close mappings; close does not delete Hermes data. |
The set of four MCP operations originally described in the study (discover, send, get, continue) is not full A2A. v0.1 folds these into seven high-level tools for conversation/task work; lower-level A2A operations such as push-notification CRUD and Hermes administration are not expё.
Example workflow
Codex calls
OM hermes_status.Codex calls
hermes_chat(message=..., conversation_key=<stable>, mode="auto").If the task is still running, use
hermes_task_waitorhermes_task_get; do not blindly resend after an ambiguous timeout.If
neds_input=true, ask the user, then callhermes_chatwith yourconversation_key/context_id.The next conversation line continues with the same mapp;
hermes_contexts(action="close")only closes the bridge mapping.
For tasks with side effects, provide an idempotency_key. Hermes 0.20.5 does not have wire-level idempotency, so the bridge will not retry mutation sends when the result transport is unclear.
From v0.1.1, all three modes use SendStreamingMessage to get the A2A task ID from the very first event. sync still waits inline up to 30 seconds (or timeout whenever set lower); the stream remains alive until correlation timeout. For older records in outcome_unknown that lack an A2A ID, hermes_task_get / hermes_task_wait first try ListTasks(contextId) and then read Hermes' official conversation persistence. Recovery attaches a result only when there is exactly one local unresolved task and exactly one remote/disk candidate; ambiguous cases remain unchanged, with no resdend and no guessing. The disk fallback has no A2A state, so it issues a warning and treats an already persisted agent reply as completed.
Testing and operations
.venv/bin/pytest --cov=codex_hermes_a2a_bridge --cov-report=term-missing
.venv/bin/codex-hermes-a2a-bridge doctor
.venv/bin/codex-hermes-a2a-bridge smoke \
'Reply with exactly MY_MARKER and nothing else.' \
--conversation-key manual-smoke
.venv/bin/python scripts/live_check.py manual-smokeClock pytest uses a fake A2A server on an ephemeral loopback port and does not require a real Hermes. doctor and live_check.py are read-only. A smoke command sends a real task; run it only actively with g harmless content.
Security and privacy
v0.1.1 rejects endpoints and Agent Card URLs that are not loopback, does not follow redirects, and does not accept tokens through MCP tool arguments.
SQLite is stored by default outside the source tree with mode
0600; it holds mapping, fingerprint, state, result/artifact and minimal errors. Results can contain sensitive data, so apply an appropriate retention/change &backup policy.Original prompts are not persisted by bridge; Hermes may still write its own conversation / audit log. Fallback recovery only reads from the configured Hermes conversation store.
The MCP server must be run by a trusted user; the seven tools can trigger Hermes, and Hermes may use skills / tools with side effects. Use an
idempotency_keyand do not resnd blindly when inoutcome_unknown.Report vulnerabilities via [SECURITY.MD]. Do not post tokens, transcripts, or SQLite in issues.
Guarantees and upstream guarantees
The bridge guarantees a loopback policy, a durable local mapping, no retried sent send after ambiguity, and honest cancel semantics. The bridge does not guarantee that HProc Hermes will stop computation, that token‑level streaming is implemented, that wire‑level idempotency exists, or that tasks survive a Hermes restart.
Hermes 0.20.5 uses an in‑memory TaskStore, lifecycle SSE and protocol cancel does not abort the current turn. The bridge's conversation‑store recovery is a read‑only fallback, not a substitute for the upstream's durable task store. Verified details are in the Hermes A2A reference.
Troubleshooting
a2a_unreachable: runhermes gateway status, check the card athttp://127.0.1:9900/.well-known/agent-card.json.A2A plugin enabled but no port: check
hermes config get gateway.platforms.a2a.enabled, then restart the gateway.Codex doesn't Pages or lists not present: run
codex mcp get codex-herMes-a2a-bridge, then use a new Codex process/client.outcome_unknown: callhermes_task_get/`hermes; if still ambiguous, do not resend a task with side effects; ask user.turn_budget_exeeded: close the map and create a new conversation; do not reset budget/changes just to let the agent loop on forever.Hermes 0.20.5 loses the A2A TaskStore on restart; bridge keeps local task/result but remote refresh may say the task no longer exists.
On macOS currently theif
launchctl bootstrapreturns exit 5, Hermes uses detached fallback: it works but does not auto-start/auto-restart. Usehermes gateway statusto confirm.
Rollback
See scripts/rollback.sh. The script defaults to only printing the plan. scripts/rollback.sh --apply strips the exact MCP entry and the A2A configuration/plugin, but keeps the gateway service because the service may serve another platform. Only add --include-gateway-service if a gateway is installed solely for this rollout. Source, .venv, SQLite, and Hermes transcripts remain in place.
Scoped backups are created next to the config file and suffixed with .pre-codex-hermes-a2a-bridge-v0.1.bak; no full automatic restore is done, because it could overwrite fresh user changes.
Documentation
Canonical sources: OpenAI Codex MCP, Hermes A2A guide,, NousResearch/hermes-agent. Where they differ, the local Hermes 0.20.5 commit d5a... is authoritative.
Available Tools
7 toolshermes_chatBDestructive
Start or continue a Hermes conversation; returns a durable bridge task and A2A context mapping.
Inputs: message (required), mode, origin, profile, +5 more. Returns: object
hermes_contextsAIdempotent
List, inspect, or close bridge-owned conversation/context mappings; close never deletes Hermes data.
Inputs: limit, action, context_id, conversation_key. Returns: object
hermes_statusARead-onlyIdempotent
Check bridge persistence, Hermes health, connectivity, and a concise Agent Card summary.
Inputs: no named parameters. Returns: object
hermes_task_cancelA
Request task cancellation; response is explicit that Hermes may continue underlying computation.
Inputs: task_id (required), timeout. Returns: object
hermes_task_getB
Get a task/result; optionally acknowledge a consumed result_id with expected_origin verification.
Inputs: task_id (required), refresh, expected_origin, acknowledge_result_id. Returns: object
hermes_tasks_listARead-onlyIdempotent
List durable bridge tasks, optionally filtered by conversation and bridge state.
Inputs: limit, status, conversation_key. Returns: object
hermes_task_waitARead-onlyIdempotent
Wait for task progress/result using the active stream, A2A subscribe, then polling fallback.
Inputs: task_id (required), timeout. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools have clearly distinct purposes: chat/context management, task retrieval, cancellation, listing, waiting, and bridge status. The main possible confusion is between hermes_task_get and hermes_task_wait, since both can surface task results, but their descriptions distinguish immediate retrieval from waiting behavior.
All tools use the hermes_ prefix and snake_case, which makes the set predictable overall. Minor deviations exist because some names are noun-only (hermes_chat, hermes_contexts, hermes_status) and task/tasks singular-plural usage varies.
Seven tools is well-scoped for a bridge server focused on Hermes conversation/context and A2A task lifecycle. Each tool has a distinct operational role, and the set avoids unnecessary surface area.
The surface covers conversation start/continue, context list/inspect/close, task list/get/wait/cancel, and bridge health/status. Result acknowledgment and origin verification are included in hermes_task_get, so the core A2A bridge lifecycle appears complete.
Maintenance
Related MCP Connectors
Human-input bridge for AI agents with voice-first answer links, MCP tools, and HTTP APIs.
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
Cross-tool persistent memory and context for AI assistants over MCP.
Discover and call AI agents via MCP. Supports A2A agents and platform agents with async tasks.
Related MCP Servers
- AlicenseCqualityDmaintenanceBridges MCP clients with local Codex CLI to execute autonomous coding tasks, manage threads, and inspect history via SQLite state.134Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables MCP agents to delegate tasks to a local Hermes Agent for terminal, file, browser, and coding operations, and schedule recurring jobs.MIT
- AlicenseNot gradedqualityDmaintenanceProvides an isolated MCP bridge giving Codex Hermes-style long-term memory, checkpoints, and optional tools, while keeping Hermes and Codex data read-only and requiring human approval for skill proposals.MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients and external AI supervisors to oversee and steer native Codex sessions through a thin local stdio bridge. It exposes eleven codex_* supervisory tools for tasks such as listing threads, starting turns, observing progress, steering, responding to approvals, interrupting, checkpointing, and rolling over work.MIT