SVM-MCP

Integrations

  • Provides tools for checking wallet balances, fetching recent transactions, and viewing token holdings on SOON (a Solana-compatible blockchain) testnet and mainnet.

SVM-MCP: Servidor de protocolo de contexto del modelo SOON

Un servidor de Protocolo de Contexto de Modelo (MCP) que integra Claude AI con SOON y otras cadenas de bloques basadas en SVM. El servidor proporciona herramientas para consultar saldos, obtener transacciones recientes y visualizar la tenencia de tokens en la red de pruebas y la red principal de SOON, para saldos de cuentas, transacciones y tenencia de tokens.

Descripción general

Este servidor MCP está diseñado para conectar a Claude con el ecosistema SOON, lo que le permite:

  • Consultar saldos de billetera en la red de prueba y la red principal
  • Obtener las transacciones más recientes de una dirección
  • Consultar las tenencias de tokens de cualquier cuenta

La implementación actual utiliza los puntos finales RPC de SOON, pero se puede modificar fácilmente para que funcione con cualquier cadena de bloques compatible con Solana o con cualquier implementación de SVM personalizada.

Características

  • Obtener saldos : obtenga saldos de tokens nativos para cualquier dirección en la red de prueba o red principal de SOON
  • Obtener la última transacción : recupera la transacción más reciente de una dirección
  • Obtener cuentas de token : enumera todas las cuentas de token propiedad de una dirección

Prerrequisitos

  • Node.js (v16+)
  • Gestor de paquetes NPM o Bun
  • Claude Desktop (para pruebas locales)

Instalación

  1. Clonar el repositorio:
git clone https://github.com/rkmonarch/svm-mcp cd svm-mcp
  1. Instalar dependencias:
npm install # or bun install
  1. Construir el proyecto:
npm run build # or bun run build

Estructura del proyecto

La implementación del servidor principal está en src/index.ts :

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { Connection, PublicKey } from "@solana/web3.js"; import { z } from "zod"; const connectionTestnet = new Connection("https://rpc.testnet.soo.network/rpc"); const connectionMainnet = new Connection("https://rpc.mainnet.soo.network/rpc"); const server = new McpServer({ name: "svm-mcp", version: "0.0.1", capabilities: [ "get-soon-testnet-balance", "get-soon-testnet-last-transaction", "get-soon-testnet-account-tokens", "get-soon-mainnet-balance", "get-soon-mainnet-last-transaction", "get-soon-mainnet-account-tokens", ], });

Implementaciones de herramientas

Obtener equilibrio

server.tool( "get-soon-testnet-balance", "Get the balance of a address on the Soon testnet", { address: z.string().describe("The Solana address to get the balance of"), }, async ({ address }) => { try { const balance = await connectionTestnet.getBalance(new PublicKey(address)); return { content: [ { type: "text", text: `Balance: ${balance}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error getting balance: ${error instanceof Error ? error.message : String(error)}`, }, ], }; } } );

Obtener la última transacción

server.tool( "get-soon-testnet-last-transaction", "Get the last transaction of an address on the Soon testnet", { address: z .string() .describe("The Solana address to get the last transaction for"), }, async ({ address }) => { try { // Fetch the most recent transaction signatures for the address const signatures = await connectionTestnet.getSignaturesForAddress( new PublicKey(address), { limit: 1 } // Limit to just the most recent transaction ); if (signatures.length === 0) { return { content: [ { type: "text", text: "No transactions found for this address", }, ], }; } // Get the most recent transaction using its signature const latestSignature = signatures[0].signature; const transaction = await connectionTestnet.getConfirmedTransaction( latestSignature ); return { content: [ { type: "text", text: JSON.stringify(transaction), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error getting transaction: ${error instanceof Error ? error.message : String(error)}`, }, ], }; } } );

Obtener cuentas de token

server.tool( "get-soon-testnet-account-tokens", "Get the tokens of a address on the Soon testnet", { address: z.string().describe("The Solana address to get the tokens of"), }, async ({ address }) => { try { const tokens = await connectionTestnet.getTokenAccountsByOwner( new PublicKey(address), { programId: new PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"), } ); return { content: [ { type: "text", text: JSON.stringify(tokens), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error getting tokens: ${error instanceof Error ? error.message : String(error)}`, }, ], }; } } );

Inicialización del servidor

async function main() { try { console.error("Starting MCP server..."); const transport = new StdioServerTransport(); console.error("Transport initialized, connecting to server..."); await server.connect(transport); console.error("Server connection established successfully"); // The server will keep running in this state } catch (error) { console.error("There was an error connecting to the server:", error); process.exit(1); } } main().catch((err) => { console.error("There was an error starting the server:", err); process.exit(1); });

Configuración

Configuración del escritorio de Claude

Para utilizar este servidor MCP con Claude Desktop, agregue lo siguiente a su archivo claude_desktop_config.json :

{ "mcpServers": { "svm-mcp": { "command": "bun", "args": ["/path/to/svm-mcp/build/index.js"] } } }

Personalización de puntos finales de RPC

Para utilizar diferentes puntos finales de RPC o conectarse a una cadena de bloques diferente compatible con Solana, edite las URL de conexión en src/index.ts :

const connectionTestnet = new Connection("YOUR_TESTNET_RPC_URL"); const connectionMainnet = new Connection("YOUR_MAINNET_RPC_URL");

Uso con Claude

Una vez que el servidor MCP esté en ejecución y conectado a Claude, puedes usar los siguientes comandos:

Consultar el saldo de una dirección

Can you check the balance of this SOON testnet address: <address>

Obteniendo transacciones recientes

What is the last transaction made by <address> on SOON testnet?

Recuperación de tenencias de tokens

What tokens does <address> hold on SOON mainnet?

Expresiones de gratitud

-
security - not tested
F
license - not found
-
quality - not tested

Un servidor de protocolo de contexto de modelo que conecta a Claude AI con SOON y otras cadenas de bloques basadas en SVM, lo que permite a los usuarios verificar los saldos de las cuentas, obtener transacciones recientes y ver las tenencias de tokens en la red de prueba y la red principal de SOON.

  1. Overview
    1. Features
      1. Prerequisites
        1. Installation
          1. Project Structure
            1. Tool Implementations
              1. Get Balance
              2. Get Last Transaction
              3. Get Token Accounts
              4. Server Initialization
            2. Configuration
              1. Claude Desktop Configuration
              2. Customizing RPC Endpoints
            3. Usage with Claude
              1. Checking an Address Balance
              2. Fetching Recent Transactions
              3. Retrieving Token Holdings
            4. Acknowledgments
              ID: qrk5rvzpwb