概述
hermes mcp 管理 Model Context Protocol (MCP) 服务器连接,也可以将 Hermes 本身作为 MCP 服务器运行。MCP 服务器为 Hermes 提供额外工具;hermes mcp serve 则让其他 MCP 客户端能够连接 Hermes。
hermes mcp <serve|add|remove|rm|list|ls|test|configure|config|login|reauth|picker|catalog|install>
子命令
serve — 将 Hermes 作为 MCP 服务器运行
hermes mcp serve
hermes mcp serve -v
将 Hermes 对话以 MCP 协议暴露出来,供其他 Agent 或 IDE 连接。-v 开启详细日志。
add — 添加 MCP 服务器
hermes mcp add filesystem --command npx --args @anthropic/mcp-server-filesystem /allowed/path
hermes mcp add api-server --url http://localhost:3000/sse
hermes mcp add pg --command npx --args @modelcontextprotocol/server-postgres postgresql://localhost/db --env PGUSER=hermes
选项:--url、--command、--args、--auth、--preset、--connect-timeout、--env。
remove / rm — 移除 MCP 服务器
hermes mcp remove filesystem
hermes mcp rm filesystem
list / ls — 列出已配置服务器
hermes mcp list
hermes mcp ls
test — 测试服务器连接
hermes mcp test filesystem
configure / config — 切换工具选择
hermes mcp configure filesystem
login — 强制 OAuth 服务器重新认证
hermes mcp login google
reauth — 重新认证一个或所有 OAuth 服务器
hermes mcp reauth google
hermes mcp reauth --all
picker — 交互式目录选择器
hermes mcp picker
直接运行 hermes mcp 不带子命令时,默认也会打开该选择器。
catalog — 列出 Nous 认证的 MCP 目录
hermes mcp catalog
install — 按名称安装目录中的 MCP
hermes mcp install n8n
hermes mcp install official/n8n
常见场景
添加文件系统服务器
hermes mcp add fs --command npx --args @anthropic/mcp-server-filesystem ~/projects
hermes mcp test fs
在 IDE 中运行 Hermes
hermes mcp serve
# 然后在 IDE 的 MCP 客户端中指向正在运行的 Hermes 服务器。
管理 OAuth 凭据
hermes mcp login github
hermes mcp reauth --all
浏览并安装目录项
hermes mcp catalog
hermes mcp install n8n
技巧
add和remove(或rm)会修改当前 profile 的 MCP 配置。--args必须放在最后,因为它会吞入后面所有内容。serve将 Hermes 作为 MCP 服务器对外暴露;add是消费外部 MCP 服务器。- 在聊天中依赖新服务器前,先用
hermes mcp test <name>测试。 - OAuth 服务器可用
reauth刷新;login强制单个服务器重新走认证流程。