@dcprotocol/mcp

Model Context Protocol server for Claude Desktop, Cursor, and other MCP-compatible AI tools. Gives AI assistants secure access to your vault without exposing raw credentials.

Installation

npm install -g @dcprotocol/mcp

Quick Start

Configure Claude Desktop

Add to your Claude Desktop config file:

# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "dcp-vault": {
      "command": "npx",
      "args": ["-y", "@dcprotocol/mcp"]
    }
  }
}

Restart Claude Desktop. You'll see "DCP Vault" in the MCP section.

Configure Cursor

# Cursor Settings > Features > MCP Servers
# Add:
{
  "mcpServers": {
    "dcp-vault": {
      "command": "npx",
      "args": ["-y", "@dcprotocol/mcp"]
    }
  }
}

Available Tools

The MCP server exposes these tools to AI assistants. The assistant can call them when it needs wallet operations or vault data.

vault_get_address

Get public address for a blockchain wallet.

ParameterTypeDescription
chainstringsolana | ethereum | base

Example usage in conversation:

You: "What's my Solana address?"
Claude: Calls vault_get_address(chain: "solana")
Claude: "Your Solana address is 5YzW8d...AbC123"

vault_sign_tx

Sign a blockchain transaction (requires user approval).

ParameterTypeDescription
chainstringsolana | ethereum | base
unsigned_txstringBase64-encoded transaction
amountnumberTransaction amount
currencystringSOL | ETH | BASE_ETH | USDC
recipientstringRecipient address (optional)

Example usage in conversation:

You: "Send 0.5 SOL to ABC123..."
Claude: Creates unsigned transaction
Claude: Calls vault_sign_tx(chain: "solana", unsigned_tx: "...", amount: 0.5, currency: "SOL")
DCP: Shows consent popup → You approve
Claude: "Transaction signed! Signature: XYZ..."

vault_read

Read stored data from vault (requires approval).

ParameterTypeDescription
scopestringData scope (e.g., "identity.email")

Example usage in conversation:

You: "What's my email address?"
Claude: Calls vault_read(scope: "identity.email")
DCP: Shows consent popup → You approve
Claude: "Your email is john@example.com"

vault_budget_check

Check if transaction is within budget limits.

ParameterTypeDescription
chainstringsolana | ethereum | base
amountnumberTransaction amount
currencystringSOL | ETH | BASE_ETH | USDC

Example usage in conversation:

You: "Can I send 50 SOL today?"
Claude: Calls vault_budget_check(chain: "solana", amount: 50, currency: "SOL")
Claude: "No, that exceeds your daily limit of 20 SOL. You have 18.5 SOL remaining today."

vault_activity

View recent vault activity (audit log).

ParameterTypeDescription
limitnumberNumber of entries (default: 10)

Example usage in conversation:

You: "Show me recent vault activity"
Claude: Calls vault_activity(limit: 10)
Claude: "Here are your last 10 vault operations: [shows table of transactions]"

Consent Flow

When Claude calls a sensitive tool (vault_sign_tx or vault_read), DCP shows a consent popup:

┌────────────────────────────────────────┐
│  DCP Consent Request                   │
├────────────────────────────────────────┤
│  Agent: Claude Desktop                 │
│  Operation: Sign Transaction           │
│                                        │
│  Chain: Solana                         │
│  Amount: 1.5 SOL                       │
│  Recipient: ABC123...                  │
│                                        │
│  ┌─────────┐  ┌──────────┐           │
│  │ Approve │  │  Deny    │           │
│  └─────────┘  └──────────┘           │
└────────────────────────────────────────┘

If you approve, the operation proceeds. If you deny, Claude receives an error and will tell you the request was denied.

Trusted Mode

Mark Claude Desktop as trusted to skip consent for small transactions:

dcp agents trust "Claude Desktop"

# Now transactions under auto-approve threshold proceed automatically
# (default: 2 SOL, 0.1 ETH, 100 USDC)

Example Conversations

Checking Wallet Balance

You: What's my Solana wallet address?
Claude: [calls vault_get_address] Your Solana address is 5YzW8d...AbC123

You: Can you check the balance?
Claude: [uses Solana RPC] You have 15.3 SOL in your wallet.

Sending Tokens

You: Send 0.1 SOL to ABC123...
Claude: I'll prepare a transaction to send 0.1 SOL to ABC123...
Claude: [creates unsigned transaction]
Claude: [calls vault_sign_tx]
DCP: [shows consent popup]
You: [clicks Approve]
Claude: Transaction signed! Signature: XYZ... Broadcasting...
Claude: ✓ Transaction confirmed on Solana. View: https://solscan.io/tx/XYZ...

Reading Credentials

You: What's my email address?
Claude: [calls vault_read(scope: "identity.email")]
DCP: [shows consent popup]
You: [clicks Approve]
Claude: Your email is john@example.com

You: Can you draft an email using my email?
Claude: Sure! [uses the email address to draft]

Budget Management

You: Can I send 100 SOL?
Claude: [calls vault_budget_check]
Claude: No, that exceeds your per-transaction limit of 5 SOL and
       daily limit of 20 SOL. You can send up to 5 SOL per transaction
       and have 18.5 SOL remaining in your daily budget.

Configuration

Environment Variables

VariableDefaultDescription
VAULT_DIR~/.dcpVault storage directory
DCP_MCP_LOG_LEVELinfoLogging level (debug, info, warn, error)

Custom Vault Location

{
  "mcpServers": {
    "dcp-vault": {
      "command": "npx",
      "args": ["-y", "@dcprotocol/mcp"],
      "env": {
        "VAULT_DIR": "/custom/path/to/vault"
      }
    }
  }
}

Advanced Usage

Multiple MCP Servers

Run DCP alongside other MCP servers:

{
  "mcpServers": {
    "dcp-vault": {
      "command": "npx",
      "args": ["-y", "@dcprotocol/mcp"]
    },
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed"]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your-token"
      }
    }
  }
}

Local Development

Point to local development build:

# Clone and build
git clone https://github.com/1lystore/dcp.git
cd dcp/packages/dcp-mcp
npm install
npm run build

# Configure Claude Desktop to use local build
{
  "mcpServers": {
    "dcp-vault-dev": {
      "command": "node",
      "args": ["/path/to/dcp/packages/dcp-mcp/dist/index.js"]
    }
  }
}

Debugging

View MCP Logs

Claude Desktop logs MCP server output:

# macOS
tail -f ~/Library/Logs/Claude/mcp*.log

# Windows
Get-Content $env:APPDATA\Claude\Logs\mcp*.log -Wait

# Look for DCP-specific logs
grep "dcp-vault" ~/Library/Logs/Claude/mcp*.log

Test MCP Server

Run server standalone to test:

# Terminal 1: Run server with debug logging
DCP_MCP_LOG_LEVEL=debug npx @dcprotocol/mcp

# Terminal 2: Send test messages (requires MCP inspector tool)
npx @modelcontextprotocol/inspector npx @dcprotocol/mcp

Common Issues

Server Not Appearing in Claude Desktop

# Check config syntax
cat ~/Library/Application\ Support/Claude/claude_desktop_config.json | jq

# Restart Claude Desktop completely
# (Quit from menu, don't just close window)

# Check logs for errors
tail -f ~/Library/Logs/Claude/mcp*.log

Vault Locked Error

# If vault is locked, unlock via CLI first
dcp status
# Password: ********

# Or configure longer session timeout
export DCP_CLI_SESSION_MINUTES=120

Permission Denied

# Ensure vault exists
dcp status

# If not initialized
dcp init

# Create wallet
dcp wallet create solana

Security Considerations

  • Consent required: All sensitive operations require explicit approval
  • Local-only: MCP runs on your machine, no cloud access
  • Audit trail: All operations logged in vault
  • Budget limits: Automatic enforcement of spending limits
  • Session-based: Vault locks after inactivity

Best Practices

  • Don't blindly approve - read each consent request
  • Use trusted mode only for AI you fully control
  • Set conservative budget limits initially
  • Review activity regularly: "Show me vault activity"
  • Revoke access if you stop using Claude Desktop: dcp agents revoke "Claude Desktop"

Comparison with Other Packages

PackageUse Case
@dcprotocol/mcpClaude Desktop, Cursor - MCP protocol
@dcprotocol/serverLocal agents - REST API
@dcprotocol/clientCustom agents - Native SDK
@dcprotocol/cliManual vault management

See Also