solana-mcp

MCP.Pizza Chef: Cubie-AI

The solana-mcp is a dedicated MCP server that connects to the Solana blockchain via RPC, exposing blockchain data and functionality in a structured, real-time format for LLMs and AI workflows. It enables developers to integrate Solana blockchain context into AI agents, facilitating blockchain-aware applications and multi-step reasoning involving Solana data.

Use This MCP server To

Expose Solana blockchain data to LLMs for real-time queries Enable AI agents to interact with Solana smart contracts Provide blockchain transaction status and history to AI workflows Integrate Solana RPC data into multi-step AI reasoning Support decentralized app development with AI context from Solana Monitor Solana network events and feed them to AI models

README

Solana MCP

A solana MCP server.

Cubie

Table of Contents

Installation

To install and use the @cubie-ai/solana-mcp package use the following command:

npm i @cubie-ai/solana-mcp

Documentation

Read the docs: DOCUMENTATION

Getting Started

Creating a Server

import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { solanaMCPServer } from "../../dist";
import { SOLANA_RPC_URL } from "./contants";

async function main() {
  await solanaMCPServer({
    transport: new StdioServerTransport(),
    config: {
      solanaRpcUrl: SOLANA_RPC_URL,
      commitment: "confirmed",
    },
  });
}

main();

Creating a client

import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
import { solanaMCPClient } from "../../dist";

const CUBIE_MINT = "2MH8ga3TuLvuvX2GUtVRS2BS8B9ujZo3bj5QeAkMpump";
async function main() {
  const transport = new StdioClientTransport({
    args: ["dist/server.js"],
    command: "node",
  });

  const client = await solanaMCPClient({
    name: "Solana MCP Client",
    version: "1.0.0",
    transport: transport,
  });

  const tools = await client.listTools();
  console.dir(tools, { depth: null });

  const supply = await client.callTool({
    name: "getTokenSupply",
    arguments: {
      mint: CUBIE_MINT,
    },
  });
  console.dir(supply, { depth: null });
}

main();

Example

Running the example will produce the following output

{
  tools: [
    {
      name: "getTokenHolders",
      description: "Get token holders for a specific mint address",
      inputSchema: {
        type: "object",
        properties: { mint: { type: "string" } },
        required: ["mint"],
        additionalProperties: false,
        $schema: "http://json-schema.org/draft-07/schema#",
      },
    },
    {
      name: "getTokenSupply",
      description: "Get the total supply of a specific token",
      inputSchema: {
        type: "object",
        properties: { mint: { type: "string" } },
        required: ["mint"],
        additionalProperties: false,
        $schema: "http://json-schema.org/draft-07/schema#",
      },
    },
    {
      name: "getTokenProgramByMintAddress",
      description: "Get the token program by mint address",
      inputSchema: {
        type: "object",
        properties: { mint: { type: "string" } },
        required: ["mint"],
        additionalProperties: false,
        $schema: "http://json-schema.org/draft-07/schema#",
      },
    },
    {
      name: "getAddressBalance",
      description: "Get the balance of a specific address",
      inputSchema: {
        type: "object",
        properties: { address: { type: "string" } },
        required: ["address"],
        additionalProperties: false,
        $schema: "http://json-schema.org/draft-07/schema#",
      },
    },
    {
      name: "getAddressHoldings",
      description: "Get the holdings of a specific address",
      inputSchema: {
        type: "object",
        properties: { address: { type: "string" } },
        required: ["address"],
        additionalProperties: false,
        $schema: "http://json-schema.org/draft-07/schema#",
      },
    },
    {
      name: "getSignaturesForAddress",
      description: "Get the signatures for a specific address",
      inputSchema: {
        type: "object",
        properties: { address: { type: "string" } },
        required: ["address"],
        additionalProperties: false,
        $schema: "http://json-schema.org/draft-07/schema#",
      },
    },
    {
      name: "getJupiterQuote",
      description: "Get a quote from Jupiter for a specific swap",
      inputSchema: {
        type: "object",
        properties: {
          inputMint: { type: "string" },
          outputMint: { type: "string" },
          amount: { type: "string" },
          slippage: { type: "string" },
        },
        required: ["inputMint", "outputMint", "amount"],
        additionalProperties: false,
        $schema: "http://json-schema.org/draft-07/schema#",
      },
    },
    {
      name: "getPrice",
      description: "Get the price of a specific token",
      inputSchema: {
        type: "object",
        properties: {
          inputMint: { type: "string" },
          outputMint: {
            type: "string",
            default: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
          },
        },
        required: ["inputMint"],
        additionalProperties: false,
        $schema: "http://json-schema.org/draft-07/schema#",
      },
    },
  ];
}
{
  content: [
    {
      type: "text",
      text: '{"amount":"999725949874932","decimals":6,"uiAmount":999725949.874932,"uiAmountString":"999725949.874932"}',
    },
  ];
}

solana-mcp FAQ

How do I install the solana-mcp server?
Install it via npm using 'npm i @cubie-ai/solana-mcp' and follow the documentation for setup.
What configuration is required to run the solana-mcp server?
You need to provide a Solana RPC URL and optionally set the commitment level (e.g., 'confirmed').
Can solana-mcp server be used with multiple LLM providers?
Yes, it is provider-agnostic and works with OpenAI, Claude, Gemini, and others.
How does solana-mcp handle real-time blockchain data?
It connects to the Solana RPC endpoint and streams blockchain state and events to the MCP client in real time.
Is solana-mcp suitable for production environments?
Yes, it is designed to be lightweight and scalable for production use with Solana blockchain data.
Does solana-mcp support custom Solana RPC endpoints?
Yes, you can configure any valid Solana RPC URL to connect to different networks or nodes.
What programming languages can interact with solana-mcp?
Primarily JavaScript/TypeScript clients are supported, but any MCP-compatible client can interact with it.
Where can I find detailed documentation for solana-mcp?
Detailed docs are available at https://cubie-ai.github.io/solana-mcp/