Optional integrity pinning for MCP server metadata
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 20/100
Direção de pesquisa
This is a design proposal, not a scoped task: the thread asks the maintainers whether the Python SDK should carry metadata pinning at all, and the author already has a working implementation, so nothing should be started before a maintainer answers. To follow the discussion, read the Client entry point in src/mcp/client and note where list_tools results are received, since the fingerprint would have to be computed there and compared against stored state. Done means an agreed design (SDK-level option vs. protocol change) with a maintainer, not a patch from a newcomer.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Description
Hi!
I'd like to propose an optional mechanism for detecting unexpected changes to an MCP server's advertised metadata across connections. This is applicable in cases where the MCP server gets compromised and is used to attack the user e.g., phish and then exfiltrate sensitive data. Happy to provide an example attack chain that I have working.
It works as follows:
- On the first connection, the client fingerprints and pin the server's advertised metadata, including tools, descriptions etc.
- On subsequent connections, unexpected changes cause the client to fail closed until the new fingerprint is explicitly accepted by the user/agent owner.
This follows the established trust-on-first-use pattern. It's commonly used in SSH host-key checking, where the host key is trusted on first connection, and subsequent connections verify that it has not unexpectedly changed. If it does change, a configured policy determines how to proceed. The same principle can be applied to the interface advertised by an MCP server.
This does not establish that the server is trustworthy on first connection, but it's a reasonable assumption to make as a user (eg as per ssh host-key checking). This mechanism provides continuity of trust by making later changes to the previously accepted interface detectable.
Would this be something the Python SDK would be interested in supporting?
I'm happy to contribute a PR as I have it already working.
If this is better addressed at the protocol or SDK-wide level, I'm also happy to move the discussion there.
Example
Standard client:
from mcp import Client
async with Client("https://<mcp-server>/mcp") as client:
tools = await client.list_tools()
With integrity pinning:
(The only change is metadata_integrity="enforce")
from mcp import Client
async with Client( "https://<mcp-server>/mcp", metadata_integrity="enforce",) as client:
tools = await client.list_tools()
References
No response
- 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