跳到正文
Skillpedia
智能体40k · #7282

mcp-implementation-security-review

它能做什么

这个工具用于检查采用 MCP 协议的服务器和客户端的安全代码。它会查找常见的安全问题,例如身份验证薄弱、数据验证失败,以及可能允许恶意代码执行的漏洞。

适用场景

  • ✓在发布 MCP 服务器之前。
  • ✓在审查 MCP 客户端的安全性时。
  • ✓当你需要确保代码符合安全最佳实践时。

技能链接

https://github.com/github/awesome-copilot/blob/main/skills/mcp-implementation-security-review/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/github/awesome-copilot/blob/main/skills/mcp-implementation-security-review/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“审查一下这个 MCP 服务器代码的安全性。”

每周 5 个新技能,1 分钟读完。

工作原理

工具会将代码与一系列安全检查项进行比对,分析代码,找出存在问题的位置,并生成包含详细信息的报告。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

MCP Implementation Security Review

Process

Step 1 — Classify the target

  • Check MCP protocol version 2025-03-26 or later (current: 2025-11-25). Flag older versions as a finding but continue the review.
  • Determine whether the target is a server or client.
  • Classify transport as network-exposed or local-only using the transport reference below.
  • Record transport, protocol version, and whether sessions exist.

Completion criterion: Target type, protocol status, and transport are identified.

Step 2 — Filter false positives

  • Apply the False Positive Filters before opening findings.
  • Keep docs only when they describe the repo's own server behavior, deployment, transport, or auth posture.
  • For framework/SDK repositories, scope findings to the default configuration and public API surface.

Completion criterion: Remaining evidence is in-scope code, repo-owned docs, or public API behavior.

Step 3 — Check baseline controls

  • For network-exposed servers, check MCP-01 through MCP-05.
  • For local/STDIO servers, do not mark baseline controls PASS/FAIL; give best-practice notes and continue to RCE review.
  • For clients, only review token/session handling explicitly visible in client code; do not apply the server baseline unless the user asks for client-side risk review.

Completion criterion: Each applicable control has a supported status.

Step 4 — Check RCE vectors

  • Review all 7 RCE vectors.
  • Mark each vector SAFE, AT RISK, or N/A.
  • Prefer direct evidence over inference; the RCE Vectors table below enumerates the patterns to look for.

Completion criterion: Every relevant tool has an RCE result or explicit N/A.

Step 5 — Check OWASP MCP Top 10

  • Evaluate all 10 OWASP risks below.
  • If a control from Step 3 already fully covers an OWASP risk, reference that result rather than re-checking.
  • For local/STDIO servers, mark network-dependent OWASP risks (MCP07, MCP09) as N/A.
  • Mark each risk PASS, FAIL, or NEEDS INVESTIGATION.

Completion criterion: All 10 OWASP risks have outcomes supported by observable evidence or referenced from Step 3.

Step 6 — Report

  • Use the Compliance Output Format below.
  • Include file/line references in every justification.
  • Separate code findings from manual follow-ups.
  • If evidence is incomplete, use NEEDS INVESTIGATION and name the missing artifact.

Completion criterion: The report includes controls, RCE, optional OWASP, and actions.

Reference

Decision rules

  • Network-exposed server: Apply all 5 controls, then run RCE and requested OWASP checks.
  • Local/STDIO server: Give best-practice guidance only for the 5 controls; still run RCE because tool input can execute locally.
  • Client: Review received-token handling and refusal to trust server-provided session IDs; do not force server controls unless asked.
  • Reverse proxy or container exposure: If traffic can reach the server over a network, treat it as network-exposed even if inner binding is localhost.
  • Unclear evidence: Do not guess. Mark NEEDS INVESTIGATION and say what must be verified manually.
  • Ambiguous auth coverage: Auth middleware exists but it is unclear whether it covers MCP endpoints → mark NEEDS INVESTIGATION.
  • Undeterminable transport: If transport cannot be established from code, flag for manual review and do not assume STDIO — defaulting to STDIO would wrongly skip the server controls.

Transport classification

Network-exposed (enforce all controls):

Pattern Transport
transport="http" or transport="sse" HTTP/SSE
StreamableHttpServerTransport HTTP (TS/JS)
SSEServerTransport SSE (TS/JS)
WithHttpTransport() HTTP (C#)
host="0.0.0.0" All-interfaces binding
Express .listen(port) with MCP routes HTTP (default 0.0.0.0)
EXPOSE in Dockerfile + MCP server Network-exposed

Local-only (best practices only):

Pattern Transport
StdioServerTransport STDIO (TS/JS)
WithStdioServerTransport() STDIO (C#)
transport="stdio" STDIO
mcp.run() with no args (Python FastMCP) STDIO default
.vscode/mcp.json with command key and no URL STDIO child process

Host binding gotchas:

…

常见问题

什么是 MCP?

MCP(Model Context Protocol,模型上下文协议)是一种用于系统不同部分之间通信的协议,在 AI 应用中尤为常见。

什么是“RCE 漏洞”?

RCE 是 Remote Code Execution(远程代码执行)的缩写。这类安全缺陷可能让攻击者在你的服务器上运行命令。

什么是“OWASP MCP Top 10”?

它是一份针对 MCP 协议的十大安全威胁清单,基于 OWASP 中广为人知的漏洞列表编制而成。

详情

作者的原始描述

Review the implementation source code of MCP (Model Context Protocol) servers, clients, and tool handlers against a security baseline — authentication, sessions, rate limiting, input-schema validation, official-SDK usage, RCE vectors, and the OWASP MCP Top 10 — producing a report with file/line evidence. Use this skill when: - Reviewing an MCP server implementation for security before release - Ch

repo: github/awesome-copilot

热度

GitHub 星标
40k
排名
#7282
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能