[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71NGQ321T1ER284TMB7HRE2":3,"skill-same:01M71NGQ321T1ER284TMB7HRE2":79},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":57,"commitSha":58,"skillDirectory":59,"forksCount":60,"repositoryHtmlUrl":61,"repositoryHomepageUrl":6,"ownerHtmlUrl":62,"ownerBlogUrl":6,"ownerDescription":63,"updatedAt":64,"install":65,"resources":78},"01M71NGQ321T1ER284TMB7HRE2","native-mcp",null,"Built-in MCP (Model Context Protocol) client that connects to external MCP servers, discovers their tools, and registers them as native Hermes Agent tools. Supports stdio and HTTP transports with automatic reconnection, security filtering, and zero-config tool injection.","q2805187159\u002FAnvil","q2805187159","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F105276843?v=4","01M71KF4TN999VNJX9FY9QT06A","铁甲勇士宋小宝","01M71KF4V97XXQ7AGES97R4Q9F",3,"MIT","https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fmcp\u002Fnative-mcp\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"native","native mcp","MCP","agent tools","protocol","with","http","filtering","tool","ZeRO","integrations","as","context","Tools","security","injection","automatic","config","model context protocol","model","2026-11-10 10:56:23",false,"---\nname: native-mcp\ndescription: Built-in MCP (Model Context Protocol) client that connects to external MCP servers, discovers their tools, and registers them as native Hermes Agent tools. Supports stdio and HTTP transports with automatic reconnection, security filtering, and zero-config tool injection.\nversion: 1.0.0\nauthor: Hermes Agent\nlicense: MIT\nmetadata:\n  hermes:\n    tags: [MCP, Tools, Integrations]\n    related_skills: [mcporter]\n---\n\n# Native MCP Client\n\nHermes 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.\n\n## When to Use\n\nUse this whenever you want to:\n- Connect to MCP servers and use their tools from within Hermes Agent\n- Add external capabilities (filesystem access, GitHub, databases, APIs) via MCP\n- Run local stdio-based MCP servers (npx, uvx, or any command)\n- Connect to remote HTTP\u002FStreamableHTTP MCP servers\n- Have MCP tools auto-discovered and available in every conversation\n\nFor ad-hoc, one-off MCP tool calls from the terminal without configuring anything, see the `mcporter` skill instead.\n\n## Prerequisites\n\n- **mcp Python package** -- optional dependency; install with `pip install mcp`. If not installed, MCP support is silently disabled.\n- **Node.js** -- required for `npx`-based MCP servers (most community servers)\n- **uv** -- required for `uvx`-based MCP servers (Python-based servers)\n\nInstall the MCP SDK:\n\n```bash\npip install mcp\n# or, if using uv:\nuv pip install mcp\n```\n\n## Quick Start\n\nAdd MCP servers to `~\u002F.hermes\u002Fconfig.yaml` under the `mcp_servers` key:\n\n```yaml\nmcp_servers:\n  time:\n    command: \"uvx\"\n    args: [\"mcp-server-time\"]\n```\n\nRestart Hermes Agent. On startup it will:\n1. Connect to the server\n2. Discover available tools\n3. Register them with the prefix `mcp_time_*`\n4. Inject them into all platform toolsets\n\nYou can then use the tools naturally -- just ask the agent to get the current time.\n\n## Configuration Reference\n\nEach entry under `mcp_servers` is a server name mapped to its config. There are two transport types: **stdio** (command-based) and **HTTP** (url-based).\n\n### Stdio Transport (command + args)\n\n```yaml\nmcp_servers:\n  server_name:\n    command: \"npx\"             # (required) executable to run\n    args: [\"-y\", \"pkg-name\"]   # (optional) command arguments, default: []\n    env:                       # (optional) environment variables for the subprocess\n      SOME_API_KEY: \"value\"\n    timeout: 120               # (optional) per-tool-call timeout in seconds, default: 120\n    connect_timeout: 60        # (optional) initial connection timeout in seconds, default: 60\n```\n\n### HTTP Transport (url)\n\n```yaml\nmcp_servers:\n  server_name:\n    url: \"https:\u002F\u002Fmy-server.example.com\u002Fmcp\"   # (required) server URL\n    headers:                                     # (optional) HTTP headers\n      Authorization: \"Bearer sk-...\"\n    timeout: 180               # (optional) per-tool-call timeout in seconds, default: 120\n    connect_timeout: 60        # (optional) initial connection timeout in seconds, default: 60\n```\n\n### All Config Options\n\n| Option            | Type   | Default | Description                                       |\n|-------------------|--------|---------|---------------------------------------------------|\n| `command`         | string | --      | Executable to run (stdio transport, required)     |\n| `args`            | list   | `[]`    | Arguments passed to the command                   |\n| `env`             | dict   | `{}`    | Extra environment variables for the subprocess    |\n| `url`             | string | --      | Server URL (HTTP transport, required)             |\n| `headers`         | dict   | `{}`    | HTTP headers sent with every request              |\n| `timeout`         | int    | `120`   | Per-tool-call timeout in seconds                  |\n| `connect_timeout` | int    | `60`    | Timeout for initial connection and discovery      |\n\nNote: A server config must have either `command` (stdio) or `url` (HTTP), not both.\n\n## How It Works\n\n### Startup Discovery\n\nWhen Hermes Agent starts, `discover_mcp_tools()` is called during tool initialization:\n\n1. Reads `mcp_servers` from `~\u002F.hermes\u002Fconfig.yaml`\n2. For each server, spawns a connection in a dedicated background event loop\n3. Initializes the MCP session and calls `list_tools()` to discover available tools\n4. Registers each tool in the Hermes tool registry\n\n### Tool Naming Convention\n\nMCP tools are registered with the naming pattern:\n\n```\nmcp_{server_name}_{tool_name}\n```\n\nHyphens and dots in names are replaced with underscores for LLM API compatibility.\n\nExamples:\n- Server `filesystem`, tool `read_file` → `mcp_filesystem_read_file`\n- Server `github`, tool `list-issues` → `mcp_github_list_issues`\n- Server `my-api`, tool `fetch.data` → `mcp_my_api_fetch_data`\n\n### Auto-Injection\n\nAfter 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.\n\n### Connection Lifecycle\n\n- Each server runs as a long-lived asyncio Task in a background daemon thread\n- Connections persist for the lifetime of the agent process\n- If a connection drops, automatic reconnection with exponential backoff kicks in (up to 5 retries, max 60s backoff)\n- On agent shutdown, all connections are gracefully closed\n\n### Idempotency\n\n`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.\n\n## Transport Types\n\n### Stdio Transport\n\nThe most common transport. Hermes launches the MCP server as a subprocess and communicates over stdin\u002Fstdout.\n\n```yaml\nmcp_servers:\n  filesystem:\n    command: \"npx\"\n    args: [\"-y\", \"@modelcontextprotocol\u002Fserver-filesystem\", \"\u002Fhome\u002Fuser\u002Fprojects\"]\n```\n\nThe subprocess inherits a **filtered** environment (see Security section below) plus any variables you specify in `env`.\n\n### HTTP \u002F StreamableHTTP Transport\n\nFor remote or shared MCP servers. Requires the `mcp` package to include HTTP client support (`mcp.client.streamable_http`).\n\n```yaml\nmcp_servers:\n  remote_api:\n    url: \"https:\u002F\u002Fmcp.example.com\u002Fmcp\"\n    headers:\n      Authorization: \"Bearer sk-...\"\n```\n\nIf HTTP support is not available in your installed `mcp` version, the server will fail with an ImportError and other servers will continue normally.\n\n## Security\n\n### Environment Variable Filtering\n\nFor stdio servers, Hermes does NOT pass your full shell environment to MCP subprocesses. Only safe baseline variables are inherited:\n\n- `PATH`, `HOME`, `USER`, `LANG`, `LC_ALL`, `TERM`, `SHELL`, `TMPDIR`\n- Any `XDG_*` variables\n\nAll 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.\n\n```yaml\nmcp_servers:\n  github:\n    command: \"npx\"\n    args: [\"-y\", \"@modelcontextprotocol\u002Fserver-github\"]\n    env:\n      # Only this token is passed to the subprocess\n      GITHUB_PERSONAL_ACCESS_TOKEN: \"ghp_...\"\n```\n\n### Credential Stripping in Error Messages\n\nIf an MCP tool call fails, any credential-like patterns in the error message are automatically redacted before being shown to the LLM. This covers:\n\n- GitHub PATs (`ghp_...`)\n- OpenAI-style keys (`sk-...`)\n- Bearer tokens\n- Generic `token=`, `key=`, `API_KEY=`, `password=`, `secret=` patterns\n\n## Troubleshooting\n\n### \"MCP SDK not available -- skipping MCP tool discovery\"\n\nThe `mcp` Python package is not installed. Install it:\n\n```bash\npip install mcp\n```\n\n### \"No MCP servers configured\"\n\nNo `mcp_servers` key in `~\u002F.hermes\u002Fconfig.yaml`, or it's empty. Add at least one server.\n\n### \"Failed to connect to MCP server 'X'\"\n\nCommon causes:\n- **Command not found**: The `command` binary isn't on PATH. Ensure `npx`, `uvx`, or the relevant command is installed.\n- **Package not found**: For npx servers, the npm package may not exist or may need `-y` in args to auto-install.\n- **Timeout**: The server took too long to start. Increase `connect_timeout`.\n- **Port conflict**: For HTTP servers, the URL may be unreachable.\n\n### \"MCP server 'X' requires HTTP transport but mcp.client.streamable_http is not available\"\n\nYour `mcp` package version doesn't include HTTP client support. Upgrade:\n\n```bash\npip install --upgrade mcp\n```\n\n### Tools not appearing\n\n- Check that the server is listed under `mcp_servers` (not `mcp` or `servers`)\n- Ensure the YAML indentation is correct\n- Look at Hermes Agent startup logs for connection messages\n- Tool names are prefixed with `mcp_{server}_{tool}` -- look for that pattern\n\n### Connection keeps dropping\n\nThe 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.\n\n## Examples\n\n### Time Server (uvx)\n\n```yaml\nmcp_servers:\n  time:\n    command: \"uvx\"\n    args: [\"mcp-server-time\"]\n```\n\nRegisters tools like `mcp_time_get_current_time`.\n\n### Filesystem Server (npx)\n\n```yaml\nmcp_servers:\n  filesystem:\n    command: \"npx\"\n    args: [\"-y\", \"@modelcontextprotocol\u002Fserver-filesystem\", \"\u002Fhome\u002Fuser\u002Fdocuments\"]\n    timeout: 30\n```\n\nRegisters tools like `mcp_filesystem_read_file`, `mcp_filesystem_write_file`, `mcp_filesystem_list_directory`.\n\n### GitHub Server with Authentication\n\n```yaml\nmcp_servers:\n  github:\n    command: \"npx\"\n    args: [\"-y\", \"@modelcontextprotocol\u002Fserver-github\"]\n    env:\n      GITHUB_PERSONAL_ACCESS_TOKEN: \"ghp_xxxxxxxxxxxxxxxxxxxx\"\n    timeout: 60\n```\n\nRegisters tools like `mcp_github_list_issues`, `mcp_github_create_pull_request`, etc.\n\n### Remote HTTP Server\n\n```yaml\nmcp_servers:\n  company_api:\n    url: \"https:\u002F\u002Fmcp.mycompany.com\u002Fv1\u002Fmcp\"\n    headers:\n      Authorization: \"Bearer sk-xxxxxxxxxxxxxxxxxxxx\"\n      X-Team-Id: \"engineering\"\n    timeout: 180\n    connect_timeout: 30\n```\n\n### Multiple Servers\n\n```yaml\nmcp_servers:\n  time:\n    command: \"uvx\"\n    args: [\"mcp-server-time\"]\n\n  filesystem:\n    command: \"npx\"\n    args: [\"-y\", \"@modelcontextprotocol\u002Fserver-filesystem\", \"\u002Ftmp\"]\n\n  github:\n    command: \"npx\"\n    args: [\"-y\", \"@modelcontextprotocol\u002Fserver-github\"]\n    env:\n      GITHUB_PERSONAL_ACCESS_TOKEN: \"ghp_xxxxxxxxxxxxxxxxxxxx\"\n\n  company_api:\n    url: \"https:\u002F\u002Fmcp.internal.company.com\u002Fmcp\"\n    headers:\n      Authorization: \"Bearer sk-xxxxxxxxxxxxxxxxxxxx\"\n    timeout: 300\n```\n\nAll tools from all servers are registered and available simultaneously. Each server's tools are prefixed with its name to avoid collisions.\n\n## Sampling (Server-Initiated LLM Requests)\n\nHermes supports MCP's `sampling\u002FcreateMessage` 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).\n\nSampling is **enabled by default**. Configure per server:\n\n```yaml\nmcp_servers:\n  my_server:\n    command: \"npx\"\n    args: [\"-y\", \"my-mcp-server\"]\n    sampling:\n      enabled: true           # default: true\n      model: \"gemini-3-flash\" # model override (optional)\n      max_tokens_cap: 4096    # max tokens per request\n      timeout: 30             # LLM call timeout (seconds)\n      max_rpm: 10             # max requests per minute\n      allowed_models: []      # model whitelist (empty = all)\n      max_tool_rounds: 5      # tool loop limit (0 = disable)\n      log_level: \"info\"       # audit verbosity\n```\n\nServers 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()`.\n\nDisable sampling for untrusted servers with `sampling: { enabled: false }`.\n\n## Notes\n\n- MCP tools are called synchronously from the agent's perspective but run asynchronously on a dedicated background event loop\n- Tool results are returned as JSON with either `{\"result\": \"...\"}` or `{\"error\": \"...\"}`\n- The native MCP client is independent of `mcporter` -- you can use both simultaneously\n- Server connections are persistent and shared across all conversations in the same agent process\n- Adding or removing servers requires restarting the agent (no hot-reload currently)\n","# Native MCP Client\n\nHermes 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.\n\n## When to Use\n\nUse this whenever you want to:\n- Connect to MCP servers and use their tools from within Hermes Agent\n- Add external capabilities (filesystem access, GitHub, databases, APIs) via MCP\n- Run local stdio-based MCP servers (npx, uvx, or any command)\n- Connect to remote HTTP\u002FStreamableHTTP MCP servers\n- Have MCP tools auto-discovered and available in every conversation\n\nFor ad-hoc, one-off MCP tool calls from the terminal without configuring anything, see the `mcporter` skill instead.\n\n## Prerequisites\n\n- **mcp Python package** -- optional dependency; install with `pip install mcp`. If not installed, MCP support is silently disabled.\n- **Node.js** -- required for `npx`-based MCP servers (most community servers)\n- **uv** -- required for `uvx`-based MCP servers (Python-based servers)\n\nInstall the MCP SDK:\n\n```bash\npip install mcp\n# or, if using uv:\nuv pip install mcp\n```\n\n## Quick Start\n\nAdd MCP servers to `~\u002F.hermes\u002Fconfig.yaml` under the `mcp_servers` key:\n\n```yaml\nmcp_servers:\n  time:\n    command: \"uvx\"\n    args: [\"mcp-server-time\"]\n```\n\nRestart Hermes Agent. On startup it will:\n1. Connect to the server\n2. Discover available tools\n3. Register them with the prefix `mcp_time_*`\n4. Inject them into all platform toolsets\n\nYou can then use the tools naturally -- just ask the agent to get the current time.\n\n## Configuration Reference\n\nEach entry under `mcp_servers` is a server name mapped to its config. There are two transport types: **stdio** (command-based) and **HTTP** (url-based).\n\n### Stdio Transport (command + args)\n\n```yaml\nmcp_servers:\n  server_name:\n    command: \"npx\"             # (required) executable to run\n    args: [\"-y\", \"pkg-name\"]   # (optional) command arguments, default: []\n    env:                       # (optional) environment variables for the subprocess\n      SOME_API_KEY: \"value\"\n    timeout: 120               # (optional) per-tool-call timeout in seconds, default: 120\n    connect_timeout: 60        # (optional) initial connection timeout in seconds, default: 60\n```\n\n### HTTP Transport (url)\n\n```yaml\nmcp_servers:\n  server_name:\n    url: \"https:\u002F\u002Fmy-server.example.com\u002Fmcp\"   # (required) server URL\n    headers:                                     # (optional) HTTP headers\n      Authorization: \"Bearer sk-...\"\n    timeout: 180               # (optional) per-tool-call timeout in seconds, default: 120\n    connect_timeout: 60        # (optional) initial connection timeout in seconds, default: 60\n```\n\n### All Config Options\n\n| Option            | Type   | Default | Description                                       |\n|-------------------|--------|---------|---------------------------------------------------|\n| `command`         | string | --      | Executable to run (stdio transport, required)     |\n| `args`            | list   | `[]`    | Arguments passed to the command                   |\n| `env`             | dict   | `{}`    | Extra environment variables for the subprocess    |\n| `url`             | string | --      | Server URL (HTTP transport, required)             |\n| `headers`         | dict   | `{}`    | HTTP headers sent with every request              |\n| `timeout`         | int    | `120`   | Per-tool-call timeout in seconds                  |\n| `connect_timeout` | int    | `60`    | Timeout for initial connection and discovery      |\n\nNote: A server config must have either `command` (stdio) or `url` (HTTP), not both.\n\n## How It Works\n\n### Startup Discovery\n\nWhen Hermes Agent starts, `discover_mcp_tools()` is called during tool initialization:\n\n1. Reads `mcp_servers` from `~\u002F.hermes\u002Fconfig.yaml`\n2. For each server, spawns a connection in a dedicated background event loop\n3. Initializes the MCP session and calls `list_tools()` to discover available tools\n4. Registers each tool in the Hermes tool registry\n\n### Tool Naming Convention\n\nMCP tools are registered with the naming pattern:\n\n```\nmcp_{server_name}_{tool_name}\n```\n\nHyphens and dots in names are replaced with underscores for LLM API compatibility.\n\nExamples:\n- Server `filesystem`, tool `read_file` → `mcp_filesystem_read_file`\n- Server `github`, tool `list-issues` → `mcp_github_list_issues`\n- Server `my-api`, tool `fetch.data` → `mcp_my_api_fetch_data`\n\n### Auto-Injection\n\nAfter 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.\n\n### Connection Lifecycle\n\n- Each server runs as a long-lived asyncio Task in a background daemon thread\n- Connections persist for the lifetime of the agent process\n- If a connection drops, automatic reconnection with exponential backoff kicks in (up to 5 retries, max 60s backoff)\n- On agent shutdown, all connections are gracefully closed\n\n### Idempotency\n\n`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.\n\n## Transport Types\n\n### Stdio Transport\n\nThe most common transport. Hermes launches the MCP server as a subprocess and communicates over stdin\u002Fstdout.\n\n```yaml\nmcp_servers:\n  filesystem:\n    command: \"npx\"\n    args: [\"-y\", \"@modelcontextprotocol\u002Fserver-filesystem\", \"\u002Fhome\u002Fuser\u002Fprojects\"]\n```\n\nThe subprocess inherits a **filtered** environment (see Security section below) plus any variables you specify in `env`.\n\n### HTTP \u002F StreamableHTTP Transport\n\nFor remote or shared MCP servers. Requires the `mcp` package to include HTTP client support (`mcp.client.streamable_http`).\n\n```yaml\nmcp_servers:\n  remote_api:\n    url: \"https:\u002F\u002Fmcp.example.com\u002Fmcp\"\n    headers:\n      Authorization: \"Bearer sk-...\"\n```\n\nIf HTTP support is not available in your installed `mcp` version, the server will fail with an ImportError and other servers will continue normally.\n\n## Security\n\n### Environment Variable Filtering\n\nFor stdio servers, Hermes does NOT pass your full shell environment to MCP subprocesses. Only safe baseline variables are inherited:\n\n- `PATH`, `HOME`, `USER`, `LANG`, `LC_ALL`, `TERM`, `SHELL`, `TMPDIR`\n- Any `XDG_*` variables\n\nAll 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.\n\n```yaml\nmcp_servers:\n  github:\n    command: \"npx\"\n    args: [\"-y\", \"@modelcontextprotocol\u002Fserver-github\"]\n    env:\n      # Only this token is passed to the subprocess\n      GITHUB_PERSONAL_ACCESS_TOKEN: \"ghp_...\"\n```\n\n### Credential Stripping in Error Messages\n\nIf an MCP tool call fails, any credential-like patterns in the error message are automatically redacted before being shown to the LLM. This covers:\n\n- GitHub PATs (`ghp_...`)\n- OpenAI-style keys (`sk-...`)\n- Bearer tokens\n- Generic `token=`, `key=`, `API_KEY=`, `password=`, `secret=` patterns\n\n## Troubleshooting\n\n### \"MCP SDK not available -- skipping MCP tool discovery\"\n\nThe `mcp` Python package is not installed. Install it:\n\n```bash\npip install mcp\n```\n\n### \"No MCP servers configured\"\n\nNo `mcp_servers` key in `~\u002F.hermes\u002Fconfig.yaml`, or it's empty. Add at least one server.\n\n### \"Failed to connect to MCP server 'X'\"\n\nCommon causes:\n- **Command not found**: The `command` binary isn't on PATH. Ensure `npx`, `uvx`, or the relevant command is installed.\n- **Package not found**: For npx servers, the npm package may not exist or may need `-y` in args to auto-install.\n- **Timeout**: The server took too long to start. Increase `connect_timeout`.\n- **Port conflict**: For HTTP servers, the URL may be unreachable.\n\n### \"MCP server 'X' requires HTTP transport but mcp.client.streamable_http is not available\"\n\nYour `mcp` package version doesn't include HTTP client support. Upgrade:\n\n```bash\npip install --upgrade mcp\n```\n\n### Tools not appearing\n\n- Check that the server is listed under `mcp_servers` (not `mcp` or `servers`)\n- Ensure the YAML indentation is correct\n- Look at Hermes Agent startup logs for connection messages\n- Tool names are prefixed with `mcp_{server}_{tool}` -- look for that pattern\n\n### Connection keeps dropping\n\nThe 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.\n\n## Examples\n\n### Time Server (uvx)\n\n```yaml\nmcp_servers:\n  time:\n    command: \"uvx\"\n    args: [\"mcp-server-time\"]\n```\n\nRegisters tools like `mcp_time_get_current_time`.\n\n### Filesystem Server (npx)\n\n```yaml\nmcp_servers:\n  filesystem:\n    command: \"npx\"\n    args: [\"-y\", \"@modelcontextprotocol\u002Fserver-filesystem\", \"\u002Fhome\u002Fuser\u002Fdocuments\"]\n    timeout: 30\n```\n\nRegisters tools like `mcp_filesystem_read_file`, `mcp_filesystem_write_file`, `mcp_filesystem_list_directory`.\n\n### GitHub Server with Authentication\n\n```yaml\nmcp_servers:\n  github:\n    command: \"npx\"\n    args: [\"-y\", \"@modelcontextprotocol\u002Fserver-github\"]\n    env:\n      GITHUB_PERSONAL_ACCESS_TOKEN: \"ghp_xxxxxxxxxxxxxxxxxxxx\"\n    timeout: 60\n```\n\nRegisters tools like `mcp_github_list_issues`, `mcp_github_create_pull_request`, etc.\n\n### Remote HTTP Server\n\n```yaml\nmcp_servers:\n  company_api:\n    url: \"https:\u002F\u002Fmcp.mycompany.com\u002Fv1\u002Fmcp\"\n    headers:\n      Authorization: \"Bearer sk-xxxxxxxxxxxxxxxxxxxx\"\n      X-Team-Id: \"engineering\"\n    timeout: 180\n    connect_timeout: 30\n```\n\n### Multiple Servers\n\n```yaml\nmcp_servers:\n  time:\n    command: \"uvx\"\n    args: [\"mcp-server-time\"]\n\n  filesystem:\n    command: \"npx\"\n    args: [\"-y\", \"@modelcontextprotocol\u002Fserver-filesystem\", \"\u002Ftmp\"]\n\n  github:\n    command: \"npx\"\n    args: [\"-y\", \"@modelcontextprotocol\u002Fserver-github\"]\n    env:\n      GITHUB_PERSONAL_ACCESS_TOKEN: \"ghp_xxxxxxxxxxxxxxxxxxxx\"\n\n  company_api:\n    url: \"https:\u002F\u002Fmcp.internal.company.com\u002Fmcp\"\n    headers:\n      Authorization: \"Bearer sk-xxxxxxxxxxxxxxxxxxxx\"\n    timeout: 300\n```\n\nAll tools from all servers are registered and available simultaneously. Each server's tools are prefixed with its name to avoid collisions.\n\n## Sampling (Server-Initiated LLM Requests)\n\nHermes supports MCP's `sampling\u002FcreateMessage` 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).\n\nSampling is **enabled by default**. Configure per server:\n\n```yaml\nmcp_servers:\n  my_server:\n    command: \"npx\"\n    args: [\"-y\", \"my-mcp-server\"]\n    sampling:\n      enabled: true           # default: true\n      model: \"gemini-3-flash\" # model override (optional)\n      max_tokens_cap: 4096    # max tokens per request\n      timeout: 30             # LLM call timeout (seconds)\n      max_rpm: 10             # max requests per minute\n      allowed_models: []      # model whitelist (empty = all)\n      max_tool_rounds: 5      # tool loop limit (0 = disable)\n      log_level: \"info\"       # audit verbosity\n```\n\nServers 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()`.\n\nDisable sampling for untrusted servers with `sampling: { enabled: false }`.\n\n## Notes\n\n- MCP tools are called synchronously from the agent's perspective but run asynchronously on a dedicated background event loop\n- Tool results are returned as JSON with either `{\"result\": \"...\"}` or `{\"error\": \"...\"}`\n- The native MCP client is independent of `mcporter` -- you can use both simultaneously\n- Server connections are persistent and shared across all conversations in the same agent process\n- Adding or removing servers requires restarting the agent (no hot-reload currently)\n",{"name":5,"author":49,"license":15,"version":50,"metadata":51,"description":7},"Hermes Agent","1.0.0",{"hermes":52},{"tags":53,"related_skills":55},[26,37,54],"Integrations",[56],"mcporter","main","6ffadc67c9777282fa1f9330ec12ac8778064409","skills\u002Fmcp\u002Fnative-mcp",0,"https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil","https:\u002F\u002Fgithub.com\u002Fq2805187159","Independent Researcher\r\n\r\nEmail: q2805187159@gmail.com\r\n\r\nGithub: q2805187159\r\n\r\nResearch Interests:\r\n- LLM Agents\r\n- Tool Routing\r\n- RAG","2026-06-24 18:31:41",{"source":8,"skillName":5,"commands":66,"prompt":76,"zipAvailable":77},[67,70,73],{"tool":68,"command":69},"npx","npx skills add q2805187159\u002FAnvil --skill native-mcp",{"tool":71,"command":72},"bunx","bunx skills add q2805187159\u002FAnvil --skill native-mcp",{"tool":74,"command":75},"pnpm","pnpm dlx skills add q2805187159\u002FAnvil --skill native-mcp","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fmcp\u002Fnative-mcp\u002FSKILL.md",true,[],[80,111,144,151,175,197],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":84,"licenseFileUrl":85,"sourceHtmlUrl":86,"categories":87,"keywords":94,"publishedAt":44},"01M71NPWVVMB1AZ8XGKNJFT0YP","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[88,91],{"categoryNo":89,"categoryName":90,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":92,"categoryName":93,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",[95,96,97,98,99,100,101,102,103,104,105,29,106,107,108,109,110],"webapp","testing","webapp testing","for","applications","local","frontend","debugging","toolkit","logs","browser","playwright","web","behavior","ui","screenshots",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":125,"publishedAt":44},"01M71NPTQ96H4XSZVZT422BNRB","web-design-guidelines","Review UI code for Web Interface Guidelines compliance. Use when asked to \"review my UI\", \"check accessibility\", \"audit design\", \"review UX\", or \"check my site against best practices\".","https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fweb-design-guidelines\u002FSKILL.md",[117,120],{"categoryNo":118,"categoryName":119,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":121,"categoryName":122,"taxonomyType":123,"taxonomyTypeDesc":124},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[126,127,107,128,129,98,130,131,132,133,134,135,136,137,138,139,140,141,142,143],"guidelines","design","web design guidelines","web design","vercel","interface","web interface guidelines","use","when","best practices","file","code","review","check","compliance","audit","ux","accessibility",{"skillNo":145,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":146,"categories":147,"keywords":150,"publishedAt":44},"01M71NPS2D31Y2BGFYA9DB7CE4","https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fweb-design-guidelines copy\u002FSKILL.md",[148,149],{"categoryNo":118,"categoryName":119,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":121,"categoryName":122,"taxonomyType":123,"taxonomyTypeDesc":124},[126,127,107,128,129,98,130,131,132,133,134,135,136,137,138,139,140,141,142,143],{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":161,"publishedAt":44},"01M71NPQ9DRT54QSQJ0BHBM3VG","video-generation","Use this skill when the user requests to generate, create, or imagine videos. Supports structured prompts and reference image for guided generation.","https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fvideo-generation\u002FSKILL.md",[157,160],{"categoryNo":158,"categoryName":159,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000016","图像与多媒体",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[162,163,164,98,133,134,165,166,167,168,169,170,171,172,173,174],"Video","video generation","generation","image","create","imagine","requests","generate","videos","reference","prompts","user","structured",{"skillNo":176,"name":177,"nameZh":6,"description":178,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":179,"categories":180,"keywords":182,"publishedAt":44},"01M71NPN57CT154SWXAS52475X","youtube-downloader","Download YouTube videos with customizable quality and format options. Use this skill when the user asks to download, save, or grab YouTube videos. Supports various quality settings (best, 1080p, 720p, 480p, 360p), multiple formats (mp4, webm, mkv), and audio-only downloads as MP3.","https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fvideo-downloader\u002FSKILL.md",[181],{"categoryNo":158,"categoryName":159,"taxonomyType":21,"taxonomyTypeDesc":22},[183,184,185,35,186,187,188,133,134,189,29,190,191,192,193,194,170,195,173,196],"youtube","youtube downloader","mp4","downloads","Audio","only","mp3","options","quality","format","settings","grab","formats","download",{"skillNo":198,"name":199,"nameZh":6,"description":200,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":201,"categories":202,"keywords":203,"publishedAt":44},"01M71NPKD95YB8N3J6J78QGFFW","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fverification-before-completion\u002FSKILL.md",[],[204,205,206,207,208,209,210,133,211,134,212,213,214,215,216,217],"verification","verification before completion","running","evidence","complete","prs","claim","assertions","committing","output","claims","work","about","commands"]