Skip to main content
The Phantom MCP server (@phantom/mcp-server) enables AI assistants like Claude to interact with Phantom embedded wallets through natural language. AI agents can view wallet addresses, sign transactions, transfer tokens, swap tokens, rebalance portfolios, and trade perps across Solana, Ethereum, Bitcoin, and Sui.
Looking for the MCP server that gives your AI coding assistant access to Phantom developer documentation? See the Phantom Connect SDK MCP server documentation.
Monad support has been deprecated.
Sui support has been deprecated.

Features

  • Device-code authentication: Browser-based Phantom sign-in with device authorization. No App ID or Phantom Portal setup required.
  • Dedicated agent wallets: Each agent gets its own wallet on authentication — separate from your personal wallet.
  • Session persistence: Automatic session management with stamper keys stored in ~/.phantom-mcp/session.json.
  • Session refresh: On HTTP 401, the shared CLI wrapper refreshes the session once and retries that call. If the refresh fails, it clears the local session and returns AUTH_EXPIRED. Call login, then retry the tool yourself. A submission failure (submission-failed or error code -32009) does not clear the session. In @phantom/cli@3.0.0, wallet_addresses catches the client error and throws a new error that keeps only the message, so that wrapper never sees the 401. The call fails as Failed to get wallet addresses: ... with no refresh and no AUTH_EXPIRED. The sign, send, and transfer handlers in that release do the same. This is a defect in the published package.
  • Multi-chain support: Works with Solana, supported EVM networks, Bitcoin, and Sui networks. Sui support has been deprecated. Arbitrum sends are rejected by evm_send, transfer, buy, and perps_deposit; it remains valid for perps withdrawals. BNB Smart Chain (eip155:56) is unsupported. See the supported networks.
  • Simulation-first wallet flows:
    • solana_send, evm_send, and transfer can preview asset changes and warnings before submitting.
  • 30 wallet, swap, and perp tools. See the tool reference for full parameter documentation.
    • Wallet: wallet_status, wallet_addresses, wallet_balances, price, transfer, solana_send, evm_send, solana_sign, evm_sign, evm_sign-typed, simulate, evm_allowance, login, logout, pay.
    • Swaps: buy (Solana, supported EVM networks, and cross-chain, no fees), wallet_rebalance (no fees).
    • Perps: perps_markets, perps_account, perps_positions, perps_orders, perps_history, perps_deposit, perps_open, perps_close, perps_cancel, perps_leverage, perps_transfer, perps_withdraw, perps_withdraw-hl-spot.

Installation

Use npx to run the server without global installation. This ensures you always use the latest version:

Option 2: Global install

Install the package globally for faster startup:
Then run:

Setup guides

Add the MCP server to your Claude Desktop configuration file.Configuration file location:
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json
Using npx (recommended):
Using global install:
After updating the config, restart Claude Desktop to load the server.

Environment variables

Most users do not need to set any environment variables. The following optional variables are available for advanced use:

Authentication flow

On first run, the server will:
  1. Start Phantom’s device authorization flow.
  2. Open your default browser so you can sign in with Google or Apple and approve the wallet session.
  3. Save your session to ~/.phantom-mcp/session.json.
Sessions persist across restarts. wallet_status only tells you that this file exists. The first wallet tool call after the server starts checks the stored session with Phantom. If Phantom rejects it with HTTP 401 or 403, the server opens the browser sign-in again and continues that call after you approve. After that startup check, when a tool lets the HTTP 401 reach the shared wrapper, the CLI refreshes once and then returns AUTH_EXPIRED. Call login and retry the original tool. In @phantom/cli@3.0.0, wallet_addresses and the sign, send, and transfer handlers replace that HTTP error before the wrapper sees it, so a rejected session on those calls does not refresh or return AUTH_EXPIRED. A submission error does not mean the session expired.

Tool reference

Parameters and examples for the current toolset

Agent wallets

Agents receive a new dedicated wallet when they authenticate — they do not connect to your existing personal wallet.

Agent wallets and your existing accounts

Why your agent gets a new wallet when you sign in, and how to access your existing Phantom accounts.
If you previously used @phantom/mcp-server version 0.2.4 or earlier, the wallet model has changed:
  • Existing prompts or workflows that assumed access to your personal wallet may no longer behave the same way.
  • Newly authenticated agents must be funded before they can transfer tokens, swap, or perform other on-chain actions.
  • Use wallet_addresses after authenticating to check the agent’s wallet address. Before funding it, confirm that the intended operation supports the network. BNB Smart Chain (eip155:56) is unsupported; an EVM address can receive BSC assets that the MCP cannot move. Balance visibility and quote availability do not prove sending support.

Session management

Sessions are stored in ~/.phantom-mcp/session.json and contain wallet and organization identifiers, stamper keys, and user authentication details. Sessions persist indefinitely until explicitly deleted. Resetting your session removes the local MCP credentials without deleting the wallet or its on-chain funds. To reset your session, run:
Then restart your AI assistant. The server will re-authenticate on next use.

Security

  • Device-code authentication: Secure browser-based sign-in flow with no local callback server.
  • Session security: Session files have restrictive Unix permissions (user-only read/write, 0o600).
  • Request signing: OIDC stamper signs KMS requests to prevent tampering.
  • HTTPS: All API requests use HTTPS.

Testing

Test the server directly using the MCP inspector:
This opens an interactive web UI where you can test tool calls without an AI assistant.

Troubleshooting

  • Ensure you have a default browser configured.
  • Manually visit the URL shown in the logs.
  • Check if the open command works in your terminal: open https://phantom.app.
The server asks you to authenticate every time.Solutions:
  • Check session file exists: ls -la ~/.phantom-mcp/session.json.
  • Verify file permissions: chmod 600 ~/.phantom-mcp/session.json.
  • Ensure ~/.phantom-mcp directory has correct permissions: chmod 700 ~/.phantom-mcp.
Claude Desktop doesn’t show the Phantom tools.Solutions:
  1. Verify the config file contains valid JSON.
  2. Check Claude Desktop logs:
    • macOS: ~/Library/Logs/Claude/.
    • Windows: %APPDATA%/Claude/logs/.
  3. Restart Claude Desktop after config changes.
  4. Test the server manually with the MCP inspector (see the Testing section).
Session exists but is rejected by the API.Solutions:
  • Delete the session file: rm ~/.phantom-mcp/session.json.
  • Restart your AI assistant and re-authenticate when prompted.

Phantom Cursor plugin

All-in-one Cursor plugin with subagents, skills, rules, and both MCP servers

Phantom Connect SDK MCP server

Get accurate Phantom developer guidance in your AI coding assistant

Phantom Portal

Manage your apps and SDK configuration

SDK overview

Choose the right SDK for your application

Developer support

Contact the Phantom developer support team