@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.
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. Calllogin, then retry the tool yourself. A submission failure (submission-failedor error code-32009) does not clear the session. In@phantom/cli@3.0.0,wallet_addressescatches the client error and throws a new error that keeps only the message, so that wrapper never sees the 401. The call fails asFailed to get wallet addresses: ...with no refresh and noAUTH_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, andperps_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, andtransfercan 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.
- Wallet:
Installation
Option 1: npx (recommended)
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:Setup guides
- Claude Desktop
- Cursor
- Claude Code
Add the MCP server to your Claude Desktop configuration file.Configuration file location:Using global install:After updating the config, restart Claude Desktop to load the server.
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%/Claude/claude_desktop_config.json
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:- Start Phantom’s device authorization flow.
- Open your default browser so you can sign in with Google or Apple and approve the wallet session.
- Save your session to
~/.phantom-mcp/session.json.
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
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.
@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_addressesafter 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:
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:Troubleshooting
Browser doesn't open during authentication
Browser doesn't open during authentication
- Ensure you have a default browser configured.
- Manually visit the URL shown in the logs.
- Check if the
opencommand works in your terminal:open https://phantom.app.
Session not persisting
Session not persisting
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-mcpdirectory has correct permissions:chmod 700 ~/.phantom-mcp.
MCP server not loading in Claude Desktop
MCP server not loading in Claude Desktop
Claude Desktop doesn’t show the Phantom tools.Solutions:
- Verify the config file contains valid JSON.
- Check Claude Desktop logs:
- macOS:
~/Library/Logs/Claude/. - Windows:
%APPDATA%/Claude/logs/.
- macOS:
- Restart Claude Desktop after config changes.
- Test the server manually with the MCP inspector (see the Testing section).
Invalid session error
Invalid session error
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.
Related resources
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