TM

traceforce/mcp-xray

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

92 stars 23 forks 质量 75 趋势 14Apache-2.0

traceforce/MCP-xray 是从 https://github.com/traceforce/mcp-xray. 导入的 MCP 服务器候选对象。

概览

traceforce/MCP-xray 是从 https://github.com/traceforce/mcp-xray. 导入的 MCP 服务器候选对象。

概述(AI 翻译)

[!注] 想获得AI代理技能? 可以试试Skill X-Ray,这是一款开源静态安全扫描器,可在安装前分析技能包是否有恶意或风险行为,无需执行。

概述

MCP X-Ray 是一款统一的开源安全扫描和渗透测试解决方案,适用于模型上下文协议(MCP)服务器。它生成生产准备的 SARIF 报告,实现与安全工具和 CI/CD 流水线无缝集成。扫描结果可选择性上传至 Traceforce Atlas,以便集中管理和跟踪安全。Atlas 注册表中拥有 600 多个 MCP,为 MCP 生态系统提供全面的安全评估数据库。

安装

先决条件

  • 选择1.25.4或更高版本

从源头构建

用途

配置扫描

扫描MCP配置以防安全问题;在渗透测试前先运行,以确定你的设置基线。

检测能力:

  • 连接安全:验证TLS证书,检测不安全的本地主机/回环暴露,并验证OAuth 2.0配置(PRM/ASMD)
  • 秘密检测:扫描暴露的凭证、API密钥和敏感信息

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

MCP X-Ray

[!NOTE] Looking to secure AI agent skills? Check out Skill X-Ray, an open-source static security scanner that analyzes skill packages for malicious or risky behavior before installation, without executing them.

Overview

MCP X-Ray is a unified open-source security scanning and penetration testing solution for Model Context Protocol (MCP) servers. It generates production-ready SARIF reports for seamless integration with security tooling and CI/CD pipelines. Scan results can be optionally uploaded to Traceforce Atlas for centralized security management and tracking. Atlas has over 600 MCPs in its registry, providing a comprehensive security assessment database for the MCP ecosystem.

Installation

Prerequisites

Build from Source

# Clone the repository
git clone https://github.com/traceforce/mcp-xray
cd mcp-xray

# Install required dependencies (buf, etc.)
make install-dependencies

# Build everything (generates protobuf code and builds the binary)
# The binary will be created as `mcpxray` in the current directory
make all

Usage

Configuration Scan

Scan MCP configs for security issues; run before pentest to baseline your setup.

# Scan a specific MCP config file (uses token analyzer by default)
./mcpxray config-scan /path/to/mcp/config.json

# Scan all known MCP config paths automatically for Cursor, Claude and Windsurf.
# Known config locations (relative to home directory):
#   ~/.cursor/mcp.json (Cursor)
#   ~/Library/Application Support/Claude/claude_desktop_config.json (Claude Desktop)
#   ~/.codeium/windsurf/mcp_config.json (Windsurf)
./mcpxray config-scan --scan-known-configs

# Use LLM analyzer for more extensive and deepr analysis
./mcpxray config-scan /path/to/mcp/config.json --analyzer-type llm --llm-model claude-3-5-sonnet-20241022

# Specify custom output file
./mcpxray config-scan /path/to/mcp/config.json --output custom-report.sarif.json

Detection Capabilities:

  • Connection Security: Validates TLS certificates, detects unsafe localhost/loopback exposure, and validates OAuth 2.0 configuration (PRM/ASMD)
  • Secrets Detection: Scans for exposed credentials, API keys, and sensitive information
  • Tool Analysis: Analyzes tool descriptions using Token Analyzer (default) or LLM Analyzer for risks including arbitrary execution, injection vulnerabilities, authorization bypass, and information disclosure

Pentest

Execute security test plans by making actual tool calls against MCP servers. LLMs are required to run the pentest. Run this before actual deployment in production.

# Run pentest with auto-generated test plan (requires LLM model)
./mcpxray pentest /path/to/mcp/config.json --llm-model claude-sonnet-4-5

# Use a custom test plan YAML file
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →