Skip to main content
Glama
phamviet86

codex-hermes-a2a-bridge

by phamviet86

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 mapping
  • Python 3.11 and a dedicated venv, not Hermes' venv.

  • Official Python MCP SDK, httpx async, Pydantic, and SQLite stdlib.

  • Each conversation_key opens a map entry to a Hermes contextId; subsequent turns reuse that mapping.

  • Original prompts are not persisted; the bridge stores fingerprint, route, state, result, and minimal errors.

Related MCP server: ccg-mcp

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 doctor

Contributors 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

HERMES_A2A_ENDPOINT

http://127.0.0.1:9900

A2A root resource; only loopback URLs are accepted.

HERMES_A2A_TOKEN

Empty

Bearer token read from the environment, never through tool arguments.

HERMES_BRIDGE_STATE_PATH

~/.local/state/codex-hermes-a2a-bridge/state.sqlite3

SQLite file mode 0600.

HERMES_BRIDGE_DEFAULT_TIMEOUT

60

Default timeout, clamped to 300 seconds maximum.

HERMES_BRIDGE_AUTO_WAIT

15

How long auto waits before returning the task handle.

HERMES_BRIDGE_SYNC_WAIT

30

Inline wait limit for sync; after that it returns a handle and correlation continues.

HERMES_BRIDGE_CORRELATION_TIMEOUT

300

Lifetime of the SSE worker to keep the A2A task ID/result after the initial timeout.

HERMES_A2A_CONVERSATION_DIR

~/.hermes/a2a_conversations

Read-only fallback when the in‑memory TaskStore is gone.

HERMES_BRIDGE_MAX_TURNS

5

Turn budget/context to avoid agent loops.

HERMES_BRIDGE_MAX_CONCURRENCY

4

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-supervise

When the foreground process, a user service can be installed (no sudo):

hermes gateway install --start-now --start-on-login

Register 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-bridge

A 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

hermes_status

Health, Agent Card summary, DB counts, and connection.

herms_chat

Create/continue brings conversation; auto, sync or async; profile default.

herms_task_get

Reconcile state, result, error, or input_required.

herms_task_list

List durable bridge tasks by conversation / state.

herms_task_wait

Wwait on an active stream, subsub SSE into SSE, then poll fallback.

herms_task_cancel

Sent best-effort cancel; does not claim computation stopped.

herms_contexts

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

  1. Codex calls OM hermes_status.

  2. Codex calls hermes_chat(message=..., conversation_key=<stable>, mode="auto").

  3. If the task is still running, use hermes_task_wait or hermes_task_get; do not blindly resend after an ambiguous timeout.

  4. If neds_input=true, ask the user, then call hermes_chat with your conversation_key / context_id.

  5. 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-smoke

Clock 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_key and do not resnd blindly when in outcome_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: run hermes gateway status, check the card at http://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: call hermes_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 bootstrap returns exit 5, Hermes uses detached fallback: it works but does not auto-start/auto-restart. Use hermes gateway status to 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.

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage

  • Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.

  • Private-by-default, local-first memory/context/task orchestrator for MCP apps and agents.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/phamviet86/codex-hermes-a2a-bridge'

If you have feedback or need assistance with the MCP directory API, please join our Discord server