Skip to main content
Your AI coding assistant can search Phantom documentation directly, giving you accurate, up-to-date guidance while you build.

AI tools

Claude integration: Every documentation page includes an “Open in Claude” button in the contextual menu for quick implementation help.

MCP server

The Phantom MCP server (@phantom/mcp-server) enables AI assistants to interact directly with Phantom embedded wallets. AI agents can view wallet addresses, sign transactions, transfer tokens, and sign messages across Solana, Ethereum, Bitcoin, and Sui through natural language.

Quick setup (Claude Desktop)

{
  "mcpServers": {
    "phantom": {
      "command": "npx",
      "args": ["-y", "@phantom/mcp-server"],
      "env": {
        "PHANTOM_APP_ID": "your_app_id_from_portal"
      }
    }
  }
}
You need an App ID from Phantom Portal before getting started.

Full MCP server documentation

Complete setup guides, available tools, and supported networks

Phantom Connect SDK MCP server

The Phantom Connect SDK MCP server enables AI coding assistants to search and retrieve information from the Phantom developer documentation. This allows your AI assistant to provide accurate, up-to-date guidance when building Phantom integrations.

Setup

ToolOne-clickManual
CursorClick “Connect to Cursor” on any docs pageAdd to ~/.cursor/mcp.json
VS CodeClick “Connect to VS Code”Add to .vscode/mcp.json
Claude.aiAdd connector in Settings
Claude Codeclaude mcp add --transport http phantom-docs https://docs.phantom.com/mcp

Configuration

Add this configuration to your MCP settings:
mcp.json
{
  "mcpServers": {
    "phantom-docs": {
      "type": "sse",
      "url": "https://docs.phantom.com/mcp"
    }
  }
}

Example prompts

Once configured, try asking your AI assistant:
  • “How do I set up Phantom Connect in a React app?”
  • “Show me how to sign a message with the Browser SDK.”
  • “What’s the process for verifying a domain in Phantom Portal?”
  • “How do I handle transaction errors in React Native?”

Full Phantom Connect SDK MCP server documentation

Complete setup guides for all supported tools

Cursor AI prompts

Use one-shot prompts with Cursor AI to generate complete, production-ready Phantom SDK implementations. These prompts create full applications with wallet connection, message signing, and transaction handling.

Available prompts

SDKWhat it generates
React SDKComplete app with wallet connection, message signing, SOL transfers
React Native SDKMobile app with Expo, OAuth flow, native wallet functionality
Browser SDKVanilla JS implementation for any web framework

How to use

1

Get App ID from Phantom Portal

Visit Phantom Portal to get your App ID before using any prompt.
2

Copy prompt for your SDK

Open the Cursor AI prompts page and copy the prompt for your preferred SDK (React, React Native, or Browser).
3

Replace placeholders

Replace [YOUR_APP_ID] and [YOUR_REDIRECT_URL] (or [YOUR_SCHEME] for React Native) with your actual values.
4

Paste into Cursor

Open Cursor AI, press Cmd+K (or Ctrl+K on Windows), and paste the complete prompt.
5

Review and run

Cursor will generate a full implementation. Review the code, then run and test your integration.

View all Cursor prompts

Get prompts for React, React Native, and Browser SDKs

Best practices

Provide context

Give your AI assistant enough context to generate accurate code. Include:
  • Your target framework (React, React Native, or vanilla JS).
  • Specific features you need (wallet connection, transactions, message signing).
  • General app structure and requirements.
Security best practice: Avoid sharing sensitive information like App IDs, redirect URLs, or API keys with AI assistants. Use placeholders like [YOUR_APP_ID] in prompts, then replace them with actual values in your code after generation.
Example of a good prompt:
I'm building a React app with Phantom Connect. I need to:
1. Connect a wallet using social login
2. Sign messages for authentication
3. Send SOL transactions

I'll replace [YOUR_APP_ID] and [YOUR_REDIRECT_URL] placeholders with my actual values after the code is generated.

Combine tools

Use MCP server for questions and documentation lookups, then use Cursor prompts for scaffolding complete implementations:
  1. Ask questions first: Use MCP server to understand concepts (“How does Phantom Connect authentication work?”).
  2. Generate code: Use Cursor prompts to scaffold your implementation.
  3. Refine with MCP: Ask follow-up questions to customize the generated code.

Verify generated code

Always review AI-generated code before deploying:
  • Check App ID matches your Phantom Portal app.
  • Verify redirect URLs are allowlisted in Phantom Portal.
  • Ensure error handling is present for all async operations.
  • Confirm lamports are calculated correctly (1 SOL = 1,000,000,000 lamports).
  • Test wallet connection flow end-to-end.
  • Validate transaction amounts and recipient addresses.

Resources