词元之母TOK.MOM - 平台充值汇率 1:1 即 1 人民币充值到账 1 美元,支持一个 Key 调用近 600+ 海内外模型,限时特价模型低至 1 折,欢迎上岸!
~/.hermes/config.yaml 中添加一个 MCP 服务器:List the files in /home/user/projects and summarize the repo structure.command、args 和 env~/.hermes/config.yaml 的 mcp_servers 下读取 MCP 配置。| 字段 | 类型 | 含义 |
|---|---|---|
command | string | stdio MCP 服务器的可执行文件 |
args | list | stdio 服务器的参数 |
env | mapping | 传递给 stdio 服务器的环境变量 |
url | string | HTTP MCP 端点 |
headers | mapping | 远程服务器的 HTTP 头 |
timeout | number | 工具调用超时时间 |
connect_timeout | number | 初始连接超时时间 |
enabled | bool | 若为 false,Hermes 完全跳过该服务器 |
supports_parallel_tool_calls | bool | 若为 true,该服务器的工具可并发运行 |
tools | mapping | 按服务器过滤工具及实用工具策略 |
hermes mcp add 接受 --preset 标志,自动填写传输层细节,无需手动查找命令和参数。预设只提供默认值——你在同一命令行传入的其他内容(环境变量、头信息、过滤规则)仍然优先生效。| 预设 | 配置内容 |
|---|---|
codex | Codex CLI 的 MCP 服务器(通过 stdio 运行 codex mcp-server)。需要 PATH 中存在 codex CLI。 |
hermes mcp add my-codex --preset codex 完全可以);预设只提供 command/args 默认值。mcp_<server_name>_<tool_name>| 服务器 | MCP 工具 | 注册名称 |
|---|---|---|
filesystem | read_file | mcp_filesystem_read_file |
github | create-issue | mcp_github_create_issue |
my-api | query.data | mcp_my_api_query_data |
list_resourcesread_resourcelist_promptsget_promptmcp_github_list_resourcesmcp_github_get_promptenabled: false,Hermes 完全跳过该服务器,甚至不尝试连接。include 优先生效。tools.resources: false 禁用 list_resources 和 read_resourcetools.prompts: false 禁用 list_prompts 和 get_promptnotifications/tools/list_changed 通知,告知 Hermes 其可用工具发生了变化。Hermes 收到该通知后,会自动重新获取服务器的工具列表并更新注册表——无需手动执行 /reload-mcp。prompts/list_changed、resources/list_changed)会被接收,但暂未处理。/reload-mcpmcp-<server>env 加上安全基线才会被传递。这减少了意外泄露密钥的风险。Show me open issues labeled bug, then draft a new issue for the flaky MCP reconnection behavior.Look up the last 10 failed payments and summarize common failure reasons.Inspect the project root and explain the directory layout.enabled: false 被禁用supports_parallel_tool_calls 为 true 时,Hermes 可能在单次工具调用批次中同时执行该服务器的多个工具,就像对内置只读工具(web_search、read_file 等)的处理方式一样。sampling/createMessage 协议向 Hermes 请求 LLM 推理。这允许 MCP 服务器代表自己请求 Hermes 生成文本——适用于需要 LLM 能力但没有自己模型访问权限的服务器。sampling 键下按服务器配置:~/.claude/claude_desktop_config.json 中:{
"mcpServers": {
"hermes": {
"command": "hermes",
"args": ["mcp", "serve"]
}
}
}{
"mcpServers": {
"hermes": {
"command": "/home/user/.hermes/hermes-agent/venv/bin/hermes",
"args": ["mcp", "serve"]
}
}
}| 工具 | 描述 |
|---|---|
conversations_list | 列出活跃的消息会话。可按平台过滤或按名称搜索。 |
conversation_get | 通过 session key 获取某个会话的详细信息。 |
messages_read | 读取某个会话的近期消息历史。 |
attachments_fetch | 从特定消息中提取非文本附件(图片、媒体)。 |
events_poll | 从指定游标位置轮询新的会话事件。 |
events_wait | 长轮询/阻塞,直到下一个事件到达(接近实时)。 |
messages_send | 通过平台发送消息(例如 telegram:123456、discord:#general)。 |
channels_list | 列出所有平台上可用的消息目标。 |
permissions_list_open | 列出本次 bridge 会话中观察到的待审批请求。 |
permissions_respond | 允许或拒绝待审批请求。 |
# 轮询新事件(非阻塞)
events_poll(after_cursor=0)
# 等待下一个事件(阻塞,直到超时)
events_wait(after_cursor=42, timeout_ms=30000)message、approval_requested、approval_resolvedmessages_read 获取。~/.hermes/sessions/sessions.json 和 SQLite 数据库)读取会话数据。后台线程轮询数据库以获取新消息,并维护一个内存事件队列。发送消息时,使用与 Hermes agent 本身相同的 send_message 基础设施。hermes mcp serve 目前只暴露 stdio-only MCP 服务器。如果你需要 HTTP MCP 服务器,请运行单独的适配器——或者,更常见的做法是使用 Hermes 的 MCP 客户端侧,它已经同时支持 stdio 和 HTTP(mcp_servers.yaml / config.yaml 中的 url + headers;参见上方的 HTTP 服务器)。claude/channel 推送通知协议messages_send 不支持媒体/附件发送)