hermes-mcp-bridge

hermes-mcp-bridge

A zero-friction stdio MCP bridge connecting Cursor Desktop to a local Hermes Agent, enabling natural language task delegation with session continuity and profile awareness.

Category
访问服务器

README

<p align="center"> <img src="https://img.shields.io/badge/Python-3.11%2B-blue" alt="Python"> <img src="https://img.shields.io/badge/transport-stdio-green" alt="stdio"> <img src="https://img.shields.io/badge/deps-mcp%20%7C%20httpx%20%7C%20pydantic-lightgrey" alt="deps"> <img src="https://img.shields.io/badge/license-Apache--2.0-yellow" alt="license"> </p>

hermes-mcp-bridge

A zero-friction stdio MCP bridge connecting Cursor Desktop to a local Hermes Agent — no OAuth, no tunnels, no Dynamic Client Registration.


1. Architecture

 Cursor Desktop                  hermes-mcp-bridge             Hermes Gateway
 ┌──────────────┐   stdio    ┌─────────────────────┐   HTTP   ┌──────────────┐
 │  mcp.json    │ ─────────→ │ FastMCP             │ ───────→ │ 127.0.0.1    │
 │  command:    │            │  ├ hermes_ask()     │  Bearer  │ :8642        │
 │  /home/...   │ ←───────── │  ├ hermes_check()   │ ←─────── │ /v1/chat/    │
 └──────────────┘   stdio    │  ├ hermes_cancel()  │   JSON   │ completions  │
                             │  └ hermes_reset()   │          └──────────────┘
                             └─────────────────────┘
                        X-Hermes-Session-Id → REPL context

1.1 Comparison with mlennie/hermes-mcp

mlennie/hermes-mcp hermes-mcp-bridge
Transport Streamable HTTP stdio
Auth OAuth 2.1 + DCR Bearer header
External deps cloudflared / ngrok none
Process model Standalone daemon Cursor subprocess
Deployment files 5 configs + systemd unit 2 files

2. Profile Awareness

The bridge connects to the same Hermes profile your gateway is serving. It inherits everything that profile has loaded — skills, memory, tools, sessions.

You can pick which profile to use in two ways:

Method What you do When to use
Set a default Edit ~/.config/hermes-mcp-bridge/config.toml You mostly use one profile
Mention it in chat Say "Use Hermes with the default profile to…" in the Cursor chat input You switch profiles often

Neither requires touching mcp.json or restarting Cursor.

2.1 Default profile (config.toml)

# ~/.config/hermes-mcp-bridge/config.toml
model = "general_researcher"   # ← used when no profile arg is passed

2.2 Switching profiles from Cursor

The hermes_ask tool exposes an optional profile parameter. Just mention which profile you want — Cursor's LLM reads the tool signature and passes it.

┌─────────────────────────────────────────────────────────┐
│  You say in Cursor                                      │
├─────────────────────────────────────────────────────────┤
│  "Use Hermes with the default profile to send an email" │
│    → hermes_ask(prompt="send an email",                 │
│                  profile="default")                     │
│                                                         │
│  "Ask Hermes to search arXiv for MCP papers"            │
│    → hermes_ask(prompt="search arXiv...")               │
│                 # no profile → uses config.toml default │
└─────────────────────────────────────────────────────────┘

No mcp.json changes, no config edits, no restart. Just say the profile name.

2.3 Discover available profiles

curl -s http://127.0.0.1:8642/v1/models \
  -H "Authorization: Bearer change...-dev"
# → {"data": [{"id": "general_researcher", ...}, {"id": "default", ...}]}

If your gateway only runs one profile, only one id appears. Start additional gateway instances on different ports to serve multiple profiles simultaneously.


3. Why This Exists

mlennie/hermes-mcp v0.4.0 hits three real-world blockers:

  1. OAuth 2.1 demands an HTTPS tunnel — even when Cursor and Hermes run on the same machine.
  2. No Dynamic Client Registration supportmcp-remote crashes with Incompatible auth server.
  3. Cursor's localhost OAuth callback is broken — its built-in MCP HTTP client returns ERR_EMPTY_RESPONSE on localhost.

This bridge drops the HTTP transport layer entirely, runs as a stdio subprocess, and sidesteps all three.


4. Quick Start

4.1 Install

git clone https://github.com/<your-org>/hermes-mcp-bridge.git
cd hermes-mcp-bridge
uv tool install --editable .

4.2 Configure

mkdir -p ~/.config/hermes-mcp-bridge
cat > ~/.config/hermes-mcp-bridge/config.toml << 'EOF'
api_url = "http://127.0.0.1:8642"
api_key = "change-me-local-dev"    # must match API_SERVER_KEY in ~/.hermes/.env
model   = "general_researcher"
timeout_seconds = 300
EOF
chmod 600 ~/.config/hermes-mcp-bridge/config.toml

4.3 Register with Cursor

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "hermes": {
      "command": "/home/nirvana/.local/bin/hermes-mcp-bridge"
    }
  }
}

4.4 Restart Cursor

Settings → MCP → hermes should show connected.


5. Tools

Tool Signature Purpose
hermes_ask (prompt, session_id?, profile?) → str Delegate a task to Hermes Agent
hermes_check (job_id) → str Poll async job status (stub)
hermes_cancel (job_id) → str Cancel an async job (stub)
hermes_reset () → str Clear the job queue (stub)

The last three are kept for API parity. hermes-mcp-bridge runs synchronously — hermes_ask blocks until the full Agent response is ready.


6. REPL Context (Session Continuity)

Hermes remembers what you told it earlier — just keep talking in the same Cursor chat. Cursor automatically reuses the same session_id across turns.

┌─────────────────────────────────────────────────────────┐
│  You say in Cursor                                      │
├─────────────────────────────────────────────────────────┤
│  "Use Hermes to remember that my lucky number is 42"    │
│    → Hermes remembers 42                                │
│                                                         │
│  "Ask Hermes what my lucky number is"                   │
│    → Hermes answers 42                                  │
│      (same session_id — context preserved)              │
└─────────────────────────────────────────────────────────┘

The bridge passes session_id through as the X-Hermes-Session-Id HTTP header. The gateway uses it to maintain context across calls.

No special syntax. No session IDs to track. Just talk normally — Hermes remembers.


7. Configuration Reference

~/.config/hermes-mcp-bridge/config.toml

Key Default Description
api_url http://127.0.0.1:8642 Hermes Gateway HTTP API address
api_key Must match API_SERVER_KEY in ~/.hermes/.env
model general_researcher Must match a model ID from gateway /v1/models
timeout_seconds 300 Max wait per hermes_ask call

Environment variable overrides (higher priority): HERMES_BRIDGE_API_URL, HERMES_BRIDGE_API_KEY.


8. Security

  • All network traffic is confined to the 127.0.0.1 loopback interface.
  • The API key lives in ~/.config/hermes-mcp-bridge/config.toml (mode 600).
  • The repository itself contains no keys, secrets, or credentials.
  • Cursor spawns the bridge via stdio — no ports are exposed.

9. License

Apache-2.0

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选