Skip to content

MCP Configuration ​

JarvisClaw exposes an MCP (Model Context Protocol) server. Connect from Claude Code, Cursor, Windsurf, or any MCP client to use AI models as tools.

Authentication ​

MethodHeaderUse case
API KeyAuthorization: Bearer sk-...Pre-paid account
x402 USDCPAYMENT-SIGNATURE: ...No account, wallet direct pay

Discovery methods (initialize, tools/list, resources/list) are free — no auth needed. Only tools/call requires payment.

Claude Code ​

Add to ~/.claude.json:

json
{
  "mcpServers": {
    "jarvisclaw": {
      "type": "url",
      "url": "https://api.jarvisclaw.ai/mcp",
      "headers": {
        "Authorization": "Bearer sk-your-api-key"
      }
    }
  }
}

After config, these tools appear automatically:

ToolDescription
list_modelsList all available AI models
chatCall any model (OpenAI-compatible)
search_apisSearch user-published APIs
get_api_detailGet API endpoint details
discover_agentsFind other registered agents
aip_resolveRank providers for an intent
aip_execute_with_budgetExecute an intent under a hard budget cap
aip_list_intentsList supported intent types
aip_estimate_costEstimate cost before executing
uapi_{slug}Call a specific user API directly

Cursor / Windsurf ​

Add to .cursor/mcp.json in your project root:

json
{
  "mcpServers": {
    "jarvisclaw": {
      "url": "https://api.jarvisclaw.ai/mcp",
      "headers": {
        "Authorization": "Bearer sk-your-api-key"
      }
    }
  }
}

Programmatic Usage ​

MCP uses JSON-RPC 2.0 over HTTP. Connect directly:

python
import httpx

# 1. Initialize (no auth needed)
resp = httpx.post("https://api.jarvisclaw.ai/mcp", json={
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
        "protocolVersion": "2025-03-26",
        "capabilities": {},
        "clientInfo": {"name": "my-agent", "version": "1.0"}
    }
})

# 2. List tools (no auth needed)
resp = httpx.post("https://api.jarvisclaw.ai/mcp", json={
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/list"
})

# 3. Call a tool (auth required)
resp = httpx.post("https://api.jarvisclaw.ai/mcp",
    headers={"Authorization": "Bearer sk-your-api-key"},
    json={
        "jsonrpc": "2.0",
        "id": 3,
        "method": "tools/call",
        "params": {
            "name": "chat",
            "arguments": {
                "model": "gpt-4o",
                "messages": [{"role": "user", "content": "Hello!"}]
            }
        }
    }
)
print(resp.json()["result"]["content"][0]["text"])

x402 Payment via MCP ​

Agents with a USDC wallet can pay per call without an account:

Agent                        JarvisClaw MCP
  │                                │
  │── tools/call (no auth) ──────> │
  │<── error: payment required ──  │  (price, payTo, network)
  │                                │
  │  [sign USDC x402 payment]      │
  │                                │
  │── tools/call + PAYMENT-SIG ──> │
  │<── tool result ──────────────  │
python
# Call without payment → get price info
resp = httpx.post("https://api.jarvisclaw.ai/mcp", json={
    "jsonrpc": "2.0", "id": 3,
    "method": "tools/call",
    "params": {"name": "chat", "arguments": {"model": "gpt-4o", "messages": [...]}}
})
# → error with payment details (amount, payTo, network)

# Sign x402 payment, then retry with PAYMENT-SIGNATURE header
resp = httpx.post("https://api.jarvisclaw.ai/mcp",
    headers={"PAYMENT-SIGNATURE": payment_sig},
    json={...}
)

Payment parameters:

  • Network: Base (eip155:8453)
  • Asset: USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913)
  • Facilitator: https://api.cdp.coinbase.com/platform/v2/x402