Optional integrity pinning for MCP server metadata
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 20/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 25k
- Fork
- 4.2k
- Merge trung bình
- 10 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/python-sdk
-
v2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
modelcontextprotocol/python-sdk#3978 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Client serves cached tools after its context exits with an exceptionCó thể đã có người làm @jonxsong đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
modelcontextprotocol/python-sdk#3968 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
modelcontextprotocol/python-sdk#3957 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
v2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
modelcontextprotocol/python-sdk#3934 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug v1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
modelcontextprotocol/python-sdk#3929 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của modelcontextprotocol/python-sdk
Issue tương tự
-
soup prune-prompt exits 1 after writing its output on a file over 100,000 rows, and reports a capped row count otherwiseCó thể đã có người làm @abdulwaarith0 đã nhận hôm nay. Đang mởneeds-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
MakazhanAlpamys/Soup#3690 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bug data-types native-format
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
ClickHouse/clickhouse-connect#1320 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Public benchmark import end-to-end test fails when the test stack's worker runs the parity jobĐang mởaccepted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
future-agi/future-agi#6392 ·
Maintainer thường phản hồi trong vòng 1 ngày