ClientSessionGroup silently drops resources with the same name and different URIs
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 45/100
Direção de pesquisa
Start by locating ClientSessionGroup and how it registers resources, then read the existing duplicate-key handling for resources from different servers. Reproduce the report with two resources named Introduction at different URIs and check the group contents and error behavior. Done means registration reports the collision and does not silently drop either resource.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Initial Checks
- I confirm that I'm using the newest release of my line (the latest 2.x, or the latest 1.x if I'm still on v1)
- I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue
Release line
2.x (current stable)
Description
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.
Example Code
import anyio
from mcp import Client, ClientSessionGroup, MCPError
from mcp.server import MCPServer
server = MCPServer("Guides")
@server.resource("docs://library/intro", name="Introduction")
def library_intro() -> str:
return "Library guide"
@server.resource("docs://archive/intro", name="Introduction")
def archive_intro() -> str:
return "Archive guide"
async def main() -> None:
async with Client(server) as client:
resources = (await client.list_resources()).resources
print("Client listed:", sorted((r.name, str(r.uri)) for r in resources))
assert client.server_info is not None
group = ClientSessionGroup()
try:
await group.connect_with_session(client.server_info, client.session)
except MCPError as error:
print("Group rejected registration:", error.error.code, error)
print("Group resources:", {key: str(r.uri) for key, r in group.resources.items()})
anyio.run(main)
Python & MCP Python SDK
Python 3.14.4, mcp 2.3.0. Also reproduced on main at 77001c96.
- Linguagem predominante
- Python
- Estrelas
- 25k
- Forks
- 4.2k
- Merge médio
- 10min
- PRs com merge (30d)
- 1
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de modelcontextprotocol/python-sdk
-
v2
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 86/100
modelcontextprotocol/python-sdk#3978 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Client serves cached tools after its context exits with an exceptionTalvez já em andamento @jonxsong assumiu há 1 dia. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
modelcontextprotocol/python-sdk#3968 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
modelcontextprotocol/python-sdk#3957 ·
Mantenedores costumam responder em até 1 dia
-
v2
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 91/100
modelcontextprotocol/python-sdk#3934 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
bug v1
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
modelcontextprotocol/python-sdk#3929 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de modelcontextprotocol/python-sdk
Issues semelhantes
-
auto-reported bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
Mantenedores costumam responder em até 1 dia
-
stix-atlas.json: the same relationship id is used for several different mitigates relationshipsAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
-
backend bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
nolte/kamerplanter#3193 ·
Mantenedores costumam responder em até 1 dia
-
soup prune-prompt exits 1 after writing its output on a file over 100,000 rows, and reports a capped row count otherwiseTalvez já em andamento @abdulwaarith0 assumiu hoje. Abertaneeds-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
MakazhanAlpamys/Soup#3690 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia