pci-dss-mcp
pci-dss-mcp
用于 Go 支付服务代码库的静态分析 MCP 服务器。在代码发布前,将 Go 支付服务代码库中检测到的每个 PCI DSS v4.0.1 违规项映射到具体的合规要求编号。
功能概述
pci-dss-mcp 是一个 stdio MCP 服务器,它在 Go 支付服务代码库上运行 12 个扫描器、一个编排器和一个 AI 分诊引擎。每个发现结果都带有映射到特定 PCI DSS v4.0.1 条目的 requirement_id;请参阅 docs/requirement-mapping.md 获取规范的规则到要求对照表,并参阅 testdata/vulnerable-payment-service/EXPECTED-FINDINGS.md 获取实时黄金输出示例。
pci-dss-mcp 目前可捕获的内容
HTTP 框架输入流进入日志 / 错误 / panic 接收器。 一级框架(gin, chi, gorilla/mux, net/http (Go 1.22+), echo v4, fiber v2)和一级日志记录器(log/slog, logrus, zap, zerolog, logr, klog, hclog)已在 v0.7 中发布。二级(kratos, apex/log, charmbracelet/log)将在 v0.8 中发布。三级(fasthttp, beego, iris, httprouter, 项目内部)在发布后可通过 Phase 25 YAML 进行用户配置。请参阅 docs/http_input_taint.md。
pci-dss-mcp 不是什么
不是广泛 SAST 工具的替代品。 请使用 Semgrep、CodeQL 或 gosec 来处理 OWASP Top-10 和语言无关的漏洞。
不是基于 LLM 的代码审查的替代品。 pci-dss-mcp 将支付特定问题映射到 PCI DSS 要求 ID;LLM 代理通过推理捕获广泛的错误。这两个层级是互补的。
不是语言无关的。 Go 特有的 AST 模式和污点流追踪是实现高精度的关键。
不是 QSA 的替代品。 静态分析仅涵盖约 6% 的 PCI DSS v4.0.1 要求。其余部分必须由合格的安全评估员 (QSA) 进行确认。
Related MCP server: secureaudit-mcp
安装
Go 安装(首选)
需要 Go 1.25+:
go install github.com/shyshlakov/pci-dss-mcp@latest二进制文件位于 $(go env GOPATH)/bin/pci-dss-mcp。请参阅 docs/install-from-source.md 获取 PATH 解析、macOS codesign 来源修复、cosign 验证以及 MCP 客户端 JSON 配置。
Docker(替代方案)
docker pull ghcr.io/shyshlakov/pci-dss-mcp:v0.6.2适用于 CI 流水线、不在本地开发 Go 的 QSA 审计员,或任何没有宿主机 Go 工具链的环境。
MCP 注册表
在 registry.modelcontextprotocol.io 上列为 io.github.shyshlakov/pci-dss-mcp。每个标签都会自动发布。
使用方法
添加到您的 MCP 客户端配置中(Claude Desktop 为 claude_desktop_config.json,Cursor 为 .cursor/mcp.json,或 Claude Code 使用 claude mcp add):
{
"mcpServers": {
"pci-dss-mcp": {
"command": "docker",
"args": ["run", "-i", "--rm",
"--mount", "type=bind,src=/Users/you/go/src,dst=/Users/you/go/src,readonly",
"ghcr.io/shyshlakov/pci-dss-mcp:v0.6.2"]
}
}
}src= 和 dst= 镜像相同的绝对路径,以便容器在宿主机使用的相同路径下看到您的代码;提示词传递正常的宿主机路径,无需转换。有关 go install 变体和各客户端示例,请参阅 docs/usage.md。
粘贴到您的 MCP 客户端中的两个提示词:
Run pci-dss-mcp triage on /Users/you/payments-service. Use min_severity=MEDIUM and group findings by PCI DSS requirement.Generate a PCI DSS compliance report for /Users/you/payments-service in JSON format. Show requirement-level pass/fail status and severity counts.
工具
工具 | 用途 | 文档 |
| 所有扫描器 + AI 分类 + 文件:行上下文,一次调用完成 | |
| 原始要求通过/失败报告(所有扫描器的编排器) | |
| PAN/SAD 存储和日志记录 (3.3.1, 3.4.1, 3.5.1) | |
| 弱哈希、硬编码密钥、明文 HTTP (4.2.1, 6.2.4) | |
| 不安全的 TLS 配置 (4.2.1) | |
| 配置文件中的凭据 (8.6.2) | |
| 泄露敏感上下文的错误响应 (6.2.4) | |
| 硬编码密码、弱策略、缺少 MFA、Webhook 签名 (8.3.1, 8.3.6, 8.4.2, 8.6.2) | |
| 支付流程中缺失的审计日志 (10.2.1) | |
| 缺少 TTL、敏感存储、缺少清零 (3.2.1, 3.3.1) | |
| 支付页面缺少 CSP/SRI/nonce (6.4.3, 11.6.1) | |
| 通过 OSV (6.3.3) 查找易受攻击的 Go 依赖项;govulncheck 风格的隐私保护:不会向 OSV.dev 发送模块名称。请参阅 docs/check_dependencies.md。还涵盖 | |
| 从 go.mod/go.sum 生成 CycloneDX 1.6 SBOM (6.3.2) | |
| 按 ID 查询 PCI DSS v4.0.1 要求 |
所有工具都声明了类型化的 OutputSchema。请参阅 docs/tools.md 获取目录索引和迁移历史。
文档
docs/usage.md,客户端设置、提示词模板、抑制发现结果
docs/severity.md,严重性模型和规则到严重性的映射
docs/taint.md,污点分析默认设置和开关
docs/scoping.md,包排除和 CDE 范围
docs/comparison.md,pci-dss-mcp 与 Semgrep / CodeQL / gosec / Snyk Code 的对比
docs/ci-cd.md,GitHub Actions 和 GitLab CI 集成
docs/pci-coverage.md,PCI DSS v4.0.1 要求覆盖矩阵
docs/install-from-source.md,源码构建、cosign 验证、重载
docs/requirement-mapping.md,规范的 rule_id 到 requirement_id 对照表
CONTRIBUTING.md,开发设置、模糊测试目标
ROADMAP.md,计划功能
CHANGELOG.md,版本历史
状态
活跃开发中,v1.0 之前版本。请参阅 ROADMAP.md 和 CHANGELOG.md。
许可证
MIT,请参阅 LICENSE。
pci-dss-mcp 是一款静态分析工具。它不能替代合格的安全评估员 (QSA)。请将其输出作为合规流程的输入,而非合规本身。
Available Tools
15 toolsaudit_log_coverageA
Scan Go source files for payment handlers missing structured audit logging (PCI DSS 10.2.1). Detects: missing logging, unstructured-only logging (fmt/log), and reports handlers with structured logging. Framework-aware: supports net/http, gin, echo handler signatures. Default: returns response_shape "summary" with by_severity counts, a capped by_rule histogram (top 10 + more_rules), and top 3 per severity findings - plus a pagination.next_cursor for drill-down. Prefer this for mixed queries; min_severity / rule_filter drop to response_shape "flat" but still carry summary.by_severity + summary.by_rule for full-scan context. Follow the cursor for the full paginated list. Use include_tests / exclude_patterns / min_severity / rule_filter for a filtered flat response.
Inputs: path (required), exclude_patterns, include_tests, include_untracked, +4 more. Returns: object
check_auth_strengthA
Scan Go source files for weak authentication: hardcoded passwords (PCI DSS 8.3.1), password policy with minimum length below 12 (PCI DSS 8.3.6), and payment routes missing MFA middleware (PCI DSS 8.4.2). Default: returns response_shape "summary" with by_severity counts, a capped by_rule histogram (top 10 + more_rules), and top 3 per severity findings - plus a pagination.next_cursor for drill-down. Prefer this for mixed queries; min_severity / rule_filter drop to response_shape "flat" but still carry summary.by_severity + summary.by_rule for full-scan context. Follow the cursor for the full paginated list. Use include_tests / exclude_patterns / min_severity / rule_filter for a filtered flat response. Maps findings to PCI DSS 8.3.1, 8.3.6, 8.4.2.
Inputs: path (required), exclude_patterns, include_tests, include_untracked, +4 more. Returns: object
check_data_retentionA
Scan Go source and config files for unsafe data retention: Redis/DB storage of CVV/PAN without TTL (PCI DSS 3.2.1), config files missing TTL on sensitive keys (PCI DSS 3.3.1), and incorrect memory zeroing timing after authorization. Scans .go, .yaml, .json, .toml files. Default: returns response_shape "summary" with by_severity counts, a capped by_rule histogram (top 10 + more_rules), and top 3 per severity findings - plus a pagination.next_cursor for drill-down. Prefer this for mixed queries; min_severity / rule_filter drop to response_shape "flat" but still carry summary.by_severity + summary.by_rule for full-scan context. Follow the cursor for the full paginated list. Use include_tests / exclude_patterns / min_severity / rule_filter for a filtered flat response. Maps findings to PCI DSS 3.2.1, 3.3.1.
Inputs: path (required), exclude_patterns, include_tests, include_untracked, +4 more. Returns: object
check_dependenciesA
Scan go.mod dependencies for known vulnerabilities (PCI DSS 6.3.3). Bulk-downloads the public OSV Go vulnerability snapshot and intersects locally against go.mod, matching the govulncheck privacy model. No module names are sent to OSV.dev. Cache TTL: 24h fresh, 24h-7d revalidate via ETag, >7d force-refresh. Run update_vulnerability_db first to bootstrap the cache for air-gapped environments. Default: returns response_shape "summary" with by_severity counts, a capped by_rule histogram (top 10 + more_rules), and top 1 per severity findings - plus a pagination.next_cursor for drill-down. Prefer this for mixed queries; min_severity / rule_filter drop to response_shape "flat" but still carry summary.by_severity + summary.by_rule for full-scan context. Follow the cursor for the full paginated list. Use min_severity / rule_filter / positive limit for a filtered flat response. Maps findings to PCI DSS 6.3.3.
Inputs: path (required), mode, cursor, limit, +2 more. Returns: object
check_encryptionA
Scan Go source files for encryption violations: weak hash algorithms (md5/sha1) with context scoring, hardcoded encryption keys/IVs, and plain HTTP URLs. Default: returns response_shape "summary" with by_severity counts, a capped by_rule histogram (top 10 + more_rules), and top 3 per severity findings - plus a pagination.next_cursor for drill-down. Prefer this for mixed queries; min_severity / rule_filter drop to response_shape "flat" but still carry summary.by_severity + summary.by_rule for full-scan context. Follow the cursor for the full paginated list. Use include_tests / exclude_patterns / min_severity / rule_filter for a filtered flat response. Maps findings to PCI DSS 6.2.4, 4.2.1.
Inputs: path (required), exclude_patterns, include_tests, include_untracked, +4 more. Returns: object
check_error_handlingA
Scan Go source files for payment handler error disclosure: detects err.Error() in http.Error, fmt.Fprintf with error variables, w.Write with error bytes, and json.Encode of errors. Default: returns response_shape "summary" with by_severity counts, a capped by_rule histogram (top 10 + more_rules), and top 3 per severity findings - plus a pagination.next_cursor for drill-down. Prefer this for mixed queries; min_severity / rule_filter drop to response_shape "flat" but still carry summary.by_severity + summary.by_rule for full-scan context. Follow the cursor for the full paginated list. Use include_tests / exclude_patterns / min_severity / rule_filter for a filtered flat response. Maps findings to PCI DSS 6.2.4.
Inputs: path (required), exclude_patterns, include_tests, include_untracked, +4 more. Returns: object
check_payment_page_scriptsA
Scan Go source files and HTML templates for payment page script security violations (PCI DSS 6.4.3, 11.6.1). Detects: missing Content-Security-Policy headers in Go payment handlers, unsafe-inline/unsafe-eval in CSP, external scripts without SRI (integrity attribute) in HTML templates, inline scripts without nonce attribute. Framework-aware: supports net/http, gin, echo handler signatures. Default: returns response_shape "summary" with by_severity counts, a capped by_rule histogram (top 10 + more_rules), and top 3 per severity findings - plus a pagination.next_cursor for drill-down. Prefer this for mixed queries; min_severity / rule_filter drop to response_shape "flat" but still carry summary.by_severity + summary.by_rule for full-scan context. Follow the cursor for the full paginated list. Use include_tests / exclude_patterns / min_severity / rule_filter for a filtered flat response. Maps findings to PCI DSS 6.4.3, 11.6.1.
Inputs: path (required), exclude_patterns, include_tests, include_untracked, +4 more. Returns: object
check_secrets_in_configsA
Scan configuration files (.env, .yaml, .json, .toml) for hardcoded secrets: API keys, passwords, tokens, and connection strings with embedded credentials. Default: returns response_shape "summary" with by_severity counts, a capped by_rule histogram (top 10 + more_rules), and top 3 per severity findings - plus a pagination.next_cursor for drill-down. Prefer this for mixed queries; min_severity / rule_filter drop to response_shape "flat" but still carry summary.by_severity + summary.by_rule for full-scan context. Follow the cursor for the full paginated list. Use include_tests / exclude_patterns / min_severity / rule_filter for a filtered flat response. Maps findings to PCI DSS 8.6.2.
Inputs: path (required), exclude_patterns, include_tests, include_untracked, +4 more. Returns: object
check_tls_configA
Scan Go source files for TLS configuration violations: InsecureSkipVerify, weak MinVersion (below TLS 1.2), missing MinVersion, and prohibited cipher suites (RC4, 3DES, NULL). Default: returns response_shape "summary" with by_severity counts, a capped by_rule histogram (top 10 + more_rules), and top 3 per severity findings - plus a pagination.next_cursor for drill-down. Prefer this for mixed queries; min_severity / rule_filter drop to response_shape "flat" but still carry summary.by_severity + summary.by_rule for full-scan context. Follow the cursor for the full paginated list. Use include_tests / exclude_patterns / min_severity / rule_filter for a filtered flat response. Maps findings to PCI DSS 4.2.1.
Inputs: path (required), exclude_patterns, include_tests, include_untracked, +4 more. Returns: object
explain_requirementA
Look up a PCI DSS v4.0.1 requirement by ID. Returns title, description, and testing procedure.
Inputs: requirement_id (required). Returns: requirement
generate_compliance_reportA
Raw PCI DSS v4.0.1 compliance report without AI triage — intended for CI gates, audit artifacts, and requirement-level pass/fail lists. For interactive "scan this project" prompts call triage_findings instead. Default unfiltered call returns a compact summary (metadata, totals, requirement_statuses, top 20 findings per severity, cursor for follow-up). Supply min_severity / rule_filter / limit to get a paged flat list (60 per page with cursor), or cursor= to resume a prior session (10-minute TTL). min_severity / rule_filter drop the response to shape "flat" but still carry summary.by_severity + summary.by_rule for full-scan context. Taint analysis is ON by default; set include_taint=false for fast dev iteration.
Inputs: path (required), dep_scan_mode, include_tests, include_taint, +4 more. Returns: object
generate_sbomA
Generate a CycloneDX v1.6 SBOM for a Go project. Default behavior: writes sbom.json (or sbom.xml when format=xml) next to the scanned go.mod and returns metadata only (output_path, size_bytes, component_count, unknown_licenses). Override the destination with output_path (must be absolute). Pass inline=true to return the serialized SBOM in the MCP response instead (capped at 64 KB; returns SBOM_TOO_LARGE above that). Parses go.mod + go.sum offline against the local GOMODCACHE; cache-miss modules surface as UNKNOWN-LICENSE. Satisfies PCI DSS 6.3.2 (software inventory, mandatory since March 2025).
Inputs: path (required), format, output_path, inline, +2 more. Returns: mode, bom_format, spec_version, component_count, +9 more
scan_pan_dataA
Default: returns response_shape "summary" with by_severity counts, a capped by_rule histogram (top 10 + more_rules), and top 3 per severity findings - plus a pagination.next_cursor for drill-down. Prefer this for mixed queries; min_severity / rule_filter drop to response_shape "flat" but still carry summary.by_severity + summary.by_rule for full-scan context. Follow the cursor for the full paginated list. Use include_tests / exclude_patterns for a filtered flat response. Maps findings to PCI DSS 3.3.1, 3.4.1, 3.5.1.
Inputs: path (required), exclude_patterns, include_tests, include_untracked, +5 more. Returns: object
triage_findingsA
Run all PCI DSS v4.0.1 scanners + AI-assisted prioritization + file:line enrichment on a Go project in a single call. Default: response_shape "summary" with by_severity counts, a capped by_rule histogram (top 10 + more_rules), and top 1 per severity enriched finding, plus pagination.next_cursor for drill-down. min_severity / rule_filter drop the response to shape "flat" but still carry summary.by_severity + summary.by_rule for full-scan context. Follow the cursor for the full paginated list.
Inputs: path (required), dep_scan_mode, include_tests, include_taint, +4 more. Returns: object
update_vulnerability_dbA
Download fresh OSV Go vulnerability snapshot to local cache for offline scanning. Downloads from gs://osv-vulnerabilities/Go/all.zip (~7.5MB). This is the ONLY tool that makes network requests. Cache stored at PCI_MCP_CACHE_DIR or ~/.pci-dss-mcp/vuln-cache/ by default.
Inputs: output_path. Returns: cache_path, vuln_count, download_size_bytes, previous_cache_date, +1 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Each tool targets a distinct security check or utility: audit log coverage, authentication strength, data retention, dependencies, encryption, error handling, payment page scripts, secrets, TLS, requirement lookup, compliance report, SBOM, PAN data scan, triage, and vulnerability DB update. No two tools have overlapping purposes.
Tool names follow a clear verb_noun pattern (e.g., check_*, generate_*, explain_*, update_*, scan_*, triage_). All use consistent snake_case, and the verb clearly indicates the action. The slight deviation of 'audit_log_coverage' is minor and still descriptive.
15 tools is well-scoped for a PCI DSS compliance server. It covers a wide range of checks (authentication, encryption, secrets, etc.) plus utilities (SBOM, report, requirement lookup), without being excessive or too few.
The tool set comprehensively covers PCI DSS requirements relevant to Go source code and configuration, including authentication (8.3), data retention (3.2, 3.3), encryption (4.2, 6.2), error handling (6.2), TLS (4.2), secrets (8.6), dependencies (6.3), and software inventory (6.3). The triage and report tools tie everything together.
Maintenance
Related MCP Connectors
Zero-config MCP security scanner for AI-generated apps. 25K+ vulnerability patterns.
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
IaC, CI and dependency security review for coding agents: local scan CLI plus hosted OAuth MCP.
Static MCP server scan: injection, secrets, tool poisoning. SARIF + rules catalog.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceGo-based SBOM, vulnerability, and secret scanner with MCP support.3Apache 2.0
- AlicenseAqualityCmaintenanceAn AppSec-focused MCP server that performs static analysis scans on C/C++ source code for memory-safety vulnerabilities and parses compiled PE/ELF binary headers locally to audit active defensive compiler mitigations (ASLR, DEP/NX, PIE).41MIT
- AlicenseAqualityDmaintenanceAgent-native "safe to ship?" security gate for AI-generated code. Uses real parsers and inter-rocedural taint analysis (JS/TS, Python, Go) to flag the classes AI coding agents get wrong — secrets, SQL injection, SS, SSRF, path traversal, command injection, weak JWT/CORS — and ranks findings by confidence. Exposes a scan tool over MCP.18 npm2MIT
- AlicenseAqualityDmaintenanceA production-grade security auditing MCP server that wraps semgrep (SAST) and gitleaks (secret detection) to enable one-click code security scanning via MCP stdio protocol.1MIT