feat(mcp): supply-chain audit declarations for MCP servers - #220
Open
raymondginger2018-sudo wants to merge 1 commit into
Open
feat(mcp): supply-chain audit declarations for MCP servers#220raymondginger2018-sudo wants to merge 1 commit into
raymondginger2018-sudo wants to merge 1 commit into
Conversation
Contributor
Author
设计说明问题:MCP server 是从外部拉取的代码,运行在 agent 内部,可能有供应链风险(恶意或过时依赖、可疑的权限请求)。目前没有统一的审计声明格式。 解法: 关键设计决策:
注意:本文件引用了 测试建议:构造一份含高危来源的 MCP 计划,验证审计报告正确标记 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Third-party components (Python modules, external datasets — and for a harness, remote MCP servers) can be compromised. This PR renders a declaration audit for a resolved MCP plan: for every server, what is being introduced (transport, source, command/URL), what capabilities it declares (tool count + names), and what policy constrains it.
Output designed for
(a) Human review before first use of a server
(b) Regression diff when a config changes — a newly appearing server/tool in the diff is a supply-chain event worth noticing
(c) Feeding the allowlist decision for MCP server approval
API
ServerAuditEntrydataclass — one server's supply-chain declarationaudit_mcp_plan(plan) -> MCPAuditReport— full report with diff supportFile
core/mcp/audit.py(new, 177 lines)Part of GenAI lesson 13 supply-chain security family.