pci-dss-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mcp-server-pci-dss-compliance-assistant
An independent, community-maintained open-source MCP server that helps developers check code and configuration for PCI DSS v4.0.1 readiness, and query a PCI DSS knowledge base that you build locally from your own copy of the standard.

⚠️ Disclaimer & Legal Notice
Experimental Release: This tool is currently released as an experimental, community-maintained open-source project. It is provided "as-is" without warranties of any kind and is under active development.
Basis of Implementation: The parsing logic, rule mappings, and helper tools in this repository are structured around the PCI DSS v4.0.1 standard documents. However, this repository does not redistribute any copyrighted PCI SSC documents; users must obtain official files directly from the PCI Security Standards Council.
No Official Affiliation: PCI DSS and PCI Security Standards Council are registered trademarks of PCI Security Standards Council, LLC. This project is an independent developer utility and is not affiliated with, endorsed, sponsored, or certified by PCI SSC.
Not a Formal Assessment: This tool is intended solely to assist developers and security teams with technical readiness and code/configuration hygiene. It does not constitute legal/compliance advice and does not replace a formal assessment by a Qualified Security Assessor (QSA) or official SAQ/ROC validation.
What it does
Look up the standard: fetch any of the 249 Requirement 1-12 controls, search them in plain language, group testing procedures for audit prep, list periodic tasks and the controls that became mandatory on 31 March 2025, and build SAQ checklists.
Check your code and config: flag PANs, card-number variables written to logs, CVV/PIN/track data handling, weak crypto, hardcoded secrets and SQL built from strings in source code; root/privileged containers, exposed ports, weak TLS, public or unencrypted storage and disabled audit logging in Dockerfile, docker-compose, Kubernetes, nginx and Terraform (AWS resources); and missing SRI or weak CSP on payment pages (6.4.3 / 11.6.1).
Audit a whole project:
audit_directorywalks a local folder read-only, sends each file to the right scanner and returns one gap analysis grouped by severity and PCI DSS requirement.
Related MCP server: Security Context MCP Server
Architecture
flowchart LR
subgraph build["Build once, on your machine"]
pdf["PCI DSS v4.0.1 PDF<br/>data/raw/"] --> extract["extract_pci.py"] --> enrich["enrich_pci.py"] --> validate["validate_dataset.py"]
xlsx["Prioritized Approach .xlsx"] -. cross-check .-> enrich
validate --> dataset[("pci_dss_v4_0_1.json")]
dataset --> embed["build_embeddings.py<br/>(optional)"] --> vectors[("embeddings.npy<br/>+ local model")]
end
subgraph server["pci-dss-mcp server: read-only, offline"]
tools["server.py<br/>11 tools, 2 resources, 2 prompts"]
loader["data_loader.py"] --> search["search_engine.py<br/>BM25 + embeddings, RRF"]
tools --> loader
tools --> scanners["scanners/<br/>code, infra, payment page,<br/>repository"]
tools --> security["security.py<br/>input caps, masking,<br/>untrusted tags, audit log"]
end
dataset --> loader
vectors --> search
client["MCP client"] <-- "stdio" --> toolsNothing from the standard is committed to this repository. The PDF, the dataset, the embeddings and the model live under data/, which .gitignore keeps local.
Quickstart
You need git and uv. uv installs Python 3.11+ for you if needed. Run every command from the repository folder, in this order:
# 1. Get the code and install dependencies
git clone https://github.com/itssaeedyari/mcp-server-pci-dss-compliance-assistant.git
cd mcp-server-pci-dss-compliance-assistant
uv sync --all-extras
# 2. Check the setup. Until step 3 it warns that the PDF is missing; that is expected.
uv run python scripts/preflight_check.py
# 3. Download PCI-DSS-v4_0_1.pdf from the PCI SSC Document Library into data/raw/
# (see data/raw/README.md; the Prioritized Approach workbook is optional), then check again:
uv run python scripts/preflight_check.py
# 4. Build your local dataset (about 20 seconds)
uv run python scripts/extract_pci.py # parse the Requirement 1-12 tables from the PDF
uv run python scripts/enrich_pci.py # add metadata, cross-check the workbook, write data/processed/extraction_report.md
uv run python scripts/validate_dataset.py # check the result against data/processed/schema.json
# 5. Optional, for semantic search: downloads a ~90 MB model once (about 30 seconds)
uv run python scripts/build_embeddings.py
# 6. Start the server
uv run pci-dss-mcpThe server speaks MCP over stdin/stdout, so in a terminal it just waits for a client (press Ctrl+C to stop). To try it by hand, use the MCP Inspector. Rerun steps 4 and 5 whenever you replace the PDF.
Connect a client
Copy one of the ready-made configs from examples/ and replace /ABSOLUTE/PATH/TO/mcp-server-pci-dss-compliance-assistant with the folder you cloned into.
Client | Example | Where it goes |
Claude Desktop | Settings > Developer > Edit Config | |
Cursor |
| |
VS Code |
| |
Any client, via Docker | Your client's MCP config; see Run with Docker |
Desktop apps may not see your shell's
PATH. If the server does not start, replace"uv"with the full path fromwhich uv(where uvon Windows).On Windows, write paths with forward slashes or escaped backslashes, e.g.
"C:/Users/you/mcp-server-pci-dss-compliance-assistant".
You don't need to name the tools. Ask normally, for example "Is this Dockerfile OK for our payment service?" or "How must we store card numbers?", and the assistant picks the right tools from their descriptions. If it answers from memory instead, add this once as a standing instruction (Cursor: Settings → Rules → User Rules; Claude Desktop: your profile's personal preferences or a Project's instructions):
For questions about PCI DSS, payment card data, SAQs, or reviews of payment-related code and configuration, use the pci-dss MCP tools and cite the requirement IDs they return.
Run with Docker
The image contains only the code: no PCI SSC documents, dataset or embedding model. Complete Quickstart steps 1-5 first, then build the image and mount your data read-only, along with any project you want audit_directory to scan. From the repository folder:
docker build -t pci-dss-mcp .
docker run -i --rm --network none --read-only --tmpfs /tmp --cap-drop ALL --security-opt no-new-privileges \
-v "$PWD/data/processed:/app/data/processed:ro" \
-v /path/to/your/project:/workspace:ro \
pci-dss-mcpThen ask for audit_directory on /workspace. The container runs as the non-root appuser and works with --network none: search loads the embedding model from the mounted folder. For an MCP client, use examples/docker_mcp.json and replace both placeholder paths.
Configuration
Variable | Default | Purpose |
|
| Dataset file to load (CI uses |
| off | Set to |
Troubleshooting
Symptom | Fix |
| Run Quickstart step 4, or point |
Preflight fails the | Clone with git: a ZIP download has no git metadata. |
| The file must be named exactly |
Search results show | Run |
The client says the server failed to start | Use the full path to |
Docker: | Mount your |
| Check the path. In Docker, pass the container path ( |
| Point it at a project folder. Exact system paths ( |
| Raise |
Tools
Lookup tools read the local dataset. Text such as requirement wording comes from your copy of the standard and is shown below as <...>. Parameters marked optional can be left out.
Tool | Parameters | Returns |
|
| Full record, or a summary list of the controls under a section or requirement |
|
| Ranked summaries, plus |
|
| Testing procedures grouped by Examine / Interview / Observe / Test, evidence types, frequency |
|
| Markdown checklist (SAQ mapping is approximate; |
|
| The control, the controls it references, and the controls that reference it |
|
| Controls with that schedule |
| optional | Controls that were best practice until 31 March 2025 (46 in Requirements 1-12) |
|
| Findings for PANs, card numbers written to logs, SAD, weak crypto, hardcoded secrets, SQL built from strings |
|
| Misconfiguration findings for that file type |
|
| SRI and CSP findings, a script inventory, and the effective |
|
| Gap analysis for a whole project folder, grouped by severity and requirement, with file paths and lines |
Example search result:
{
"query": "How do I protect cardholder data in browser scripts?",
"search_mode": "hybrid",
"count": 3,
"results": [
{"id": "6.4.3", "section_title": "<...>", "requirement": "<...>", "frequency": "Continuous",
"effective_date_status": "post_march_2025", "score": 0.0328},
{"id": "11.6.1", "...": "..."},
{"id": "2.2.4", "...": "..."}
]
}Every scanner finding has a severity, a pci_requirement_id, an issue_description and a remediation_step, plus a line or location and masked evidence where available:
{
"severity": "high",
"pci_requirement_id": "4.2.1",
"issue_description": "Weak TLS/SSL protocols enabled: TLSv1.",
"remediation_step": "Use 'ssl_protocols TLSv1.2 TLSv1.3;'.",
"line": 4,
"evidence": "<scanned_artifact>ssl_protocols TLSv1 TLSv1.2;</scanned_artifact>"
}{
"severity": "critical",
"pci_requirement_id": "3.5.1",
"issue_description": "Unmasked PAN found in code, data or a comment.",
"remediation_step": "Remove the PAN. Never hardcode or log full PANs; ...",
"related_requirement_ids": ["3.4.1"],
"line": 3,
"evidence": "<scanned_artifact>card = \"453914******6467\"</scanned_artifact>"
}audit_directory returns one group per issue, with up to 10 occurrences each (sample from a small test project):
{
"scanner": "repository",
"root": "/workspace",
"files": {"scanned": 9, "skipped": {"unsupported_type": 1}, "truncated": false, "with_findings": 8},
"summary": {
"total": 15,
"by_severity": {"critical": 1, "high": 9, "medium": 2, "low": 3},
"by_requirement": {"1.3.1": 1, "2.2.1": 3, "2.2.4": 1, "2.2.6": 1, "3.5.1": 1, "4.2.1": 2, "6.2.4": 4,
"6.4.3": 1, "8.6.2": 1}
},
"gap_analysis": [
{
"severity": "critical",
"pci_requirement_id": "3.5.1",
"issue_description": "Unmasked PAN found in code, data or a comment.",
"remediation_step": "Remove the PAN. Never hardcode or log full PANs; ...",
"occurrence_count": 1,
"occurrences": [
{"file": "<scanned_artifact>app/payments.py</scanned_artifact>", "line": 1,
"evidence": "<scanned_artifact>card = \"453201******0366\"</scanned_artifact>"}
]
}
],
"errors": [],
"note": "..."
}Resources
URI | Content |
| The 12 principal requirements with titles, section lists, control counts and post-March-2025 counts |
| Full JSON record for one control, e.g. |
Prompts
Prompt | Arguments | Workflow |
|
| Run the code scanner, confirm each finding with |
|
| Map the cardholder data flow and CDE, check segmentation (Req 1), stored data (Req 3) and transmission (Req 4), output a gap table |
Search
search_pci_controls combines two rankings with Reciprocal Rank Fusion, then applies the metadata filters:
BM25 (
rank_bm25) over IDs, titles, requirement text, guidance, keywords and SAQ tags. Acronyms such as PAN, SAD, SRI, CSP, HSM, TLS, AES, MFA and WAF are expanded with the words the standard uses.Semantic similarity with
sentence-transformers/all-MiniLM-L6-v2(viafastembed, ONNX, CPU). Control embeddings are precomputed byscripts/build_embeddings.py. The server only reads them and loads the model in offline mode.
If the embeddings are missing or stale (the dataset changed), search falls back to BM25 and the startup line says so. The server is ready about 0.5 s after launch; the first semantic query loads the model (about 0.3 s), and later queries take a few milliseconds.
Security model
Read-only and offline. The server makes no file writes, network calls or subprocess calls. A test fails if server code imports networking or subprocess modules, and another blocks sockets while running semantic search.
Input caps. Code, config and HTML inputs are limited to 500,000 characters, directory paths to 4,096, queries to 500, and other text parameters to 100.
No cardholder data or secrets in output. Every tool result passes through a sanitizer that masks Luhn-valid PANs (first 6 / last 4), redacts track data and well-known secret formats (AWS, GitHub, Stripe, Slack, Google keys, private key headers). The scanners also hide secret values they detect.
Untrusted content is marked. Anything quoted from scanned input (code lines, config values, script URLs) is wrapped in
<scanned_artifact>...</scanned_artifact>, and tag look-alikes inside it are neutralized so the content cannot close the block. Finding descriptions and remediation text are fixed templates. Tool descriptions and server instructions tell the model to treat tagged content as data, never as instructions.Directory audits stay inside the folder.
audit_directoryresolves the path first and refuses the filesystem root, your home folder itself, exact system paths (/etc,/usr,/var,/opt, ...) and anything under/proc,/sys,/devor/run; subfolders such as/var/wwwcan be scanned. It skips every symlinked file (counted assymlink, orsymlink_outside_rootwhen the link points outside the folder), never enters symlinked folders, opens files withO_NOFOLLOW, skips.git,node_modules,.venv, build output,data/raw, binaries and files over 500 KB, and stops atmax_files(default 100, at most 1,000).Audit log (opt-in).
PCI_MCP_AUDIT_LOG=1writes metadata-only JSON lines to stderr.
Development
Tests use a synthetic fixture (tests/fixtures/mock_pci_sample.json) with paraphrased mock controls, so CI never needs the copyrighted PDF.
uv run pytest # local dataset (or the fixture if none is built)
PCI_DSS_DATA_PATH=tests/fixtures/mock_pci_sample.json uv run pytest # what CI runs
uv run ruff check .tests/test_mcp_protocol.py starts the real pci-dss-mcp process and drives it over stdio with the MCP client SDK. GitHub Actions runs ruff, pytest and the preflight check on Python 3.11 and 3.13 for every push and pull request. See CONTRIBUTING.md before adding scanner rules.
To explore the server interactively with the MCP Inspector:
npx @modelcontextprotocol/inspector uv run pci-dss-mcp # web UI
npx @modelcontextprotocol/inspector --cli uv run pci-dss-mcp --method tools/list # CLIContributing
Contributions are welcome. Read CONTRIBUTING.md first: it covers setup, the checks to run, how to add a scanner rule, and the one rule every change must follow, which is that no PCI SSC documents, text from them, real card data or secrets may enter the repository. Issues and pull requests use templates that ask you to confirm this.
🗺️ Future Roadmap
v1.1 — CI/CD & AST Precision
Upgrade
code_scannerwith AST /tree-sitteranalysis for Python, JS/TS, and Go to reduce false positives.Add SARIF v2.1.0 output export to
audit_directoryfor native GitHub Code Scanning integration.Optional: read requirement IDs from official SAQ PDFs you download into
data/raw/(SAQ A, A-EP, D for Merchants, D for Service Providers) for exact SAQ checklists; fall back to the approximate mapping when they are missing.
v1.2 — Cross-Framework Mappings & CDE Scoping
Cross-map PCI DSS v4.0.1 controls to OWASP ASVS, NIST 800-53, and ISO 27001.
Add a CDE segmentation & scope analyzer for
docker-composeand Terraform topologies.Add a Customized Approach Controls Matrix template generator.
v1.3 — Remote Team Server & Registry
Support Streamable HTTP transport with optional API key / OAuth authentication for self-hosted, internal-only team deployments (requiring organizations to supply their own locally extracted PCI SSC dataset).
Automated multi-arch Docker image publishing to
ghcr.ioon release tags.
License
The code in this repository is released under the Apache License 2.0; see also NOTICE. The license does not cover PCI SSC documents or any text extracted from them, which remain the property of PCI Security Standards Council, LLC.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Payments-compliance checks for online stores: checkout scans, policy checks, VAMP/NDRP estimates.
Package, dependency, CI and config safety checks for coding agents. Pay per call.
PCI DSS self-assessment for merchants: picks the SAQ, guides the answers, returns SAQ + AoC PDFs.
HIPAA compliance AI agent — scan, grade, SRA, and generate compliance docs.
Related MCP Servers
AlicenseBqualityCmaintenanceAllows developers to query security findings (SAST issues, secrets, patches) using natural language within AI-assisted tools like Claude Desktop, Cursor, and other MCP-compatible environments.1711MIT- AlicenseAqualityDmaintenanceProvides instant access to authoritative security documentation from organizations like OWASP, NIST, and major cloud providers through natural language semantic search. It enables users to retrieve security best practices, frameworks, and vulnerability information directly from a locally cached knowledge base.41MIT
- FlicenseNot gradedqualityNot gradedmaintenanceEnables local security scanning and compliance gap analysis for code and text, detecting secrets, PII, and OWASP vulnerabilities, and assessing readiness across major frameworks like NCA, ISO 27001, NIST CSF, and SOC 2.-
- AlicenseBqualityBmaintenanceEnables AI agents to run deterministic, fully local static security and compliance audits of code, configurations, and dependencies through 32 MCP tools covering 24 vulnerability categories. It also detects the project stack, generates risk reports and checklists, suggests stack-aware remediations, and re-validates fixes to confirm vulnerabilities were eliminated.321MIT