hermes - 💡(How to fix) Fix [Feature Request] Add delegation.mcp_servers config option for child-only MCP tool loading [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#15528Fetched 2026-04-26 05:26:53
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×6

Code Example

delegation:
  mcp_servers:
    minimax:
      command: uvx
      args: [minimax-coding-plan-mcp]
      env:
        MINIMAX_API_KEY: "sk-..."
        MINIMAX_API_HOST: "https://api.minimaxi.com"

---

# main agent's mcp_servers — loaded by both main and child agents
mcp_servers:
  filesystem:
    command: uvx
    args: [mcp-filesystem]

# delegation-specific mcp_servers — loaded ONLY by child agents
delegation:
  mcp_servers:
    minimax:
      command: uvx
      args: [minimax-coding-plan-mcp]
      env:
        MINIMAX_API_KEY: "sk-..."
RAW_BUFFERClick to expand / collapse

Feature Request: delegation.mcp_servers for Child-Only MCP Tool Loading

Problem Description

Currently, all MCP servers configured under the top-level mcp_servers key are loaded globally — they are available to both the main agent and any child agents spawned via delegate_task. There is no way to restrict an MCP server to child agents only, so that the main agent does not load it.

The only existing control is delegation.inherit_mcp_toolsets: true/false, which only governs whether child agents inherit the MCP toolsets already loaded by the parent. It does not solve the use case of "main agent does NOT load X, but child agents CAN load X".

Proposed Solution

Introduce a new delegation.mcp_servers configuration block, following the same schema as the top-level mcp_servers:

delegation:
  mcp_servers:
    minimax:
      command: uvx
      args: [minimax-coding-plan-mcp]
      env:
        MINIMAX_API_KEY: "sk-..."
        MINIMAX_API_HOST: "https://api.minimaxi.com"

When delegation.mcp_servers is present, child agents load those MCP servers. The main agent is unaffected and does not load them. This coexists with the top-level mcp_servers block — the two are independent.

Motivation

  • Security / Least Privilege: The main agent may not need (and should not have) certain powerful tools like code execution or internal APIs. Restricting them to child tasks reduces the attack surface.
  • Resource Savings: MCP servers can be heavyweight; not loading them in the main agent saves memory and startup time.
  • Clearer Separation of Concerns: Tasks that require specialized MCP tools can be delegated without polluting the main agent's tool space.

Implementation Notes (Reference)

Relevant source locations in tools/delegate_tool.py:

  • _get_inherit_mcp_toolsets() — reads inherit_mcp_toolsets config
  • _is_mcp_toolset_name() — checks if a toolset name is MCP-related
  • _preserve_parent_mcp_toolsets() — ensures child agents retain parent's MCP toolsets
  • _build_child_agent() lines 844-851 — toolset intersection logic

The delegation config block is defined in hermes_cli/config.py (lines 761-786) and currently supports: model, provider, base_url, api_key, inherit_mcp_toolsets, max_iterations, child_timeout_seconds, reasoning_effort, max_concurrent_children, max_spawn_depth, orchestrator_enabled, default_toolsets. No MCP-specific configuration exists yet.

Suggested API

# main agent's mcp_servers — loaded by both main and child agents
mcp_servers:
  filesystem:
    command: uvx
    args: [mcp-filesystem]

# delegation-specific mcp_servers — loaded ONLY by child agents
delegation:
  mcp_servers:
    minimax:
      command: uvx
      args: [minimax-coding-plan-mcp]
      env:
        MINIMAX_API_KEY: "sk-..."

When both mcp_servers and delegation.mcp_servers are present, child agents receive the union of both sets. The main agent only sees mcp_servers. The existing delegation.inherit_mcp_toolsets behavior is unchanged.

Questions / Open Points

  1. Should delegation.mcp_servers be additive (union with top-level mcp_servers) or strictly child-only (override)?
  2. Should this feature also allow delegation.mcp_servers to exclude servers from the inherited set, or is a separate key sufficient?
  3. Any compatibility concerns with existing default_toolsets behavior when MCP servers are listed there?

extent analysis

TL;DR

Introduce a new delegation.mcp_servers configuration block to restrict MCP servers to child agents only.

Guidance

  • Review the proposed delegation.mcp_servers configuration block and its schema to ensure it meets the requirements.
  • Update the tools/delegate_tool.py file to handle the new delegation.mcp_servers configuration, specifically in the _build_child_agent() function.
  • Verify that the main agent does not load MCP servers configured under delegation.mcp_servers by checking the toolset intersection logic.
  • Test the new configuration with both mcp_servers and delegation.mcp_servers present to ensure child agents receive the union of both sets.

Example

delegation:
  mcp_servers:
    minimax:
      command: uvx
      args: [minimax-coding-plan-mcp]
      env:
        MINIMAX_API_KEY: "sk-..."

Notes

The implementation details and potential compatibility concerns with existing default_toolsets behavior should be carefully considered.

Recommendation

Apply the proposed workaround by introducing the new delegation.mcp_servers configuration block, as it provides a clear solution to the problem of restricting MCP servers to child agents only.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Feature Request] Add delegation.mcp_servers config option for child-only MCP tool loading [1 participants]