> ## Documentation Index
> Fetch the complete documentation index at: https://docs.phantom.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Phantom MCP server

> The Phantom MCP server gives AI agents a wallet. Sign transactions, transfer tokens, and interact on-chain across Solana and EVM chains.

The Phantom MCP server (`@phantom/mcp-server`) is a Phantom wallet product for users who interact through AI agents. Just like the mobile wallet and browser extension serve users who click and tap, the MCP server serves users who interact through natural language with their AI assistant.

When someone uses Claude, Cursor, or another AI agent and asks "send 10 USDC to my friend" or "swap some SOL for ETH," Phantom's MCP server is the wallet the agent uses to act on their behalf.

<Card title="Agent wallets and your existing accounts" icon="users" href="/phantom-mcp-server/account-types">
  Why your agent gets a new wallet when you sign in, and how to access your existing Phantom accounts.
</Card>

## What are you here for?

<Card title="Set up the MCP server" icon="rocket" href="/phantom-mcp-server/setup">
  Add the Phantom MCP server to Claude Desktop, Cursor, or Claude Code and get a wallet for your AI agent.
</Card>

<Card title="Use it with OpenClaw" icon="puzzle-piece" href="/phantom-mcp-server/openclaw-plugin">
  Install the Phantom OpenClaw plugin to bring the same Phantom wallet capabilities directly into OpenClaw.
</Card>

## Quick install

No App ID or Phantom Portal setup required. Add this config to your AI client:

```json theme={null}
{
  "mcpServers": {
    "phantom": {
      "command": "npx",
      "args": ["-y", "@phantom/mcp-server@latest"]
    }
  }
}
```

On first use, a browser window opens for device-code sign-in. See the [setup guide](/phantom-mcp-server/setup) for step-by-step instructions for Claude Desktop, Cursor, and Claude Code.

<Warning>
  Agents receive a **new dedicated wallet** on authentication — not your existing personal wallet. You must fund the agent's wallet before it can transact. Use `get_wallet_addresses` to find the address after setup.
</Warning>

## What agents can do

The MCP server gives agents wallet, swap, and perp-trading tools. See the [setup guide](/phantom-mcp-server/setup) and [tool reference](/phantom-mcp-server/tools) for full parameter documentation.

<Note>
  **No fees on swaps.** All swaps executed through `buy_token` and `portfolio_rebalance` are fee-free.
</Note>

**Wallet operations**

| Tool                        | Description                                                           |
| --------------------------- | --------------------------------------------------------------------- |
| `get_connection_status`     | Check if the wallet session is active                                 |
| `get_wallet_addresses`      | Get addresses for Solana, Ethereum, Bitcoin, and Sui                  |
| `get_token_balances`        | View token holdings with live USD pricing                             |
| `transfer_tokens`           | Transfer SOL, ETH, and SPL/ERC-20 tokens with a simulation-first flow |
| `send_solana_transaction`   | Simulate, sign, and broadcast Solana transactions                     |
| `send_evm_transaction`      | Simulate, sign, and broadcast EVM transactions                        |
| `sign_solana_message`       | Sign UTF-8 messages on Solana                                         |
| `sign_evm_personal_message` | EIP-191 personal message signing                                      |
| `sign_evm_typed_data`       | EIP-712 structured data signing                                       |
| `simulate_transaction`      | Preview asset changes for a transaction without submitting on-chain   |
| `get_token_allowance`       | Check ERC-20 token allowance for a spender address                    |
| `phantom_login`             | Re-authenticate, switch accounts, or refresh a session                |
| `pay_api_access`            | Pay for daily API access when quota is consumed                       |

**Swaps and portfolio**

| Tool                  | Description                                                                   |
| --------------------- | ----------------------------------------------------------------------------- |
| `buy_token`           | Swap tokens via Phantom routing (Solana, EVM, cross-chain). No fees on swaps. |
| `portfolio_rebalance` | Analyze and rebalance portfolio allocation via token swaps                    |

**Perps**

| Tool                     | Description                                                            |
| ------------------------ | ---------------------------------------------------------------------- |
| `get_perp_markets`       | List perp markets with price, funding, open interest, and max leverage |
| `get_perp_account`       | View perp account balance and available margin                         |
| `get_perp_positions`     | List open positions, leverage, PnL, and liquidation price              |
| `get_perp_orders`        | List open perp orders                                                  |
| `get_perp_trade_history` | View historical fills, fees, and closed PnL                            |
| `deposit_to_hyperliquid` | Bridge/swap into the perp account                                      |
| `open_perp_position`     | Open a long or short perp position                                     |
| `close_perp_position`    | Close a perp position fully or partially                               |
| `cancel_perp_order`      | Cancel an open perp order                                              |
| `update_perp_leverage`   | Update leverage and margin mode                                        |
| `transfer_spot_to_perps` | Move USDC from Hypercore spot to perps                                 |
| `withdraw_from_perps`    | Bridge USDC from perps directly to an external chain                   |

<Card title="Perps tools guide" icon="chart-line" href="/phantom-mcp-server/perps">
  Hyperliquid-specific funding, trading, and withdrawal flow for the Phantom MCP server.
</Card>

## Supported clients

| Client         | How to connect                                                                                           |
| -------------- | -------------------------------------------------------------------------------------------------------- |
| Claude Desktop | Add to `claude_desktop_config.json`                                                                      |
| Cursor         | Add to `~/.cursor/mcp.json` (or use the [Phantom Cursor plugin](https://cursor.com/marketplace/phantom)) |
| Claude Code    | `claude mcp add phantom -- npx -y @phantom/mcp-server@latest`                                            |

## How agent wallets sign

Agent wallets complete a Phantom Connect sign-in, then use an OIDC stamper to stamp KMS requests. KMS validates the stamp, enforces policy, and then signs and submits.

<Card title="How Phantom KMS works" icon="key" href="/sdks/guides/how-kms-works">
  Learn how KMS handles key storage and signing for agent wallets.
</Card>

## Related

<CardGroup cols={2}>
  <Card title="Phantom Connect SDKs" icon="code" href="/wallet-sdks-overview">
    Build apps with embedded wallets and social login for traditional user flows.
  </Card>

  <Card title="Phantom Connect SDK MCP server" icon="server" href="/resources/mcp-server">
    Give your AI coding assistant access to Phantom developer documentation.
  </Card>
</CardGroup>
