> ## 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.

# AI-assisted development

> Build Phantom integrations faster with AI tools that understand our SDKs

Your AI coding assistant can search Phantom documentation for accurate, up-to-date answers while you build.

## AI tools

<CardGroup cols={2}>
  <Card title="Phantom Cursor plugin" icon="puzzle-piece" href="/resources/cursor-plugin">
    All-in-one plugin with subagents, skills, rules, and MCP servers for Cursor
  </Card>

  <Card title="Phantom MCP server" icon="robot" href="/phantom-mcp-server">
    Interact with Phantom embedded wallets through natural language
  </Card>

  <Card title="Phantom Connect SDK MCP server" icon="server" href="/resources/mcp-server">
    Get accurate Phantom developer guidance in your AI coding assistant
  </Card>

  <Card title="Cursor AI prompts" icon="terminal" href="/resources/cursor-prompts">
    One-shot prompts for complete Phantom SDK implementations
  </Card>
</CardGroup>

<Info>
  **Claude integration**: Every documentation page includes an "Open in Claude" button in the contextual menu for quick implementation help.
</Info>

## Phantom Cursor plugin

The [Phantom Cursor plugin](https://cursor.com/marketplace/phantom) is the fastest way to start building with Phantom in Cursor. It bundles subagents, skills, rules, and MCP servers into a single install so your AI agent can scaffold projects, write integration code, execute wallet operations, and follow Phantom best practices automatically.

Install it from the [Cursor Marketplace](https://cursor.com/marketplace/phantom) or by searching for `phantom-connect` in Cursor's **Add Plugin** command.

The plugin includes:

* Two subagents for integration code generation and wallet operations
* Seven skills for scaffolding React, React Native, and Browser SDK projects
* Three rules for SDK best practices and transaction safety
* Two MCP servers for documentation search and wallet operations

<Card title="Full Cursor plugin documentation" icon="puzzle-piece" href="/resources/cursor-plugin">
  Installation guide, included capabilities, and usage examples
</Card>

## MCP server

The Phantom MCP server (`@phantom/mcp-server`) lets AI assistants 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 on Hyperliquid across Solana, Ethereum, Bitcoin, and Sui.

### Quick setup (Claude Desktop)

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

You need an App ID from [Phantom Portal](https://phantom.com/portal) before getting started.

<Card title="Full MCP server documentation" icon="robot" href="/phantom-mcp-server">
  Complete setup guides, available tools, and supported networks
</Card>

## Phantom Connect SDK MCP server

The Phantom Connect SDK MCP server connects AI coding assistants to Phantom developer documentation. Your AI assistant can answer questions and generate code with accurate, up-to-date context.

### Setup

| Tool        | One-click                                  | Manual                                                                      |
| ----------- | ------------------------------------------ | --------------------------------------------------------------------------- |
| Cursor      | Click "Connect to Cursor" on any docs page | Add to `~/.cursor/mcp.json`                                                 |
| VS Code     | Click "Connect to VS Code"                 | Add to `.vscode/mcp.json`                                                   |
| Claude.ai   | —                                          | Add connector in Settings                                                   |
| Claude Code | —                                          | `claude mcp add --transport http phantom-docs https://docs.phantom.com/mcp` |

### Configuration

Add this configuration to your MCP settings:

```json title="mcp.json" theme={null}
{
  "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?"

<Card title="Full Phantom Connect SDK MCP server documentation" icon="server" href="/resources/mcp-server">
  Complete setup guides for all supported tools
</Card>

## Cursor AI prompts

Use one-shot prompts with Cursor AI to generate Phantom SDK implementations. Each prompt covers wallet connection, message signing, and transaction handling.

### Available prompts

| SDK              | What it generates                                                   |
| ---------------- | ------------------------------------------------------------------- |
| React SDK        | Complete app with wallet connection, message signing, SOL transfers |
| React Native SDK | Mobile app with Expo, OAuth flow, native wallet functionality       |
| Browser SDK      | Vanilla JS implementation for any web framework                     |

### How to use

<Steps>
  <Step title="Get App ID from Phantom Portal">
    Visit [Phantom Portal](/phantom-portal/get-app-id) to get your App ID before using any prompt.
  </Step>

  <Step title="Copy prompt for your SDK">
    Open the [Cursor AI prompts page](/resources/cursor-prompts) and copy the prompt for your preferred SDK (React, React Native, or Browser).
  </Step>

  <Step title="Replace placeholders">
    Replace `[YOUR_APP_ID]` and `[YOUR_REDIRECT_URL]` (or `[YOUR_SCHEME]` for React Native) with your actual values.
  </Step>

  <Step title="Paste into Cursor">
    Open Cursor AI, press `Cmd+K` (or `Ctrl+K` on Windows), and paste the complete prompt.
  </Step>

  <Step title="Review and run">
    Cursor will generate a full implementation. Review the code, then run and test your integration.
  </Step>
</Steps>

<Card title="View all Cursor prompts" icon="terminal" href="/resources/cursor-prompts">
  Get prompts for React, React Native, and Browser SDKs
</Card>

## Best practices

### Provide context

Give your AI assistant 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

<Warning>
  **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.
</Warning>

**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

<CardGroup cols={2}>
  <Card title="Phantom Cursor plugin" icon="puzzle-piece" href="/resources/cursor-plugin">
    All-in-one plugin with subagents, skills, rules, and MCP servers
  </Card>

  <Card title="Phantom MCP server" icon="robot" href="/phantom-mcp-server">
    Interact with Phantom embedded wallets through natural language
  </Card>

  <Card title="Phantom Connect SDK MCP server" icon="server" href="/resources/mcp-server">
    Get accurate Phantom developer guidance in your AI coding assistant
  </Card>

  <Card title="Cursor prompts" icon="terminal" href="/resources/cursor-prompts">
    One-shot prompts for all Phantom SDKs
  </Card>

  <Card title="SDK comparison guide" icon="code" href="/wallet-sdks-overview">
    Choose the right SDK for your application
  </Card>
</CardGroup>
