Skip to content

PiQrypt/piqrypt-mcp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PiQrypt MCP Server

Cryptographic Audit Trail for AI Agents via Model Context Protocol

MCP License Python Node


πŸš€ What is PiQrypt MCP?

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

πŸ“¦ Installation

Prerequisites

  • Node.js 18+
  • Python 3.8+
  • PiQrypt Core (pip install piqrypt)

Install MCP Server

npm install @piqrypt/mcp-server

Or build from source:

git clone https://github.com/piqrypt/piqrypt-mcp-server
cd piqrypt-mcp-server
npm install
npm run build

βš™οΈ Configuration

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "piqrypt": {
      "command": "node",
      "args": ["/path/to/piqrypt-mcp-server/dist/index.js"]
    }
  }
}

n8n (v1.88+)

  1. Install n8n MCP integration
  2. Add PiQrypt MCP server to configuration
  3. Use in workflows via MCP node

πŸ› οΈ Available Tools

1. piqrypt_stamp_event

Sign an AI decision with cryptographic proof.

Parameters:

  • agent_id (string, required): Agent identifier
  • payload (object, required): Decision data
  • previous_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:..."
}

2. piqrypt_verify_chain

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": []
}

3. piqrypt_export_audit

Export audit trail for compliance.

Parameters:

  • agent_id (string, required): Agent to export
  • certified (boolean): Request PiQrypt certification
  • output_format (string): json or pqz

Example:

const audit = await mcp.call('piqrypt_export_audit', {
  agent_id: 'trading_bot_v1',
  certified: true,
  output_format: 'json'
});

4. piqrypt_search_events

Fast search via SQLite index.

Parameters:

  • event_type (string, optional): Filter by type
  • from_timestamp (number, optional): Start time
  • to_timestamp (number, optional): End time
  • limit (number): Max results (default: 100)

Example:

const trades = await mcp.call('piqrypt_search_events', {
  event_type: 'trade_executed',
  from_timestamp: 1739300000,
  limit: 50
});

πŸ”’ Security Model

Process Isolation

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  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                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Guarantees

βœ… 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


πŸ“š Examples

Trading Bot (n8n)

[Webhook: price alert] 
    ↓
[AI Decision: buy/sell?]
    ↓
[PiQrypt MCP: stamp decision]  ← Audit trail
    ↓
[Execute trade API]
    ↓
[Database: store proof]

HR Automation

[Upload CV]
    ↓
[Claude AI: evaluate candidate]
    ↓
[PiQrypt MCP: stamp evaluation]  ← GDPR compliance
    ↓
[Email HR team]

πŸ§ͺ Testing

# 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

πŸ“– Documentation


🀝 Contributing

We welcome contributions! See CONTRIBUTING.md.


πŸ“„ License

MIT License - see LICENSE


πŸ”— Links


Built with ❀️ by PiQrypt Inc.

Releases

No releases published

Packages

 
 
 

Contributors