用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/clowlove/Hermes-House --skill native-mcp命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Migrate Hermes Agent to a new server while keeping both instances running in parallel. Covers backup, SSH troubleshooting, skill/memory sync, and GitHub remote setup.
Backup, restore, and migrate Hermes Agent data across machines. Covers the local backup scripts, cron scheduling, retention policies, git remote management, shallow-clone migration, and cross-machine parallel deployment.
Modify PDF appearance without changing content/structure: change font colors, remove highlights, adjust styling. Preserves all text, layout, fonts, and embedded resources.
基于 SOC 职业分类
正在显示 SKILL.md
| name | native-mcp |
| description | MCP client: connect servers, register tools (stdio/HTTP). |
| version | 1.0.0 |
| author | Hermes Agent |
| license | MIT |
| metadata | {"hermes":{"tags":["MCP","Tools","Integrations"],"related_skills":["mcporter"]}} |
Hermes Agent has a built-in MCP client that connects to MCP servers at startup, discovers their tools, and makes them available as first-class tools the agent can call directly. No bridge CLI needed -- tools from MCP servers appear alongside built-in tools like terminal, read_file, etc.
Use this whenever you want to:
For ad-hoc, one-off MCP tool calls from the terminal without configuring anything, see the mcporter skill instead.
pip install mcp. If not installed, MCP support is silently disabled.npx-based MCP servers (most community servers)uvx-based MCP servers (Python-based servers)Install the MCP SDK:
pip install mcp
# or, if using uv:
uv pip install mcp
Add MCP servers to ~/.hermes/config.yaml under the mcp_servers key:
mcp_servers:
time:
command: "uvx"
args: ["mcp-server-time"]
Restart Hermes Agent. On startup it will:
mcp_time_*You can then use the tools naturally -- just ask the agent to get the current time.
Each entry under mcp_servers is a server name mapped to its config. There are two transport types: stdio (command-based) and HTTP (url-based).
mcp_servers:
server_name:
command: "npx" # (required) executable to run
args: ["-y", "pkg-name"] # (optional) command arguments, default: []
env: # (optional) environment variables for the subprocess
SOME_API_KEY: "value"
timeout: 120 # (optional) per-tool-call timeout in seconds, default: 120
connect_timeout: 60 # (optional) initial connection timeout in seconds, default: 60
mcp_servers:
server_name:
url: "https://my-server.example.com/mcp" # (required) server URL
headers: # (optional) HTTP headers
Authorization: "Bearer sk-..."
timeout: 180 # (optional) per-tool-call timeout in seconds, default: 120
connect_timeout: 60 # (optional) initial connection timeout in seconds, default: 60
| Option | Type | Default | Description |
|---|---|---|---|
command | string | -- | Executable to run (stdio transport, required) |
args | list | [] | Arguments passed to the command |
env | dict | {} | Extra environment variables for the subprocess |
url | string | -- | Server URL (HTTP transport, required) |
headers | dict | {} | HTTP headers sent with every request |
timeout | int | 120 | Per-tool-call timeout in seconds |
connect_timeout | int | 60 | Timeout for initial connection and discovery |
Note: A server config must have either command (stdio) or url (HTTP), not both.
When Hermes Agent starts, discover_mcp_tools() is called during tool initialization:
mcp_servers from ~/.hermes/config.yamllist_tools() to discover available toolsMCP tools are registered with the naming pattern:
mcp_{server_name}_{tool_name}
Hyphens and dots in names are replaced with underscores for LLM API compatibility.
Examples:
filesystem, tool read_file → mcp_filesystem_read_filegithub, tool list-issues → mcp_github_list_issuesmy-api, tool fetch.data → mcp_my_api_fetch_dataAfter discovery, MCP tools are automatically injected into all hermes-* platform toolsets (CLI, Discord, Telegram, etc.). This means MCP tools are available in every conversation without any additional configuration.
discover_mcp_tools() is idempotent -- calling it multiple times only connects to servers that aren't already connected. Failed servers are retried on subsequent calls.
The most common transport. Hermes launches the MCP server as a subprocess and communicates over stdin/stdout.
mcp_servers:
filesystem:
command: "npx"
args: ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/projects"]
The subprocess inherits a filtered environment (see Security section below) plus any variables you specify in env.
For remote or shared MCP servers. Requires the mcp package to include HTTP client support (mcp.client.streamable_http).
mcp_servers:
remote_api:
url: "https://mcp.example.com/mcp"
headers:
Authorization: "Bearer sk-..."
If HTTP support is not available in your installed mcp version, the server will fail with an ImportError and other servers will continue normally.
For stdio servers, Hermes does NOT pass your full shell environment to MCP subprocesses. Only safe baseline variables are inherited:
PATH, HOME, USER, LANG, LC_ALL, TERM, SHELL, TMPDIRXDG_* variablesAll other environment variables (API keys, tokens, secrets) are excluded unless you explicitly add them via the env config key. This prevents accidental credential leakage to untrusted MCP servers.
mcp_servers:
github:
command: "npx"
args: ["-y", "@modelcontextprotocol/server-github"]
env:
# Only this token is passed to the subprocess
GITHUB_PERSONAL_ACCESS_TOKEN: "ghp_..."
If an MCP tool call fails, any credential-like patterns in the error message are automatically redacted before being shown to the LLM. This covers:
ghp_...)sk-...)token=, key=, API_KEY=, password=, secret= patternsThe mcp Python package is not installed. Install it:
pip install mcp
No mcp_servers key in ~/.hermes/config.yaml, or it's empty. Add at least one server.
Common causes:
command binary isn't on PATH. Ensure npx, uvx, or the relevant command is installed.-y in args to auto-install.connect_timeout.Your mcp package version doesn't include HTTP client support. Upgrade:
pip install --upgrade mcp
mcp_servers (not mcp or servers)mcp_{server}_{tool} -- look for that patternSymptoms: ps aux shows the server process running, but hermes-agent tool calls fail with TimeoutError. Direct curl to the server's HTTP endpoint returns Not Found or other unexpected responses.
Root cause patterns:
Server running but not responding to MCP protocol — curl http://localhost:3333/ returns something like "Not Found" even though the process is alive. This means the server is running but the endpoint path or headers are wrong.
Missing HTTP protocol headers — MCP HTTP servers (especially StreamableHTTP transport) require specific headers on every request:
Accept: application/json, text/event-stream — server rejects requests without thisContent-Type: application/jsonWithout these, the server returns 406 or other errors.
Missing session ID — StreamableHTTP MCP servers require an MCP-Session-ID header, obtained from the initialize response's mcp-session-id header. Without it, subsequent calls fail with Invalid request parameters.
Diagnosis with curl (HTTP servers):
# Test if server is alive at all
curl -s --max-time 5 http://localhost:3333/ && echo "Server alive"
# Test MCP initialize (check response headers for mcp-session-id)
curl -s --max-time 10 -i -X POST http://localhost:3333/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}},"id":1}' 2>&1
# If you see "Not Acceptable" → missing Accept header
# If you see "Missing session ID" → server requires MCP-Session-ID header
# If you see a valid JSON response with serverInfo → server is healthy
Fix approaches (in order of preference):
Restart the MCP server process — often resolves transient state issues:
pkill -f "mcp_server.server --transport=http --port=3333"
sleep 2
# Restart with same command from original launch
Check server logs — look for startup errors, port conflicts, import failures:
cat /tmp/trendradar_mcp.log 2>/dev/null || journalctl | grep mcp
Verify config.yaml — some MCP servers require a config file:
cd /path/to/mcp/server && ls -la config.yaml 2>/dev/null
Important: If ps aux shows the server running but hermes-agent still fails, the server process may be in a broken state (e.g., an import error at startup that caused it to crash after backgrounding). Restarting the process often fixes it. Do NOT assume "process running = working."
The client retries up to 5 times with exponential backoff (1s, 2s, 4s, 8s, 16s, capped at 60s). If the server is fundamentally unreachable, it gives up after 5 attempts. Check the server process and network connectivity.
mcp_servers:
time:
command: "uvx"
args: ["mcp-server-time"]
Registers tools like mcp_time_get_current_time.
mcp_servers:
filesystem:
command: "npx"
args: ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/documents"]
timeout: 30
Registers tools like mcp_filesystem_read_file, mcp_filesystem_write_file, mcp_filesystem_list_directory.
mcp_servers:
github:
command: "npx"
args: ["-y", "@modelcontextprotocol/server-github"]
env:
GITHUB_PERSONAL_ACCESS_TOKEN: "[REDACTED]"
timeout: 60
Registers tools like mcp_github_list_issues, mcp_github_create_pull_request, etc.
mcp_servers:
company_api:
url: "https://mcp.mycompany.com/v1/mcp"
headers:
Authorization: "Bearer sk-xxxxxxxxxxxxxxxxxxxx"
X-Team-Id: "engineering"
timeout: 180
connect_timeout: 30
mcp_servers:
time:
command: "uvx"
args: ["mcp-server-time"]
filesystem:
command: "npx"
args: ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
github:
command: "npx"
args: ["-y", "@modelcontextprotocol/server-github"]
env:
GITHUB_PERSONAL_ACCESS_TOKEN: "[REDACTED]"
company_api:
url: "https://mcp.internal.company.com/mcp"
headers:
Authorization: "Bearer sk-xxxxxxxxxxxxxxxxxxxx"
timeout: 300
All tools from all servers are registered and available simultaneously. Each server's tools are prefixed with its name to avoid collisions.
Hermes supports MCP's sampling/createMessage capability — MCP servers can request LLM completions through the agent during tool execution. This enables agent-in-the-loop workflows (data analysis, content generation, decision-making).
Sampling is enabled by default. Configure per server:
mcp_servers:
my_server:
command: "npx"
args: ["-y", "my-mcp-server"]
sampling:
enabled: true # default: true
model: "gemini-3-flash" # model override (optional)
max_tokens_cap: 4096 # max tokens per request
timeout: 30 # LLM call timeout (seconds)
max_rpm: 10 # max requests per minute
allowed_models: [] # model whitelist (empty = all)
max_tool_rounds: 5 # tool loop limit (0 = disable)
log_level: "info" # audit verbosity
Servers can also include tools in sampling requests for multi-turn tool-augmented workflows. The max_tool_rounds config prevents infinite tool loops. Per-server audit metrics (requests, errors, tokens, tool use count) are tracked via get_mcp_status().
Disable sampling for untrusted servers with sampling: { enabled: false }.
{"result": "..."} or {"error": "..."}mcporter -- you can use both simultaneously