Skip to content

make it possible for sub-agents to use MCP servers - #649

Merged
dwash96 merged 1 commit into
cecli-dev:v1.2.3from
ekr1:pr-sub-agent-mcp-server
Aug 19, 2026
Merged

dwash96 merged 1 commit into
cecli-dev:v1.2.3from
ekr1:pr-sub-agent-mcp-server

Conversation

@ekr1

@ekr1 ekr1 commented Aug 18, 2026

Copy link
Copy Markdown

My sub-agents could not connect to MCP servers without this change. The meat of it is a one-liner in cecli/helpers/agents/service.py, maybe you @dwash96 want to take a critical look whether that makes sense or could introduce other issues (I'm not sure whether the previous logic was intentional). Please let me know if you need more context.

@dwash96

dwash96 commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Nice, I'll change the targets of your PR against the v1.2.3 branch and review these more thoroughly after work. The core thing is investigating how sub-agents interact with the fairly recent capability to dynamically load and unload MCP servers and making sure they are independent in how they do that. A capability that's probably missing from:

https://cecli.dev/docs/config/subagents/#sub-agents-configuration-sub-agent-file-format-front-matter-fields

Is specifying which MCP servers should be loaded for a sub agent since this PR would cause strict inheritance of the parent MCP manager, which is probably fine. The registered_servers specifications should be giving sub agents distinct views of the central manager even if its a singleton of all active mcp connections

@dwash96
dwash96 changed the base branch from main to v1.2.3 August 18, 2026 12:14
dwash96 added a commit that referenced this pull request Aug 19, 2026
PR #649 made sub-agent MCP filtering work by lowercasing server names
at each comparison site. Move that normalization to the registration
sources so all names are consistently lowercase and every filtering
comparison is a plain exact match:

- McpServer.__init__ lowercases the configured server name (source of
  truth); get_server() becomes case-insensitive so user input in any
  case still resolves.
- update_server_registration() and is_server_globally_excluded() store
  and compare lowercase names.
- load-mcp include-set conversion lowercases connected server names and
  uses 'local' for the always-available Local server (also in the
  ResourceManager tool variant).
- Revert comparison-site lowercasing in get_tool_list(),
  get_announcements(), and get_servers_context(); exact match now works
  because names are lowercase at the source.
- Local server literal checks are case-insensitive ('local') in
  remove-mcp, the ResourceManager tool, and manager warnings.

Adds tests/mcp/test_server_name_normalization.py covering name
lowercasing, case-insensitive lookups, registration lowercasing, exact-
match filtering, servers-context classification, and the load-mcp
conversion.
@dwash96
dwash96 merged commit 83f8690 into cecli-dev:v1.2.3 Aug 19, 2026
12 checks passed
@dwash96 dwash96 mentioned this pull request Aug 19, 2026
JessicaMulein pushed a commit to Digital-Defiance/cecli that referenced this pull request Sep 23, 2026
PR cecli-dev#649 made sub-agent MCP filtering work by lowercasing server names
at each comparison site. Move that normalization to the registration
sources so all names are consistently lowercase and every filtering
comparison is a plain exact match:

- McpServer.__init__ lowercases the configured server name (source of
  truth); get_server() becomes case-insensitive so user input in any
  case still resolves.
- update_server_registration() and is_server_globally_excluded() store
  and compare lowercase names.
- load-mcp include-set conversion lowercases connected server names and
  uses 'local' for the always-available Local server (also in the
  ResourceManager tool variant).
- Revert comparison-site lowercasing in get_tool_list(),
  get_announcements(), and get_servers_context(); exact match now works
  because names are lowercase at the source.
- Local server literal checks are case-insensitive ('local') in
  remove-mcp, the ResourceManager tool, and manager warnings.

Adds tests/mcp/test_server_name_normalization.py covering name
lowercasing, case-insensitive lookups, registration lowercasing, exact-
match filtering, servers-context classification, and the load-mcp
conversion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants