
aristide021/solana-dev-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
Solana Model Context Protocol (MCP) Demo
概要
This repository demonstrates a simple implementation of a Model Context Protocol (MCP) server for Solana development. The Model Context Protocol (MCP) is a standardized interface for AI models to interact with tools and resources. This demo showcases a simple MCP server implementation that provides: 1. Basic RPC methods for Solana (getBalance, getAccountInfo, getTransaction) 2. Some helpful prompts for Solana development - Node.js (v16 or higher recommended) - pnpm package manager (v9.10.0 or compatible) Clone this repository and install dependencies: To run this server in the MCP inspector, use: 1. : The main implementation is in index.ts, which sets up an MCP server with simple fetching tools and some prompts. 2. : You can extend the server by adding more tools, resources, and prompts.
README
以下は原文 README の抜粋です。原文を見る。
Solana Model Context Protocol (MCP) Demo
This repository demonstrates a simple implementation of a Model Context Protocol (MCP) server for Solana development.
What is MCP?
The Model Context Protocol (MCP) is a standardized interface for AI models to interact with tools and resources. This demo showcases a simple MCP server implementation that provides:
- Basic RPC methods for Solana (getBalance, getAccountInfo, getTransaction)
- Some helpful prompts for Solana development
Prerequisites
- Node.js (v16 or higher recommended)
- pnpm package manager (v9.10.0 or compatible)
Installation
Clone this repository and install dependencies:
git clone https://github.com/solana-foundation/solana-dev-mcp.git
cd solana-dev-mcp
pnpm install
To run this server in the MCP inspector, use:
npx @modelcontextprotocol/inspector ts-node index.ts
Getting Started
-
Explore the code: The main implementation is in
index.ts, which sets up an MCP server with simple fetching tools and some prompts. -
Modify the server: You can extend the server by adding more tools, resources, and prompts.
-
Get ideas for extensions: Check out the Ideas Extending MCP for Solana Development section to get inspiration for new tools and resources to add.
Example Usage
This section explains how to use the Solana MCP server in Claude. Follow the same steps to use the Solana MCP server in Windsurf and Cursor.
Generate the configuration file
To use this Solana MCP server, you need to generate a configuration file that Claude can use to connect to the server. Run one of the following commands to generate the configuration file:
pnpm generate-configif you havets-nodeinstalled globallypnpm build && pnpm generate-config:jsif you don’t havets-nodeinstalled globally
This will print a JSON config with the following content:
If you have ts-node:
{
"mcpServers": {
"solana-dev": {
"command": "ts-node",
"args": ["/index.ts"]
}
}
}
If you don’t have ts-node installed globally:
{
"mcpServers": {
"solana-dev": {
"command": "node",
"args": ["/dist/index.js"]
}
}
}
Project Structure
index.ts- Main server implementationpackage.json- Project dependencies and metadatatsconfig.json- TypeScript configuration
Ideas Extending MCP for Solana Development
This MCP server implementation provides a foundation that you can extend or fork for your own Solana development needs. Here are some ideas to get you started:
Ideas for Extension
インストール
npx @modelcontextprotocol/inspector ts-node index.ts設定
{
"mcpServers": {
"solana-dev": {
"command": "ts-node",
"args": ["<full-path-to-repo>/index.ts"]
}
}
}