GxP MDM MCP Server
GxP MDM MCP 服务器 - 用于 Claude / ChatGPT / Cursor 的 Cypher 工具
此 MCP 服务器通过 Cypher 查询将您的计算机化系统清单作为知识图谱暴露出来。任何 Claude/ChatGPT 代理现在都可以查询 GxP 主数据而不会产生幻觉。
架构
Claude / ChatGPT / Cursor
|
| MCP (stdio)
v
mcp_server.py (14 tools)
|
| Cypher queries
v
Neo4j (or MOCK mode: NetworkX + JSON) <- your MDM golden record为什么选择 Cypher?
爆炸半径是一次图遍历:
MATCH (start)-[:SENDS_VIA*1..3]->(downstream)— 在 SQL 中不可能实现数据血缘,用于 ALCOA+ 调查
法规事实基准 — 代理只能引用 Cypher 返回的条款,防止幻觉
Related MCP server: Fianu Compliance Intelligence MCP Server
暴露的 14 个工具
工具 | Cypher | 功能 |
| 自定义 | 安全只读 Cypher,用于探索 |
|
| 完整清单 - 审计员通常会先问这个 |
| 完整子图 | 系统 + 功能 + 电子记录 + 供应商 + 接口 |
|
| 核心应用:变更会影响哪些下游 GxP 系统? |
| 反向遍历 | 数据来自哪里? |
|
| 反幻觉:只能引用这些条款 |
|
| 带 GxP 标志的 API/文件/手动接口 |
|
| 未验证的 GxP Direct 系统 |
|
| 逾期未进行的定期审查 |
|
| 电子签名、批次放行、效力 |
|
| 供应商审计状态、SOC2 |
|
| 记录类型的数据血缘 |
|
| GxP Direct 清单 |
| 复合 | 编排 3 个 Cypher 查询 + 根据 GAMP 5 / CSA 生成影响评估 |
快速开始(无需 Neo4j - 模拟模式)
cd gxp_mdm_mcp_server
pip install -r requirements.txt
# Mock mode: uses JSON + NetworkX, no Neo4j required
python scripts/test_tools.py
# Should show:
# - List 4 systems
# - Veeva QMS details with downstream SAP
# - Blast radius: Veeva -> SAP
# - REJECT for audit trail purge
# - Minor for version upgrade模拟模式非常适合 POC 和 Claude Desktop 测试。
使用 Neo4j 的生产模式
# .env - set Neo4j creds
cp .env.example .env
# Edit .env with your Neo4j URI
# Start Neo4j
docker-compose up -d neo4j
# Load sample data + schema
python scripts/load_sample_data.py
# Test with Neo4j
python scripts/test_tools.py
# Start API harness (optional)
uvicorn src.api_server:app --reload --port 8000
# http://localhost:8000/cypher/list_all_systems
# http://localhost:8000/cypher/blast_radius?system_id=SYS-VEEVA-QMS-001Claude Desktop 配置
查找您的 Claude 配置:
~/Library/Application Support/Claude/claude_config.json(Mac) 或~/AppData/Roaming/Claude/claude_config.json(Windows)添加(使用绝对路径):
{
"mcpServers": {
"gxp-mdm-cypher": {
"command": "python",
"args": ["/absolute/path/to/gxp_mdm_mcp_server/src/mcp_server.py"],
"env": {
"NEO4J_URI": "",
"NEO4J_USERNAME": "neo4j",
"NEO4J_PASSWORD": "password"
}
}
}
}对于模拟模式,保留 NEO4J_URI 为空。对于 Neo4j,设置为 bolt://localhost:7687。
重新启动 Claude Desktop。您应该在 🔌 下看到 14 个工具。
尝试以下提示:
List all GxP Direct systems in my inventory
> calls list_all_systems(gxp_impact="Direct")
What happens if I change Veeva QMS? Show blast radius
> calls get_blast_radius(system_id="SYS-VEEVA-QMS-001")
Assess this change: Enable audit trail purge after 7 years for Veeva QMS
> calls assess_change_impact -> should REJECT per 21CFR11.10(e)
Assess Veeva upgrade from 24R1 to 24R2 with no e-sig change
> calls assess_change_impact -> should be Minor per CSA low riskCursor 配置
参见 config/cursor_config.json.example - 添加到 .cursor/mcp.json
ChatGPT(支持 MCP)
如果使用支持 MCP 的 ChatGPT 或自定义 GPT,请参考 config/chatgpt_mcp_config.json。ChatGPT 将通过 stdio 调用工具。
Cypher 查询 - 事实基准
所有查询都位于 src/cypher_tools.py 中。关键查询:
爆炸半径(护城河):
MATCH (start:ComputerizedSystem {system_id: $system_id})
MATCH path = (start)-[:SENDS_VIA*1..$depth]->(downstream:ComputerizedSystem)
WHERE downstream.gxp_impact IN ['Direct', 'GxP Relevant']
RETURN downstream.system_id, length(path) as distance法规反幻觉:
MATCH (s:ComputerizedSystem {system_id: $system_id})
OPTIONAL MATCH (s)-[:HAS_FUNCTION]->(f)-[:REGULATED_BY]->(reg)
RETURN collect(DISTINCT reg) as regulations代理必须仅引用此处返回的 clause_ids。
从 POC 到生产
将
data/*.json替换为真实的 Veeva Vault API + ServiceNow CMDB + Okta添加用于更新 validation_status 的写工具(带审批工作流)
添加法规 RAG 的向量搜索工具(嵌入 GAMP 5 第 2 版)
添加定时调用
find_periodic_review_overdue的定期评审代理
现在,您拥有了每个 CSV 代理必须查询的层。
故障排除
No module named mcp:运行pip install mcpClaude 未看到工具:检查配置中的绝对路径,重启 Claude,并检查日志
~/Library/Logs/Claude/m*.logNeo4j 连接失败:自动回退到模拟模式 - 检查
NEO4J_URI
祝您抢占市场先机。
新增:带审批工作流的写入工具(GxP 合规)
为什么需要审批工作流?
21 CFR Part 11.50 和 Annex 11 要求:
两人原则(请求者 != 批准者)
变更原因(ALCOA+ 完整性)
电子签名体现(谁、何时、含义)
不可变审计追踪(谁何、旧值/新值、原因)
所有写工具均强制这些要求。
新增写入工具
工具 | 工具说明 | GxP 控制 |
| 创建待处理变更请求 | 日志记录 REQUEST 审计,reason 至少 10 个字符 |
| 批准并应用变更 | 强制要求 请求者 != 批准人,记录电子签名,更新系统及下次审查日期 |
| 拒绝并附上原因 | 写审计日志 |
| 列出待 QA 审批的变更 | 无 |
| 包含电子签名的完整审计追踪 | 21 CFR 11.10(e)、Annex 11.7 |
通过 Claude 运行的示例工作流
You: Change Veeva QMS status to Validated - Change Implemented, reason: IQ/OQ passed for 24R2 upgrade, requested by qa.john
Claude calls:
request_validation_status_change_tool(system_id="SYS-VEEVA-QMS-001", new_status="Validated - Change Implemented", reason="IQ/OQ passed for 24R2 upgrade, evidence in Veeva Vault VP-2024-089", requested_by="qa.john@company.com")
-> Returns request_id CHG-VAL-A1B2C3, status Pending Approval
You: Approve CHG-VAL-A1B2C3 by qa.sarah, comment: Reviewed IQ/OQ, approved
Claude calls:
approve_validation_status_change_tool(request_id="CHG-VAL-A1B2C3", approver="qa.sarah@company.com", approval_comment="Reviewed IQ/OQ")
-> Applies change, updates sample_systems.json, creates audit trail with e-signature
You: Show audit trail for Veeva QMS
Claude calls:
get_audit_trail_tool(system_id="SYS-VEEVA-QMS-001")
-> Returns who, when, old/new, reason, electronic signature manifestation通过 API 试用:
curl -X POST http://localhost:8000/request-status-change -H "Content-Type: application/json" -d '{"system_id":"SYS-VEEVA-QMS-001","new_status":"Validated - Change Implemented","reason":"IQ/OQ passed for 24R2 upgrade","requested_by":"qa.john@company.com"}'
curl -X POST http://localhost:8000/approve-status-change -d '{"request_id":"CHG-VAL-A1B2C3","approver":"qa.sarah@company.com","approval_comment":"Reviewed"}'
curl http://localhost:8000/audit-trail?system_id=SYS-VEEVA-QMS-001新增:定时定期审查代理
功能说明
自动执行以下操作:
每天上午 8 点(通过 APScheduler)调用
find_periodic_review_overdueCypher为每个逾期的 GxP 直接系统,根据 GAMP 5 第 6.5 节和 Annex 11.11 生成定期审查报告草稿
保存草稿 JSON 并记录审计追踪 CREATE_DRAFT
每份草稿包含审计员期望的 10 个部分:
系统描述(来自 MDM)
自上次审查以来的变更(来自模拟 Jira)
偏差/事件
审计追踪审查(抽样、不可变性)
用户访问审查(未激活账户)
备份/恢复测试
供应商管理(SOC2)
数据完整性 ALCOA+
接口 - 通过 MDM 图实现爆炸半径
结论 + 所需操作
工具
工具 | 用途 |
| 扫描逾期项(Cypher) |
| 扫描并为所有逾期项生成草稿 |
| 为单个系统生成 |
| 列出草稿 |
运行调度程序
# Run once manually
python -c "from src.periodic_review_agent.agent import agent; print(agent.scan_overdue())"
# Generate drafts
python -c "from src.periodic_review_agent.agent import agent; print(agent.generate_drafts_for_overdue())"
# Run as daemon (daily 8am + every 6h demo)
python src/periodic_review_agent/scheduler.py在生产环境中,请用 Airflow DAG 或 Temporal schedule 替换 APScheduler,这些调度器会调用 MCP 工具 run_periodic_review_scan。
通过 Claude
You: Run periodic review scan
Claude calls run_periodic_review_scan() -> finds 2 overdue systems
You: Generate drafts for overdue
Claude calls generate_periodic_review_drafts() -> creates PR-SYS-VEEVA-QMS-001-2025-XXXX reports
You: Show me draft for Veeva QMS
> Returns full 10-section report草稿已保存到 data/periodic_reviews/PR-*.json - 可随时上传到 Valitrack 作为 Veeva 验证制品。
这个 v2–3 让您具备审计就绪状态:写入经过审批,审计追踪符合 ALCOA+ 标准,定期审查实现自动化 — 这正是质量保证总监愿意支付顾问每小时 200 美元的原因。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables creating, managing, analyzing, and visualizing knowledge graphs with support for multiple graph types (topology, timelines, changelogs, requirements, knowledge bases, ontologies) including node/edge management and resource association.15191MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to query software supply chain compliance data, including asset status, security vulnerabilities, and evidence lineage. It allows for natural language analysis of compliance posture, policy violations, and deployment blockers across an organization.
- AlicenseAqualityDmaintenanceConnects AI assistants to ServiceNow CMDB via natural language, enabling querying, dependency analysis, health auditing, CI lifecycle management, and configurable inspection.40MIT
- AlicenseAqualityDmaintenanceEnables AI to analyze, query, and manage a graph-based representation of software architecture for impact analysis, dependency tracking, and design.20121AGPL 3.0
Related MCP Connectors
AI knowledge graph for architecture, portfolio, and digital strategy management.
Shared, permission-aware company context for AI agents, with provenance, approvals and audit.
Runtime AI governance: decision gates, human approval, hash-chained audit, compliance mapping.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/saram-io/gxp_mdm_mcp_server_v2'
If you have feedback or need assistance with the MCP directory API, please join our Discord server