Solana Web3.js MCP Server

by FrankGenGo

174 downloads Not rated yet
GitHub

About

MCP server for Solana web3.js development and smart contract deployment

Explore

- Interact with Solana blockchain across mainnet, testnet, devnet.
- Build, simulate, sign, and send transactions.
- Develop smart contracts using Rust and Solana SDK.
- Manage wallets, generate keypairs, and derive addresses.
- Create, transfer, and manage SPL tokens.
- Access documentation and code templates as resources.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Solana Web3.js MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository


npm install

1. Install Claude Desktop

2. Add the following to your Claude Desktop configuration file:

On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%\Claude\claude_desktop_config.json

json
{
"mcpServers": {
"solana": {
"command": "node",
"args": ["/absolute/path/to/solana-web3js-mcp-server/dist/index.js"]
}
}
}

3. Restart Claude Desktop

4. You can now ask Claude to perform Solana-related tasks, such as:
- "Create a new Solana account and show me the keypair"
- "What's the current balance of address X?"
- "Help me write and deploy a simple token contract on Solana devnet"

- getConfig: Get current configuration settings
- setConfig: Update configuration parameters
- getClusterVersion: Get Solana cluster version

The test suite includes integration tests that run against the Solana devnet. To set up your environment for testing:

1. Install Solana CLI: Follow the official installation instructions

2. Generate a test keypair:

bash
mkdir -p ~/solana-web3js-tests
solana-keygen new --force --no-bip39-passphrase -o ~/solana-web3js-tests/test-keypair.json

3. Fund the test keypair with devnet SOL:
bash
solana airdrop 1 $(solana address -k ~/solana-web3js-tests/test-keypair.json) --url devnet

4. Verify the balance:
bash
solana balance -k ~/solana-web3js-tests/test-keypair.json --url devnet
```

The test suite will automatically use this keypair for integration tests against devnet.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "solana web3.js mcp server": {
            "solana": {
                "command": "node",
                "args": [
                    "/absolute/path/to/solana-web3js-mcp-server/dist/index.js"
                ]
            }
        }
    }
}

McpServers

{
    "solana": {
        "command": "node",
        "args": [
            "/absolute/path/to/solana-web3js-mcp-server/dist/index.js"
        ]
    }
}

A Model Context Protocol (MCP) server that enables AI assistants like Claude to develop and deploy Solana smart contracts end-to-end. This server acts as a bridge between AI language models and the Solana blockchain, providing a standardized interface for blockchain interactions.

> Important Update: This project is currently being migrated from Solana web3.js v1.x to v2.0 to take advantage of improved performance, better type safety, and modern functional programming patterns. See the migration plan for details.

What is MCP?

The Model Context Protocol (MCP) is an open standard that allows AI assistants to access external tools and data sources in a secure, controlled manner. This server implements the MCP specification to expose Solana blockchain functionality to AI assistants.

What This Server Does

This MCP server provides AI assistants with the ability to:

1. Interact with the Solana Blockchain: Query account data, check balances, view transaction history, and get network status from various Solana clusters (mainnet, testnet, devnet)

2. Create and Manage Transactions: Build, simulate, sign, and send transactions to the Solana blockchain with proper error handling and fee estimation

3. Develop Smart Contracts: Access templates, compile, test, and deploy Solana programs written in Rust using the Solana SDK or Pinocchio framework

4. Manage Wallets and Keys: Generate keypairs, derive addresses, and interact with wallet adapters while maintaining security best practices

5. Work with Tokens: Create, transfer, and manage SPL tokens and token accounts

Architecture

The server exposes three types of MCP capabilities:

- Tools: Functions that perform actions like sending transactions, deploying programs, or generating keypairs
- Resources: Data sources such as documentation, code templates, and blockchain state information
- Prompts: Templates for guiding the AI through complex workflows like smart contract development

All blockchain interactions are performed through the @solana/web3.js library and related SDKs, with the MCP server acting as a secure intermediary between the AI and the blockchain.

Installation

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.