Solana Blockchain MCP server

Enables Claude to interact with the Solana blockchain through specialized tools for retrieving validator information, estimating fees, fetching transaction histories, and managing digital assets.
Back to servers
Provider
cryptoleek
Release date
Mar 14, 2025
Language
TypeScript
Stats
7 stars

This MCP server provides a standardized interface for AI agents to interact with the Solana blockchain. Based on the Solana Agent Kit, it enables Claude AI to perform various blockchain operations through a Model Context Protocol implementation.

Installation

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn

Installing from npm

The easiest way to install the Solana MCP server is via npm:

npm install solana-mpc

Or if you prefer using yarn:

yarn add solana-mpc

Manual Installation

To install the server manually:

  1. Clone the repository:

    git clone https://github.com/username/solana-agent-kit-mcp-server.git
    cd solana-agent-kit-mcp-server
    
  2. Install dependencies:

    npm install
    
  3. Build the project:

    npm run build
    

Configuration

Create a configuration file named config.json in your project root:

{
  "port": 3000,
  "rpcEndpoint": "https://api.mainnet-beta.solana.com",
  "defaultCommitment": "confirmed",
  "rateLimiting": {
    "enabled": true,
    "maxRequests": 100,
    "timeWindow": 60000
  }
}

Configuration Options

  • port: The port on which the MCP server will run
  • rpcEndpoint: Solana RPC endpoint (mainnet, testnet, or devnet)
  • defaultCommitment: Transaction confirmation level
  • rateLimiting: Settings to prevent abuse of the server

Running the Server

Start the MCP server:

npm start

For development with auto-reloading:

npm run dev

Available Actions

The MCP server provides several actions for interacting with the Solana blockchain:

Validator Information

// Example request to get validator information
const response = await fetch('http://localhost:3000/mcp', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    action: 'GET_VALIDATOR_INFO',
    params: {
      limit: 10
    }
  })
});

const data = await response.json();

Transaction Fee Estimation

// Example request to estimate transaction fees
const response = await fetch('http://localhost:3000/mcp', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    action: 'GET_PRIORITY_FEE_ESTIMATE',
    params: {
      priorityLevel: 'medium'
    }
  })
});

const data = await response.json();

Transaction History

// Example request to get transaction history
const response = await fetch('http://localhost:3000/mcp', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    action: 'GET_TRANSACTION_HISTORY',
    params: {
      address: 'wallet_address_here',
      limit: 20,
      before: 'optional_signature_for_pagination'
    }
  })
});

const data = await response.json();

Security Information

// Example request to get security.txt information
const response = await fetch('http://localhost:3000/mcp', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    action: 'GET_SECURITY_TXT',
    params: {
      programId: 'program_address_here'
    }
  })
});

const data = await response.json();

Additional Functions

The server also supports other core Solana operations:

Asset Management

// Example request to get asset information
const response = await fetch('http://localhost:3000/mcp', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    action: 'GET_ASSET',
    params: {
      assetId: 'asset_id_here'
    }
  })
});

const data = await response.json();

Token Operations

// Example request to transfer tokens
const response = await fetch('http://localhost:3000/mcp', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    action: 'TRANSFER',
    params: {
      source: 'source_wallet_address',
      destination: 'destination_wallet_address',
      amount: 1.5,
      token: 'token_address' // Optional for SOL
    }
  })
});

const data = await response.json();

Error Handling

The server returns standard HTTP status codes:

  • 200: Successful operation
  • 400: Bad request (invalid parameters)
  • 404: Resource not found
  • 429: Rate limit exceeded
  • 500: Server error

Error responses include a descriptive message to help diagnose issues.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later