SVM-MCP
SVM-MCP:SOON 模型上下文协议服务器
一个模型上下文协议 (MCP) 服务器,将 Claude AI 与 SOON 及其他基于 SVM 的区块链集成。该服务器提供用于查询余额、获取近期交易以及查看 SOON 测试网和主网上的代币持有情况的工具,包括账户余额、交易记录和代币持有量。
概述
该 MCP 服务器旨在将 Claude 与 SOON 生态系统连接起来,使其能够:
查询测试网和主网上的钱包余额
获取某个地址的最新交易
检查任何账户的代币持有量
当前实现使用 SOON 的 RPC 端点,但可以轻松修改以与任何与 Solana 兼容的区块链或自定义 SVM 实现一起使用。
Related MCP server: Solana Agent Kit MCP Server
特征
获取余额:获取 SOON 测试网或主网上任何地址的原生代币余额
获取最后一笔交易:检索某个地址的最近一笔交易
获取代币账户:列出某个地址拥有的所有代币账户
先决条件
Node.js(v16+)
NPM 或 Bun 包管理器
Claude Desktop(用于本地测试)
安装
克隆存储库:
git clone https://github.com/rkmonarch/svm-mcp
cd svm-mcp安装依赖项:
npm install
# or
bun install构建项目:
npm run build
# or
bun run build项目结构
主服务器实现位于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",
],
});工具实现
获取余额
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)}`,
},
],
};
}
}
);获取最后交易
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)}`,
},
],
};
}
}
);获取代币账户
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)}`,
},
],
};
}
}
);服务器初始化
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);
});配置
Claude桌面配置
要将此 MCP 服务器与 Claude Desktop 一起使用,请将以下内容添加到您的claude_desktop_config.json文件中:
{
"mcpServers": {
"svm-mcp": {
"command": "bun",
"args": ["/path/to/svm-mcp/build/index.js"]
}
}
}自定义 RPC 端点
要使用不同的 RPC 端点或连接到不同的 Solana 兼容区块链,请编辑src/index.ts中的连接 URL:
const connectionTestnet = new Connection("YOUR_TESTNET_RPC_URL");
const connectionMainnet = new Connection("YOUR_MAINNET_RPC_URL");与 Claude 一起使用
一旦 MCP 服务器运行并连接到 Claude,您就可以使用以下命令:
检查地址余额
Can you check the balance of this SOON testnet address: <address>获取近期交易
What is the last transaction made by <address> on SOON testnet?检索代币持有量
What tokens does <address> hold on SOON mainnet?致谢
人类克劳德的人工智能能力
用于实现工具集成的模型上下文协议
Solana Web3.js用于区块链交互
本例中使用的 SVM 实现的SOON Network
Available Tools
6 toolsget-soon-mainnet-account-tokensC
Get the tokens of a address on the Soon mainnet
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The SOON address to get the tokens of |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it 'Get[s] the tokens' but doesn't clarify what 'tokens' entails (e.g., token types, formats, or if it includes metadata), whether it's a read-only operation, potential rate limits, authentication needs, or error conditions. This leaves significant gaps for an agent to understand the tool's behavior beyond the basic action.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence that directly states the tool's purpose without any unnecessary words. It's front-loaded and efficiently communicates the core action, making it easy to parse quickly. There's no wasted space or redundant information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'tokens' includes (e.g., token lists, balances, or metadata), how results are structured, or any behavioral traits like read-only status. For a tool with no structured context beyond the input schema, this leaves the agent with insufficient information to fully understand the tool's operation and output.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, with the single parameter 'address' documented as 'The SOON address to get the tokens of'. The description doesn't add any meaning beyond this, such as address format examples or validation rules. With high schema coverage, the baseline score of 3 is appropriate as the schema handles the parameter documentation adequately.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Get') and resource ('tokens of a address on the Soon mainnet'), making the purpose immediately understandable. However, it doesn't explicitly distinguish this from its sibling tools like 'get-soon-mainnet-balance' or 'get-soon-testnet-account-tokens', which would require mentioning specific differences in what 'tokens' means versus 'balance' or 'last-transaction'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose this over sibling tools like 'get-soon-mainnet-balance' (which might retrieve a different type of data) or 'get-soon-testnet-account-tokens' (which targets a different network). There are no explicit usage contexts or exclusions provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-soon-mainnet-balanceC
Get the balance of a address on the Soon mainnet
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The SOON address to get the balance of |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. While it indicates a read operation ('Get'), it lacks details on potential errors (e.g., invalid addresses), rate limits, network dependencies, or response format. This leaves significant gaps in understanding how the tool behaves beyond its basic function.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, direct sentence that efficiently conveys the core purpose without unnecessary words. It is front-loaded with the essential action and resource, making it highly concise and well-structured for quick comprehension.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete for a tool that interacts with a blockchain network. It doesn't cover error handling, return value details (e.g., balance units or format), or network-specific considerations, which are crucial for effective agent use in this context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, with the single parameter 'address' clearly documented in the schema. The description adds no additional semantic context beyond what the schema provides, such as address format examples or validation rules, so it meets the baseline for adequate but not enhanced parameter understanding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get the balance') and resource ('address on the Soon mainnet'), making the purpose immediately understandable. However, it doesn't explicitly distinguish this tool from its sibling 'get-soon-testnet-balance', which performs the same function on a different network, leaving some ambiguity about when to choose one over the other.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention the sibling tools, such as 'get-soon-testnet-balance' for testnet addresses or 'get-soon-mainnet-account-tokens' for token-specific queries, leaving the agent to infer usage context without explicit direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-soon-mainnet-last-transactionC
Get the last transaction of an address on the Soon mainnet
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The SOON address to get the last transaction for |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It states the tool retrieves the last transaction, but doesn't disclose behavioral traits like error handling (e.g., invalid addresses), rate limits, authentication needs, or what 'last transaction' means (e.g., most recent by time). This leaves significant gaps for an agent to use it correctly.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence that front-loads the key information without unnecessary words. It efficiently conveys the core purpose, making it easy to parse and understand quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., transaction details, error formats) or address potential complexities like network-specific behaviors. For a tool with no structured support, more context is needed to ensure reliable use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, with the parameter 'address' fully documented in the schema. The description adds no additional meaning beyond what the schema provides, such as format details or examples. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't enhance parameter understanding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get') and resource ('last transaction of an address on the Soon mainnet'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'get-soon-testnet-last-transaction' beyond the 'mainnet' reference, which is implied but not contrasted.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites, such as needing a valid address, or compare it to siblings like 'get-soon-mainnet-balance' or 'get-soon-testnet-last-transaction' for context-specific use cases.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-soon-testnet-account-tokensC
Get the tokens of a address on the Soon testnet
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The SOON address to get the tokens of |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves tokens but doesn't specify what 'tokens' entails (e.g., token types, amounts, or metadata), whether it's a read-only operation, potential rate limits, or error conditions. This leaves significant gaps in understanding the tool's behavior beyond the basic action.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, direct sentence that efficiently conveys the core action without unnecessary words. It is front-loaded and appropriately sized for the tool's complexity, making it easy to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (a read operation with one parameter) and the absence of annotations and output schema, the description is incomplete. It doesn't clarify what 'tokens' means in the return value, how results are formatted, or any behavioral nuances, leaving the agent with insufficient context for effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, with the single parameter 'address' clearly documented in the schema. The description adds no additional semantic context beyond what the schema provides, such as address format or validation rules. Since the schema handles the parameter documentation adequately, a baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get') and resource ('tokens of an address on the Soon testnet'), making the purpose understandable. However, it doesn't explicitly differentiate from its sibling tools like 'get-soon-testnet-balance' or 'get-soon-mainnet-account-tokens', which would require specifying what 'tokens' means in this context versus 'balance' or other network variants.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. Given the sibling tools include similar functions for testnet and mainnet (e.g., 'get-soon-testnet-balance', 'get-soon-mainnet-account-tokens'), the description lacks explicit instructions on selection criteria, such as network differences or token vs. balance distinctions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-soon-testnet-balanceC
Get the balance of a address on the Soon testnet
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The SOON address to get the balance of |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden but only states the basic function. It doesn't disclose behavioral traits such as whether this is a read-only operation (implied but not explicit), rate limits, error conditions, or what format the balance is returned in (e.g., native units, decimals). This leaves significant gaps for safe and effective use.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the core purpose without any wasted words. It's appropriately sized for a simple tool with one parameter, making it easy for an agent to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete for effective use. It doesn't explain what the balance output looks like (e.g., numeric value, currency), potential errors, or network-specific behaviors, which are crucial for a financial query tool in a blockchain context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds no parameter semantics beyond what the input schema provides, which has 100% coverage with a clear description for the single 'address' parameter. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get the balance') and resource ('address on the Soon testnet'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from its sibling 'get-soon-mainnet-balance' beyond the network name, which is implied but not stated as a distinguishing factor.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get-soon-mainnet-balance' for mainnet queries or 'get-soon-testnet-account-tokens' for token-specific balances, leaving the agent to infer usage context solely from the tool name.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-soon-testnet-last-transactionB
Get the last transaction of an address on the Soon testnet
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The SOON address to get the last transaction for |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It states what the tool does but lacks behavioral details such as error handling, rate limits, authentication requirements, or what 'last transaction' means (e.g., most recent by time, by block). This leaves gaps for an AI agent to understand operational context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence with no wasted words. It's front-loaded with the core purpose, making it highly efficient and easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple read operation with one parameter and no output schema, the description is adequate but minimal. It covers the basic purpose but lacks context on behavior, usage, or output format, which could hinder an AI agent's ability to use it effectively without trial and error.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with the single parameter 'address' well-documented in the schema. The description doesn't add any additional meaning beyond what's in the schema, such as address format or validation rules, so it meets the baseline for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get') and resource ('last transaction of an address on the Soon testnet'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from its sibling 'get-soon-mainnet-last-transaction' beyond the network name, which could be inferred but isn't stated.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. While it's implied this is for testnet transactions, there's no explicit mention of when to choose it over mainnet tools or other testnet tools like 'get-soon-testnet-balance'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
6 tool updates
- First observed
get-soon-mainnet-account-tokens - First observed
get-soon-mainnet-balance - First observed
get-soon-mainnet-last-transaction - First observed
get-soon-testnet-account-tokens - First observed
get-soon-testnet-balance - First observed
get-soon-testnet-last-transaction
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose based on the combination of network (mainnet vs. testnet) and data type (tokens, balance, or last transaction). There is no overlap or ambiguity between tools, as they target specific resources and actions.
All tool names follow a consistent verb_noun pattern with 'get' as the verb, followed by the network and resource (e.g., get-soon-mainnet-account-tokens). The naming is uniform across all tools, using kebab-case consistently without any deviations.
With 6 tools, the server is well-scoped for querying blockchain data on two networks. Each tool earns its place by covering essential data types (tokens, balance, transactions) for both mainnet and testnet, avoiding redundancy or excessive complexity.
The tool set provides comprehensive read operations for blockchain addresses, covering tokens, balance, and last transactions on both mainnet and testnet. A minor gap exists in the lack of write operations (e.g., sending transactions) or broader query capabilities, but the read surface is complete for its apparent domain.
Maintenance
Related MCP Connectors
Hosted MCP server for live Bittensor chain reads and self-custodial on-chain writes.
Provide AI agents and automation tools with contextual access to blockchain data including balance…
MCP server connecting AI agents to non-custodial staking data across 130+ networks.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseCqualityCmaintenanceA Model Context Protocol server that provides Claude with comprehensive access to Solana blockchain data via the Helius API, enabling operations like checking wallet balances, retrieving blockchain information, and interacting with tokens and NFTs.3814 npm14MIT
- AlicenseNot gradedqualityFmaintenanceA Model Context Protocol server that enables Claude AI to interact with the Solana blockchain through a standardized interface, providing tools for transactions, account queries, and wallet management.32 npm164Apache 2.0
- FlicenseNot gradedqualityFmaintenanceA Model Context Protocol server that provides onchain tools for Claude AI, allowing it to interact with the Solana blockchain through a standardized interface for operations like managing assets, executing token operations, and retrieving network information.7-
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables Claude AI to interact with the Solana blockchain, allowing it to execute transactions, query accounts, manage wallets, get price predictions, trade tokens, and access various blockchain data sources.4-