MCP Server

Use MARC Protocol directly from Claude, ChatGPT, or any MCP-compatible LLM.

Overview

The MARC Protocol MCP Server exposes 6 tools via the Model Context Protocol, enabling AI agents (Claude, ChatGPT, Gemini) to make encrypted payments directly through conversation.

Package: @marc-protocol/mcp-server

Setup

Claude Desktop

Add to your Claude Desktop claude_desktop_config.json:

claude_desktop_config.jsonjson
{
  "mcpServers": {
    "marc-protocol": {
      "command": "npx",
      "args": ["@marc-protocol/mcp-server"],
      "env": {
        "PRIVATE_KEY": "0xYOUR_PRIVATE_KEY"
      }
    }
  }
}

Environment Variables

VariableRequiredDefaultDescription
PRIVATE_KEYYes-Wallet private key (hex)
CHAIN_IDNo11155111Chain ID
RPC_URLNoChain defaultRPC endpoint override
FHEVM_GATEWAY_URLNohttps://gateway.zama.aiZama gateway URL

Available Tools

marc_wrap

Wrap USDC into encrypted cUSDC.

{
  "tool": "marc_wrap",
  "params": {
    "amount": "10000000",  // 10 USDC (6 decimals)
    "to": "0x..."          // optional, defaults to wallet
  }
}

marc_transfer

Send encrypted cUSDC to another address. Amount is FHE-encrypted — invisible on-chain.

{
  "tool": "marc_transfer",
  "params": {
    "to": "0xRECIPIENT",
    "amount": "1000000"    // 1 USDC
  }
}

marc_unwrap

Request unwrap of cUSDC back to plaintext USDC (initiates 2-step KMS process).

{
  "tool": "marc_unwrap",
  "params": {
    "amount": "5000000",   // 5 USDC
    "to": "0x..."          // optional
  }
}

marc_balance

Check USDC and cUSDC balances. Returns both plaintext USDC and encrypted cUSDC balance handle.

{
  "tool": "marc_balance",
  "params": {
    "address": "0x..."     // optional, defaults to wallet
  }
}

marc_pay

Make a full x402 payment: encrypted transfer + nonce recording in one action.

{
  "tool": "marc_pay",
  "params": {
    "to": "0xSERVER",
    "amount": "1000000",
    "nonce": "0x..."       // optional, auto-generated
  }
}

marc_info

Get protocol information: contract addresses, chain ID, wallet address, scheme details.

{
  "tool": "marc_info",
  "params": {}
}

Example Conversation

User

Wrap 10 USDC into cUSDC and then pay 1 USDC to 0xAbC...123

Claude (uses marc_wrap, then marc_pay)

Done. I wrapped 10 USDC into 9.99 cUSDC (0.1% fee) and sent 1 cUSDC to 0xAbC...123. The transfer amount is encrypted on-chain. TX: 0x...

Architecture

The MCP server uses stdio transport and lazy-loads the FHE instance from @zama-fhe/relayer-sdk (peer dependency). If the FHE SDK is not installed, tools that require encryption will return a clear error message.

LLM (Claude/GPT)  ←→  MCP Client  ←→  MCP Server (stdio)
                                            ↓
                                     ethers + fhevmjs
                                            ↓
                                     Ethereum Sepolia