Cryptographic Audit Trail for AI Agents via Model Context Protocol
PiQrypt MCP Server provides Model Context Protocol access to PiQrypt β the post-quantum cryptographic audit trail for AI agents.
Use cases:
- π€ AI Agents: Sign every decision with cryptographic proof
- π n8n Workflows: Add audit trail to automation workflows
- π¦ Trading Bots: SEC/FINRA compliance for automated trading
- π₯ HR Automation: GDPR-compliant AI hiring decisions
- π₯ Healthcare AI: HIPAA audit trail for medical decisions
- Node.js 18+
- Python 3.8+
- PiQrypt Core (
pip install piqrypt)
npm install @piqrypt/mcp-serverOr build from source:
git clone https://github.com/piqrypt/piqrypt-mcp-server
cd piqrypt-mcp-server
npm install
npm run buildAdd to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"piqrypt": {
"command": "node",
"args": ["/path/to/piqrypt-mcp-server/dist/index.js"]
}
}
}- Install n8n MCP integration
- Add PiQrypt MCP server to configuration
- Use in workflows via MCP node
Sign an AI decision with cryptographic proof.
Parameters:
agent_id(string, required): Agent identifierpayload(object, required): Decision dataprevious_hash(string, optional): Previous event hash for chaining
Example:
const event = await mcp.call('piqrypt_stamp_event', {
agent_id: 'trading_bot_v1',
payload: {
action: 'buy',
symbol: 'AAPL',
quantity: 100,
price: 150.25
}
});Returns:
{
"version": "AISS-1.0",
"agent_id": "trading_bot_v1",
"timestamp": 1739382400,
"nonce": "uuid-...",
"payload": { ... },
"previous_hash": "sha256:...",
"signature": "base64:..."
}Verify integrity of event chain.
Parameters:
events(array, required): Events to verify
Example:
const result = await mcp.call('piqrypt_verify_chain', {
events: [event1, event2, event3]
});Returns:
{
"valid": true,
"events_count": 3,
"chain_hash": "sha256:...",
"errors": []
}Export audit trail for compliance.
Parameters:
agent_id(string, required): Agent to exportcertified(boolean): Request PiQrypt certificationoutput_format(string):jsonorpqz
Example:
const audit = await mcp.call('piqrypt_export_audit', {
agent_id: 'trading_bot_v1',
certified: true,
output_format: 'json'
});Fast search via SQLite index.
Parameters:
event_type(string, optional): Filter by typefrom_timestamp(number, optional): Start timeto_timestamp(number, optional): End timelimit(number): Max results (default: 100)
Example:
const trades = await mcp.call('piqrypt_search_events', {
event_type: 'trade_executed',
from_timestamp: 1739300000,
limit: 50
});βββββββββββββββββββββββββββββββββββββββ
β MCP Client (Claude, n8n, etc.) β
β β 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 β
βββββββββββββββββββββββββββββββββββββββ
β
Private keys never exposed to MCP layer
β
All crypto in Python (Ed25519, Dilithium3)
β
Same security as CLI (process isolation)
β
RFC AISS-1.1 compliant (identical output)
β
Input validation before subprocess call
[Webhook: price alert]
β
[AI Decision: buy/sell?]
β
[PiQrypt MCP: stamp decision] β Audit trail
β
[Execute trade API]
β
[Database: store proof]
[Upload CV]
β
[Claude AI: 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 stdinWe welcome contributions! See CONTRIBUTING.md.
MIT License - see LICENSE
- PiQrypt Core: https://github.com/piqrypt/piqrypt
- MCP Protocol: https://modelcontextprotocol.io
- n8n: https://n8n.io
- Documentation: https://docs.piqrypt.com
Built with β€οΈ by PiQrypt Inc.