AgentSkillsCN

sigil-mcp

用于 Sigil MPC 签名的模型上下文协议服务器。适用于将 Sigil 部署为一款通用的代理兼容型签名服务器,可与 Claude Desktop、VS Code 以及任何符合 MCP 标准的客户端协同工作。

SKILL.md
--- frontmatter
name: sigil-mcp
description: Model Context Protocol server for Sigil MPC signing. Use for deploying Sigil as a universal agent-compatible signing server that works with Claude Desktop, VS Code, and any MCP-compliant client.
allowed-tools: Read, Bash, Glob, Grep

Sigil MCP Server

The Sigil MCP server implements the Model Context Protocol (MCP) specification, enabling any MCP-compatible AI agent to securely sign blockchain transactions using Sigil's MPC infrastructure.

Quick Start

Building

bash
# Build the MCP server
cargo build -p sigil-mcp --release

# Binary located at: target/release/sigil-mcp

Running

bash
# Start with stdio transport (for Claude Desktop, VS Code)
sigil-mcp --transport stdio

# With verbose logging
sigil-mcp --transport stdio --log-level debug

Integration with Claude Desktop

Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS or %APPDATA%\Claude\claude_desktop_config.json on Windows):

json
{
  "mcpServers": {
    "sigil": {
      "command": "/path/to/sigil-mcp",
      "args": ["--transport", "stdio"]
    }
  }
}

Available Tools

The MCP server exposes the following tools:

ToolDescription
sigil_check_diskCheck if a signing disk is inserted and valid
sigil_sign_evmSign EVM transactions (Ethereum, Polygon, etc.)
sigil_sign_frostSign with FROST (Bitcoin Taproot, Solana, Zcash)
sigil_get_addressGet the signing address for the current disk
sigil_update_tx_hashRecord transaction hash in audit log
sigil_list_schemesList supported signature schemes
sigil_get_presig_countGet remaining presignatures

Available Resources

Resource URIDescription
sigil://disk/statusReal-time disk status
sigil://presigs/infoPresignature statistics
sigil://supported-chainsList of supported blockchains
sigil://children/{id}Child disk information

Available Prompts

PromptDescription
sign_evm_transferGuided EVM transfer workflow
sign_bitcoin_taprootGuided Bitcoin Taproot signing
sign_solana_transferGuided Solana transfer
troubleshoot_diskDiagnose disk issues
check_signing_readinessVerify system readiness

MCP Protocol

The server implements MCP version 2025-11-25 with:

  • Transport: stdio (newline-delimited JSON-RPC 2.0)
  • Capabilities: tools, resources (with subscriptions), prompts, logging

Example Initialize Handshake

Client Request:

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {
    "protocolVersion": "2025-11-25",
    "capabilities": {},
    "clientInfo": {
      "name": "my-agent",
      "version": "1.0.0"
    }
  }
}

Server Response:

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "protocolVersion": "2025-11-25",
    "capabilities": {
      "tools": { "listChanged": true },
      "resources": { "subscribe": true, "listChanged": true },
      "prompts": { "listChanged": false },
      "logging": {}
    },
    "serverInfo": {
      "name": "sigil-mcp",
      "version": "0.1.0"
    }
  }
}

Example Tool Call

Request:

json
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "sigil_check_disk",
    "arguments": {}
  }
}

Response:

json
{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "content": [{
      "type": "text",
      "text": "Disk detected (sigil_7a3f2c1b)\n├─ Presigs: 847/1000 remaining\n├─ Scheme: ecdsa\n├─ Expires: 12 days\n└─ Status: ✓ Valid"
    }],
    "structuredContent": {
      "detected": true,
      "child_id": "7a3f2c1b",
      "scheme": "ecdsa",
      "presigs_remaining": 847,
      "presigs_total": 1000,
      "days_until_expiry": 12,
      "is_valid": true
    }
  }
}

Architecture

code
┌─────────────────────────────────────────────────────────────┐
│                     AI AGENT HOST                            │
│  (Claude Desktop, VS Code, Custom Agent)                    │
│                                                              │
│         ┌─────────────────┐                                 │
│         │   MCP CLIENT    │                                 │
│         └────────┬────────┘                                 │
└──────────────────┼──────────────────────────────────────────┘
                   │ stdio (JSON-RPC 2.0)
                   │
┌──────────────────▼──────────────────────────────────────────┐
│                   SIGIL-MCP SERVER                           │
│                                                              │
│   ┌─────────────┐  ┌─────────────┐  ┌─────────────┐        │
│   │   TOOLS     │  │  RESOURCES  │  │   PROMPTS   │        │
│   │ • sign_evm  │  │ • disk://   │  │ • sign_*    │        │
│   │ • sign_frost│  │ • presigs://│  │ • troubl... │        │
│   └─────────────┘  └─────────────┘  └─────────────┘        │
│                                                              │
│   ┌────────────────────────────────────────────────────┐    │
│   │              SIGIL CORE LAYER                       │    │
│   │   DiskState • ToolContext • Signing Logic          │    │
│   └────────────────────────────────────────────────────┘    │
└──────────────────────────────────────────────────────────────┘

CLI Options

code
sigil-mcp [OPTIONS]

Options:
  -t, --transport <TRANSPORT>  Transport mechanism [default: stdio] [possible: stdio, http]
  -p, --port <PORT>           Port for HTTP transport [default: 3000]
  -v, --verbose               Enable verbose logging (to stderr)
      --mock                  Use mock disk state (for testing)
      --log-level <LEVEL>     Log level [default: info] [possible: trace, debug, info, warn, error]
  -h, --help                  Print help
  -V, --version               Print version

Development

Running Tests

bash
cargo test -p sigil-mcp

Testing with MCP Inspector

bash
npx @anthropic/mcp-inspector /path/to/sigil-mcp --transport stdio

Future Enhancements

  • HTTP + SSE transport for web clients
  • Direct integration with sigil-daemon
  • Resource subscriptions for real-time disk updates
  • Rate limiting and authentication
  • Metrics and telemetry

Reference