MAGENT

Stdio client

MCP server

One local stdio process for Cursor, Claude Desktop, VS Code, and any MCP host that can spawn stdio. Magent is HTTP + x402; this package is the client.

Set X402_PRIVATE_KEY to a 32-byte hex key (0x + 64 hex) for a wallet with USDC on Base. Each tool call is one paid GET: magent returns HTTP 402, the process signs x402 v2 exact (EIP-3009) on Base, settles, then returns JSON. HTTP 400 does not charge. HTTP 402 is unpaid. HTTP 503 is settlement uncertainty — a new MCP call signs a new payment.

Config

Same JSON for Cursor, Claude Desktop, and VS Code. The spending key never appears in magent logs.

{
  "mcpServers": {
    "magent": {
      "args": [
        "-y",
        "@magent/mcp"
      ],
      "command": "npx",
      "env": {
        "X402_PRIVATE_KEY": "0xYOUR_SPENDING_KEY"
      }
    }
  }
}

What this is not

  • Not a medical device. A licensed clinician remains responsible for care.
  • Calculator inputs are PHI-adjacent. The MCP host sees them. This process does not print the key, query, body, or payer.
  • Ping (catalog status smoke) and offline paths are not registered.
  • Same-path POST bulk is not registered in v1. HTTP agents use @x402/fetch against the catalog.

HTTP agents

Hosts that cannot spawn stdio keep using @x402/fetch against https://api.magentlab.com/v1/catalog. The pay handshake is unchanged: Payments.