mcpField
P
phantom-mcp-server

phantom-mcp-server

Local
github.com/Arbromagency-SatoFinance0Updated 2w ago

About phantom-mcp-server

phantom-mcp-server exposes IDPHANTOM payment operations as MCP tools for agents handling agent-to-agent USDC payments on Base. Its tools cover payment quotes, authorization, submission, and verification.

Key features

  1. 01Quote a payment
  2. 02Authorize payment intents
  3. 03Submit payments
  4. 04Verify payment status

Use cases

  1. 01Check payment details before authorization
  2. 02Authorize an agent-to-agent payment
  3. 03Submit an approved payment intent
  4. 04Verify whether a payment completed

MCP support

Exposes IDPHANTOM payment operations as standard MCP tools over newline-delimited JSON-RPC on stdio. The tools let MCP clients quote, authorize, submit, and verify payments.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"arbromagency-sato-phantom": {
"command": "npx",
"args": [
"-y",
"@phantomid/mcp-server"
],
"env": {
"PHANTOM_API_URL": "<PHANTOM_API_URL>",
"PHANTOM_API_KEY": "<PHANTOM_API_KEY>"
}
}
}
}
Run commandnpx -y @phantomid/mcp-server
Environment variables to set
PHANTOM_API_URLPHANTOM API base URL (default https://pay.idphantom.com)
PHANTOM_API_KEYSecretPHANTOM API key for the agent account (create via POST /v1/register — self-serve, $2 USDC on Base)

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@phantomid/mcp-server0.2.1

Tools

5

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
amountstringYesToken amount in smallest units (6 decimals for USDC), e.g. '2500000' = $2.50.
chain_idnumberYesEVM chain ID: 8453 = Base mainnet.
metadataobjectNoOptional free-form key/value object attached to the quote (surfaced in receipts).
payer_walletstringYesEVM address of the payer wallet (0x..., checksummed).
asset_contractstringYesERC-20 token contract to pay with, e.g. USDC on Base: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913.
payer_agent_idstringNoOptional A2A agent card ID of the payer, for discovery and audit.
idempotency_keystringYesUnique client-generated key; safe retries return the same quote instead of duplicating it.
recipient_walletstringYesEVM address of the recipient wallet (0x...).
recipient_agent_idstringNoOptional A2A agent card ID of the recipient.

Details

From the project README

IDPHANTOM MCP Server

@phantomid/mcp-server exposes IDPHANTOM payments as standard MCP tools so an AI agent can quote, authorize, submit, and verify agent-to-agent payments through IDPHANTOM.

Production defaults to:

https://pay.idphantom.com

Install

npx @phantomid/mcp-server

For MCP clients, configure the server command and environment:

{
  "mcpServers": {
    "phantom-id": {
      "command": "npx",
      "args": ["@phantomid/mcp-server"],
      "env": {
        "PHANTOM_API_URL": "https://pay.idphantom.com",
        "PHANTOM_API_KEY": "pk_live_..."
      }
    }
  }
}

PHANTOM_API_URL is optional when using production. PHANTOM_API_KEY is required for normal paid API usage after registration.

Self-serve tools environment (AGP-100)

The MCP tools phantom_register and phantom_authorize_budget read their signing keys only from the environment (never from command-line flags — argv leaks into shell history and process listings):

VariableUsed byPurpose
PHANTOM_PAYER_PRIVATE_KEYphantom_register (auto mode)Pays the $2 USDC registration; signs locally, never leaves the process.
PHANTOM_FUNDER_PRIVATE_KEYphantom_authorize_budgetHuman funder's key for the EIP-712 AgentWalletAuthorization.
PHANTOM_ROUTER_ADDRESSbothPhantomRouter verifying contract of the EIP-712 domain.
PHANTOM_FUNNEL_SOURCEfunnelinternal for dogfood/QA traffic (reported separately — wash volume prohibited); default external.

Without PHANTOM_PAYER_PRIVATE_KEY, phantom_register runs in manual mode: pass payer_wallet and it returns the registration challenge plus step-by-step signing instructions.

Funnel events (AGP-100 F1.4)

The server emits one JSON line per event on stderr, prefixed with [funnel]:

[funnel] {"event":"install","ts":"...","source":"external",...}

Events: install → register_start → register_complete → first_pay → repeat. Scrape these lines to build the onboarding funnel (install → register → first pay → repeat). Traffic tagged PHANTOM_FUNNEL_SOURCE=internal must be aggregated separately from external volume.

Connect Your Agent In 5 Minutes

Registration is self-serve and costs $2 USDC on Base mainnet. The CLI signs locally and never prints the private key.

export PHANTOM_PAYER_PRIVATE_KEY="0x..."
export PHANTOM_ROUTER_ADDRESS="0x..."
npx @phantomid/mcp-server init --name my-agent

The init flow calls:

  1. POST /v1/register
  2. POST /v1/intents/:id/authorize
  3. POST /v1/intents/:id/submit
  4. GET /v1/register/:reference
  5. POST /v1/register/:reference/claim

On success it prints the account id and the API key once. Store the returned key as PHANTOM_API_KEY.

Flags are supported for non-sensitive options. The payer key is environment-only (never a flag — command lines leak into shell history and process listings):

export PHANTOM_PAYER_PRIVATE_KEY="0x..."
npx @phantomid/mcp-server init \
  --api-url https://pay.idphantom.com \
  --router-address 0x... \
  --name my-agent

Tools

The server supports newline-delimited JSON-RPC over stdio.

quote_payment
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "quote_payment",
    "arguments": {
      "payer_wallet": "0x...",
      "recipient_wallet": "0x...",
      "asset_contract": "0x...",
      "amount": "1000000",
      "chain_id": 8453,
      "idempotency_key": "quote-001",
      "payer_agent_id": "buyer-agent",
      "recipient_agent_id": "seller-agent"
    }
  }
}
authorize_payment
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "authorize_payment",
    "arguments": {
      "payment_intent_id": "pi_...",
      "payer_signature": "0x..."
    }
  }
}
submit_payment
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "submit_payment",
    "arguments": {
      "payment_intent_id": "pi_..."
    }
  }
}
verify_payment
{
  "jsonrpc": "2.0",
  "id": 4,
  "method": "tools/call",
  "params": {
    "name": "verify_payment",
    "arguments": {
      "payment_intent_id": "pi_...",
      "receipt_id": "rcpt_..."
    }
  }
}

Limits

Default production policy limits are:

  • 50 USD maximum per payment
  • 500 USD maximum per day

Payments above those limits are rejected by the PHANTOM ID API.

Publish

npm publish --access public

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.