Hermes Agent + MCP (Model Context Protocol) 研究报告

v1.0 发布日期: 2026年4月12日 | 最后更新: 2026-03-12 | Hermes Agent v0.2.0

MCP 协议详解:为何 AI 智能体需要标准接口?

Hermes Agent:58K+ Stars 的 AI 智能体框架

📊 目录

  1. 项目概述
  2. MCP 协议详解
  3. Hermes Agent 核心功能
  4. MCP 集成特性
  5. 配置指南
  6. 实际应用场景
  7. 部署与发布
  8. 社区与生态
  9. 未来展望
  10. 附录

1. 项目概述

Hermes Agent 是 Nous Research 构建的 AI 能力框架,支持通过 MCP 与外部工具生态连接。

1.1 生态数据速览

指标 数据
GitHub Stars 58K+
核心贡献者 63+ 人
MCP 服务器注册量 10,000+
月下载量 9700 万次
内置技能 70+ 个
测试规模 3,289+ 单元测试
支持消息平台 8+ (Telegram、Discord、Slack 等)

1.2 核心价值

2. MCP 协议详解

2.1 协议起源

2.2 协议架构


         LLM 应用 (Hermes Agent)
               │
        ┌──────┴──────┐
        │             │
   STDIO        HTTP  (Streamable HTTP)
        │             │
        ▼             ▼
   ┌──────────────────────────┐
   │      MCP Server           │
   │ GitHub | Filesystem | DB  │
   └──────────────────────────┘
        

2.3 核心特征

2.4 生态规模

截至2026年初:

3. Hermes Agent 核心功能

3.1 Agent 架构

3.2 多平台消息网关

平台 特性
Telegram文件附件、PDF/Office 文档
Discord频道标题、Bot 过滤
SlackApp mention、结构化日志
WhatsApp原生媒体发送、多用户隔离
Signal完整网关、媒体 URL
Email (IMAP/SMTP)新支持
Home AssistantREST + WebSocket

4. MCP 集成特性

4.1 stdio vs HTTP

# stdio 服务器(本地)
mcp_servers:
  filesystem:
    command: "npx"
    args: ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]

# HTTP 服务器(远程)
mcp_servers:
  remote_api:
    url: "https://mcp.example.com/mcp"
    headers:
      Authorization: "Bearer ***"

4.2 工具命名约定

MCP 工具 注册名称
read_file mcp_filesystem_read_file
create-issue mcp_github_create_issue
query data mcp_my_api_query_data

4.3 白名单策略

github:
  command: "npx"
  args: ["-y", "@modelcontextprotocol/server-github"]
  env:
    GITHUB_PERSONAL_ACCESS_TOKEN: "***"
  tools:
    include: [create_issue, list_issues, search_code]  # 只暴露这些
    exclude: []

4.4 安全特性

5. 配置指南

5.1 基础配置结构

providers:
  openai:
    api_key: ${OPENAI_API_KEY}
    base_url: https://api.openai.com/v1

mcp_servers:
  filesystem:
    command: "npx"
    args: ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]

5.2 安全白名单示例

# GitHub - 只创建和列出问题
github:
  tools:
    include: [create_issue, list_issues, update_issue]

# Stripe - 删除操作黑名单
stripe:
  tools:
    exclude: [delete_customer, refund_payment]

# 内部 API - 侧重只读
internal_api:
  tools:
    include: [list_customers, get_customer]

5.3 手动重新加载

/reload-mcp

修改配置后,在会话中运行此指令重新加载 MCP 工具。

6. 实际应用场景

场景 1: 本地项目助手

git:
  command: "uvx"
  args: ["mcp-server-git", "--repository", "/home/user/project"]

# 用法:
Confirm the repository structure and explain the directory layout.

场景 2: GitHub 问题管理助手

github:
  tools:
    include: [create_issue, list_issues, update_issue]

# 用法:
Summarize the common bug patterns in GitHub issues.

场景 3: 内部 API 助手(只读)

internal_api:
  tools:
    include: [list_customers, get_customer]
  resources: false

# 用法:
Check customer ACME Corp's recent invoice activity.

场景 4: 多系统工作流

# 文件系统 + GitHub 结合
# 用法:
List the files in my project, then create a GitHub issue summarizing what you found.

7. 部署与发布

7.1 安装 Hermes Agent

# 标准安装
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash

# 手动安装
cd ~/.hermes/hermes-agent
uv pip install -e ".[all]"

7.2 常见 MCP 服务器

服务器 包名 功能
Filesystem @modelcontextprotocol/server-filesystem 读写指定目录
GitHub @modelcontextprotocol/server-github 仓库访问、问题、PR
Postgres @modelcontextprotocol/server-postgres PostgreSQL 查询
Brave Search @modelcontextprotocol/server-brave-search Web 搜索

7.3 Hermes 作为 MCP 服务器

# 启动 MCP 服务器模式
hermes mcp serve

# 配置到 Claude Desktop
{
  "mcpServers": {
    "hermes": {
      "command": "hermes",
      "args": ["mcp", "serve"]
    }
  }
}

# 可用工具:
# conversations_list, conversation_get, messages_read,
# attachments_fetch, events_poll, events_wait,
# messages_send (), channels_list, permissions_list_open, permissions_respond

8. 社区与生态

8.1 主要贡献者

8.2 内置技能(部分)

8.3 有用资源

9. 未来展望

9.1 MCP 协议演进

9.2 Hermes Agent 增强

9.3 社区增长

附录

A. 快速参考

B. 技术栈速查

# 使用 npx 运行 Node.js MCP 服务器
command: "npx"
args: ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]

# 使用 uvx 运行 Python MCP 服务器
command: "uvx"
args: ["mcp-server-git", "--repository", "/home/user/project"]

# HTTP 端点
url: "https://mcp.example.com/mcp"
headers:
  Authorization: "Bearer ***"

C. 环境变量示例

# .env 文件
OPENAI_API_KEY=sk-...
OPENROUTER_API_KEY=sk-...
GITHUB_TOKEN=ghp_...
BRAVE_API_KEY=bsr_...
INTERNAL_API_TOKEN=***

D. 常见问题