You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ClientSessionGroup silently drops resources with the same name and different URIs #3976
I ran the example below on mcp 2.3.0. The client listed both resources named Introduction: docs://library/intro and docs://archive/intro. Adding that same session to a ClientSessionGroup succeeded, but the group contained only {'Introduction': 'docs://archive/intro'}. There was no indication that the library resource had been dropped.
The group already rejects duplicate keys across servers. I expected it to report the same collision when both resources came from one server. I reran the example with a local patch and got INVALID_PARAMS (-32602) for the name Introduction. The client still listed both URIs, and the group remained empty.
Codex helped investigate, wrote the local patch and regression tests, and drafted this report. I ran both versions and checked the output.
Root cause: _aggregate_components keys resources_temp by resource name, so a second resource with the same name from the same server overwrites the first; the duplicate check after it only compares against components already in the group.
A possible fix: detect same-server name collisions while building the temp dicts and raise the same INVALID_PARAMS error used for cross-server duplicates (the group stays unchanged), covering prompts and tools too, with regression tests for each.
This comment was drafted with AI assistance (Claude Code).
Thanks, that matches what I saw. One detail from the patch I tested: it records duplicate names while collecting the components, then raises INVALID_PARAMS after the listing try/except blocks, before updating the group. Those blocks catch MCPError, so raising inside one would turn the collision into a warning and let registration continue.
I’m happy to submit the tested patch if a maintainer would like me to take this on.
Activity
Suman-00X commentedon Dec 5, 2026
Root cause:
_aggregate_componentskeysresources_tempby resource name, so a second resource with the same name from the same server overwrites the first; the duplicate check after it only compares against components already in the group.A possible fix: detect same-server name collisions while building the temp dicts and raise the same
INVALID_PARAMSerror used for cross-server duplicates (the group stays unchanged), covering prompts and tools too, with regression tests for each.This comment was drafted with AI assistance (Claude Code).
saggl commentedon Dec 5, 2026
Thanks, that matches what I saw. One detail from the patch I tested: it records duplicate names while collecting the components, then raises INVALID_PARAMS after the listing try/except blocks, before updating the group. Those blocks catch MCPError, so raising inside one would turn the collision into a warning and let registration continue.
I’m happy to submit the tested patch if a maintainer would like me to take this on.
Codex helped draft this reply.