PiQrypt MCP Server
PiQrypt MCP 服务器
通过模型上下文协议 (Model Context Protocol) 为 AI 智能体提供加密审计追踪
Related MCP server: DCL Evaluator
🚀 什么是 PiQrypt MCP?
PiQrypt MCP 服务器为 PiQrypt 提供模型上下文协议 (Model Context Protocol) 访问权限——这是面向 AI 智能体的后量子密码审计追踪系统。
使用场景:
🤖 AI 智能体:用加密证明签署每一项决策
📊 n8n 工作流:为自动化工作流添加审计追踪
🏦 交易机器人:满足自动化交易的 SEC/FINRA 合规性要求
👥 人力资源自动化:符合 GDPR 的 AI 招聘决策
🏥 医疗保健 AI:医疗决策的 HIPAA 审计追踪
📦 安装
前置要求
1. 安装 piqrypt (必需 — Python 3.8+)
pip install piqryptMCP 服务器将所有加密操作委托给 piqrypt Python 包。如果未安装,服务器在每次调用工具时都会返回明确的错误。
2. 安装 MCP 服务器 (Node.js 18+)
npm install -g @piqrypt/mcp-server通过 npx 安装 (无需全局安装)
npx @piqrypt/mcp-server从源码构建
git clone https://github.com/piqrypt/piqrypt-mcp-server
cd piqrypt-mcp-server
npm install
npm run buildPIQRYPT_PYTHON — 自定义 Python 环境
默认情况下,服务器使用 python3 (Linux/Mac) 或 python (Windows)。如果 piqrypt 安装在虚拟环境中,请将此变量设置为指向正确的解释器:
Windows
set PIQRYPT_PYTHON=C:\path\to\venv\Scripts\python.exeLinux / Mac
export PIQRYPT_PYTHON=/path/to/venv/bin/python要使其持久化,请将其添加到您的 MCP 客户端配置中:
{
"mcpServers": {
"piqrypt": {
"command": "piqrypt-mcp-server",
"args": [],
"env": {
"PIQRYPT_PYTHON": "/path/to/venv/bin/python"
}
}
}
}⚙️ 配置
Claude Desktop
添加到 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"piqrypt": {
"command": "piqrypt-mcp-server",
"args": []
}
}
}n8n (v1.88+)
安装 n8n MCP 集成
将 PiQrypt MCP 服务器添加到配置中
通过 MCP 节点在工作流中使用
兼容性
MCP 客户端
客户端 | 版本 | 备注 |
任何兼容 MCP 的客户端 | MCP 规范 2024-11+ | stdio 传输 |
n8n | 1.88+ | 通过 MCP 节点 |
Cursor | 任意 | 添加到 mcp 设置 |
VS Code | 任意 | 添加到 mcp 设置 |
Continue | 任意 | 添加到 mcp 设置 |
Windsurf | 任意 | 添加到 mcp 设置 |
自动化平台 (通过 MCP 节点)
平台 | 集成 | 使用场景 |
n8n | MCP 节点 (原生) | 无代码审计追踪 |
Make.com | HTTP 模块 | Webhook 触发的标记 |
Zapier | Webhooks + HTTP | 基础事件记录 |
您可以使用 PiQrypt MCP 审计的内容
每个工具调用都经过相同的 4 个操作 — 标记、验证、导出、搜索。根据您的上下文,其实际意义如下:
自动化交易 / 金融 任何提交订单、重新平衡投资组合或触发交易的智能体都可以在执行前标记每项决策。签署的链条可导出以供 SEC/FINRA 审计,无需任何额外基础设施。
人力资源和招聘自动化 任何评估候选人、对简历评分或筛选申请人的工作流都可以标记每项决策。为 AI 辅助招聘提供符合 GDPR 第 22 条的审计追踪 — 谁在何时决定了什么,以及使用了什么数据(已哈希,从不存储原始数据)。
内容和发布流水线 任何起草、批准或发布内容的智能体都可以标记每个步骤。当多个 AI 智能体协作且您需要证明归属时非常有用 — 哪个智能体编写了什么,顺序如何。
DevOps 和 CI/CD 任何触发部署、合并分支或轮换密钥的智能体都可以标记每个操作。为自主智能体所做的基础设施变更提供防篡改记录。
医疗保健和医疗 AI 任何诊断或分诊智能体都可以标记每项建议。提供符合 HIPAA 的审计追踪,将每个 AI 输出链接到可验证的智能体身份。
所有情况下的通用模式:
[Agent makes decision]
↓
piqrypt_stamp_event ← sign + chain
↓
[Agent executes action]
↓
piqrypt_export_audit ← portable proof, verifiable
without PiQrypt installed🛠️ 可用工具
1. piqrypt_stamp_event
用加密证明签署 AI 决策。
参数:
agent_id(字符串,必需):智能体标识符payload(对象,必需):决策数据previous_hash(字符串,可选):用于链接的前一个事件哈希
示例:
const event = await mcp.call('piqrypt_stamp_event', {
agent_id: 'trading_bot_v1',
payload: {
action: 'buy',
symbol: 'AAPL',
quantity: 100,
price: 150.25
}
});返回:
{
"version": "AISS-1.0",
"agent_id": "trading_bot_v1",
"timestamp": 1739382400,
"nonce": "uuid-...",
"payload": { ... },
"previous_hash": "sha256:...",
"signature": "base64:..."
}2. piqrypt_verify_chain
验证事件链的完整性。
参数:
events(数组,必需):要验证的事件
示例:
const result = await mcp.call('piqrypt_verify_chain', {
events: [event1, event2, event3]
});返回:
{
"valid": true,
"events_count": 3,
"chain_hash": "sha256:...",
"errors": []
}3. piqrypt_export_audit
导出审计追踪以供合规使用。
参数:
agent_id(字符串,必需):要导出的智能体certified(布尔值):请求 PiQrypt 认证output_format(字符串):json或pqz
示例:
const audit = await mcp.call('piqrypt_export_audit', {
agent_id: 'trading_bot_v1',
certified: true,
output_format: 'json'
});4. piqrypt_search_events
通过 SQLite 索引进行快速搜索。
参数:
event_type(字符串,可选):按类型过滤from_timestamp(数字,可选):开始时间to_timestamp(数字,可选):结束时间limit(数字):最大结果数(默认:100)
示例:
const trades = await mcp.call('piqrypt_search_events', {
event_type: 'trade_executed',
from_timestamp: 1739300000,
limit: 50
});📊 Vigil 仪表板 (可选,免费)
每个标记的事件都可以在 Vigil 中查看 — 这是 PiQrypt 的本地监控仪表板。
注意: Vigil 不会由 MCP 服务器自动启动。您必须在打开仪表板之前单独启动它。
piqrypt vigil
# → http://localhost:8421免费层级包括:链健康状况、VRS 风险评分、7 天历史记录、关键警报。升级到 Pro 可获得 90 天历史记录、TrustGate 治理和后量子签名。
🗑️ 管理智能体
智能体在首次标记时自动创建。要查看和删除智能体:
启动 Vigil:
piqrypt vigil进入 All Agents 视图
勾选要删除的智能体 → 点击 ✕ Delete selected
确认 — 当没有智能体剩余时,Vigil 会返回欢迎屏幕
智能体存储在您机器上的
~/.piqrypt/agents/中。删除智能体将永久移除其密钥和事件历史记录。
🔒 安全模型
进程隔离
┌─────────────────────────────────────┐
│ MCP Client (any MCP-compatible client) │
│ ↓ JSON-RPC over stdio │
├─────────────────────────────────────┤
│ MCP Server (TypeScript/Node.js) │ ← No crypto here
│ ↓ subprocess call │
├─────────────────────────────────────┤
│ Python Bridge (bridge.py) │
│ ↓ invokes CLI │
├─────────────────────────────────────┤
│ PiQrypt CLI (Python) │
│ ↓ uses │
├─────────────────────────────────────┤
│ Core Crypto (aiss package) │ ← All crypto here
│ • Ed25519 / Dilithium3 │
│ • RFC 8785 canonical JSON │
│ • Hash chains │
└─────────────────────────────────────┘保证
✅ 私钥从不暴露给 MCP 层 ✅ 所有加密都在 Python 中进行 (Ed25519, Dilithium3) ✅ 与 CLI 相同的安全性 (进程隔离) ✅ 符合 RFC AISS-1.1 标准 (输出一致) ✅ 子进程调用前的输入验证
📚 示例
交易机器人 (n8n)
[Webhook: price alert]
↓
[AI Decision: buy/sell?]
↓
[PiQrypt MCP: stamp decision] ← Audit trail
↓
[Execute trade API]
↓
[Database: store proof]人力资源自动化
[Upload CV]
↓
[AI Agent: evaluate candidate]
↓
[PiQrypt MCP: stamp evaluation] ← GDPR compliance
↓
[Email HR team]🧪 测试
# Build
npm run build
# Test bridge
python3 src/python/bridge.py stamp '{"agent_id":"test","payload":{"action":"test"}}'
# Test MCP server (manual)
node dist/index.js
# Then send MCP request via stdin🔧 故障排除
Error: piqrypt is not installed in this Python environment
MCP 服务器使用的 Python 解释器找不到 piqrypt 包。
修复:
pip install piqrypt如果 piqrypt 安装在虚拟环境中而不是系统 Python 中,请设置 PIQRYPT_PYTHON 指向正确的解释器:
# Linux / Mac
export PIQRYPT_PYTHON=/path/to/venv/bin/python
# Windows
set PIQRYPT_PYTHON=C:\path\to\venv\Scripts\python.exe要验证服务器将使用哪个 Python:
# Linux / Mac
$PIQRYPT_PYTHON -c "import aiss; print('ok')"
# Windows
%PIQRYPT_PYTHON% -c "import aiss; print('ok')"📖 文档
🤝 贡献
我们欢迎贡献!请参阅 CONTRIBUTING.md。
📄 许可证
MCP 服务器 → MIT 许可证 - 请参阅 LICENSE PiQrypt 核心 → 免费层级 + 商业层级
🔗 链接
PiQrypt 核心: https://github.com/piqrypt/piqrypt
MCP 协议: https://modelcontextprotocol.io
n8n: https://n8n.io
由 PiQrypt Inc. 用 ❤️ 构建
Available Tools
4 toolspiqrypt_export_auditA
Export the complete agent audit trail to a portable JSON archive. Set certified=true to request a PiQrypt CA signature for legal admissibility (eIDAS Art.26). The export is self-contained and verifiable without PiQrypt installed.
Inputs: agent_id (required), certified, output_format.
piqrypt_search_eventsA
Search the agent's cryptographic event history by type, time range, or session. Returns signed events with chain metadata. Use to reconstruct what an agent did during a specific period.
Inputs: event_type, from_timestamp, to_timestamp, limit.
piqrypt_stamp_eventA
Create a tamper-proof cryptographic record of an agent decision. Signs the event with Ed25519, links it to the previous event in a hash chain (AISS v2.0). Call this after every significant agent action. Required for GDPR Art.22, EU AI Act Art.13, HIPAA audit trail, SEC/FINRA trading compliance.
Inputs: agent_id (required), payload (required), previous_hash.
piqrypt_verify_chainA
Verify that an agent's decision history is intact and untampered. Detects modified events, missing events, hash chain breaks, and forks. Call before trusting any historical agent output.
Inputs: events (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool maps to a distinct action in the audit workflow: stamping, exporting, searching, and verifying. The descriptions make the boundaries clear, and even the slight overlap between search and export is resolved by their different purposes.
Every tool follows the same snake_case convention with a shared 'piqrypt_' prefix and a clear verb_object pattern, such as stamp_event and verify_chain. The small singular/plural variation is natural and does not hurt predictability.
Four tools is well-scoped for a focused cryptographic audit-log server. Each tool covers a necessary part of the lifecycle and none feels redundant or missing.
The tool surface covers the full lifecycle of an append-only audit trail: create, query, export, and verify. Missing update/delete operations are appropriate for a tamper-proof audit system, so there are no obvious dead ends.
Maintenance
Related MCP Connectors
Signed, publicly logged records of what your AI agent did, with proofs anyone can check offline.
Bitcoin-anchored, tamper-evident audit log for AI agents — record, disclose and verify actions.
Tamper-evident SHA-256 hash-chained decision notary for EU AI Act, NIST AI RMF & SOC2.
Tamper-evident proof creation and verification for AI agents via MCP, A2A, and REST.
Related MCP Servers
- AlicenseAqualityCmaintenanceProvides cryptographic signing and verification for AI decisions to generate verifiable, Ed25519-signed receipts for compliance and auditing. It automatically maps AI actions to regulatory frameworks like HIPAA and SOX with high-performance, sub-3ms signing.4MIT
- FlicenseNot gradedqualityFmaintenanceSuperseded. Earlier version of the DCL product (MCP endpoint at /sse with API key, plus an offline desktop audit trail). Not the current path for agents. Use the hosted DCL Trust Oracle: https://github.com/Fronesis-Labs/dcl-webhook (MCP endpoint https://mcp.fronesislabs.com/mcp, Streamable HTTP, x402 payment, no API key).-
- AlicenseNot gradedqualityDmaintenanceProvides tamper-proof audit logging for AI agents using SHA-256 hash chains, integrity verification, and compliance reporting for the EU AI Act.53 PyPI1MIT
- AlicenseBqualityBmaintenanceSigned receipts for agent actions and a read-only-allowlist decision gate, as an MCP server. Ed25519, plus ML-DSA-65 when the post-quantum backend is available. gate_decision returns ALLOW, DENY or ESCALATE from action names and does not observe or block anything. verify_receipt takes expected_kid to pin which key signed. Seven tools.161Apache 2.0