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

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# Build with AI agents

> Connect your coding agent to the Solana MCP server and install the Solana skill, so it works from current Solana docs instead of memory.

<div className="sol-agent-banner not-prose">
<div className="sol-agent-banner-text">
<p className="sol-agent-banner-title">Set up your coding agent for Solana</p>
<p className="sol-agent-banner-desc">Paste one line into your coding agent. It installs the Solana MCP server and the Solana skill.</p>
</div>
<div className="sol-agent-banner-copy">
<code className="sol-agent-banner-line">Set up Solana for me: fetch and follow this guide <span className="sol-agent-banner-url">https://solana.com/developers/docs/intro/agent-setup.md</span></code>
</div>
</div>

Coding agents such as Claude Code, Codex, and Cursor often learn Solana from
out-of-date training data. The Solana MCP server lets your agent look up
current docs while it works, and the Solana skill teaches it current APIs and
conventions.

To build an AI agent that holds a wallet and transacts onchain, see
[Build onchain AI agents](/developers/docs/tools/ai) instead.

## Add the Solana MCP server

Run this in your project folder:

```bash Terminal
npx add-mcp https://mcp.solana.com/mcp -n solana-mcp -g -y
```

add-mcp detects the coding agents you use and adds the server to each one.

To set up one agent yourself, use its tab:

<Tabs>
  <Tab title="Claude Code">
    ```bash Terminal
    claude mcp add --transport http solana-mcp https://mcp.solana.com/mcp
    ```

    Run `/mcp` in Claude Code to check that `solana-mcp` is connected.
  </Tab>
  <Tab title="Codex">
    ```bash Terminal
    codex mcp add solana-mcp --url https://mcp.solana.com/mcp
    ```

    Run `codex mcp list` to check that `solana-mcp` is listed.
  </Tab>
  <Tab title="Cursor">
    Add this to `~/.cursor/mcp.json` for every project, or to
    `.cursor/mcp.json` for one project:

    ```json mcp.json
    {
      "mcpServers": {
        "solana-mcp": {
          "url": "https://mcp.solana.com/mcp"
        }
      }
    }
    ```
  </Tab>
  <Tab title="VS Code">
    In the Command Palette, run **MCP: Open User Configuration**, then add:

    ```json mcp.json
    {
      "servers": {
        "solana-mcp": {
          "type": "http",
          "url": "https://mcp.solana.com/mcp"
        }
      }
    }
    ```
  </Tab>
  <Tab title="Windsurf">
    Add this to `~/.codeium/windsurf/mcp_config.json`:

    ```json mcp_config.json
    {
      "mcpServers": {
        "solana-mcp": {
          "serverUrl": "https://mcp.solana.com/mcp"
        }
      }
    }
    ```
  </Tab>
</Tabs>

The server needs no API key. It searches the Solana docs, the Anchor docs, and
other Solana sources, and checks Anchor and Pinocchio program code for security
issues. The [Solana MCP site](https://mcp.solana.com/) lists every tool and has
project instructions you can add to `AGENTS.md` or `CLAUDE.md`.

## Install the Solana skill

```bash Terminal
npx skills add https://github.com/solana-foundation/solana-dev-skill
```

The skill installs into your project, where most coding agents pick it up.
Browse more workflows in the [Solana skills library](https://solana.com/skills).

## Try it

Ask your agent a Solana question or give it a task. A good first one is "Follow
the Solana Quickstart with me": the [Quickstart](/developers/docs/quickstart) sends test
dollars, creates an asset, sends it to someone, and freezes their account, on
devnet.
