solana-mcp

Solana Agent Kit MCP Server

GitHub Stars

103

User Rating

Not Rated

Favorites

0

Views

23

Forks

2

Issues

1

Installation
Difficulty
Intermediate
Estimated Time
10-20 minutes
Requirements
Node.js 18.0.0以上
npm 8.0.0以上

Installation

Installation

Prerequisites

Please specify required software and versions:
Node.js: 18.0.0 or higher
npm: 8.0.0 or higher

Installation Steps

1. Clone Repository

bash
git clone https://github.com/solanamcp/solana-mcp.git
cd solana-mcp

2. Install Dependencies

bash
npm install

3. Start Development Server

bash
npm run dev

Troubleshooting

Common Issues

Issue: Server won't start Solution: Check Node.js version and reinstall dependencies.

Configuration

Configuration

Basic Configuration

Claude Desktop Setup

Edit ~/.config/claude-desktop/claude_desktop_config.json (macOS/Linux) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
json
{
  "mcpServers": {
    "solana-mcp": {
      "command": "node",
      "args": ["server.js"],
      "env": {
        "API_KEY": "your-api-key"
      }
    }
  }
}

Environment Variables

Set the following environment variables as needed:
bash
export API_KEY="your-api-key"
export DEBUG="true"

Configuration Examples

Basic Configuration

json
{
  "mcpServers": {
    "solana-mcp": {
      "command": "node",
      "args": ["server.js"],
      "env": {
        "PORT": "3000",
        "LOG_LEVEL": "info"
      }
    }
  }
}

Examples

Examples

Basic Usage

Here are basic usage examples for the MCP server:

Programmatic Usage

javascript
// JavaScript example (Node.js)
const { MCPClient } = require('@modelcontextprotocol/client');

const client = new MCPClient();
await client.connect();

// Execute tool
const result = await client.callTool('toolName', {
  parameter1: 'value1',
  parameter2: 'value2'
});

console.log(result);

API Integration

python

Python example

import requests import json def call_mcp_tool(tool_name, params): response = requests.post( 'http://localhost:3000/api/execute', json={ 'command': 'Buy 10 SOL' } ) return response.json()

Usage example

result = call_mcp_tool('analyze', { 'input': 'sample data', 'options': {'format': 'json'} })

Use Cases

Users input natural language commands to purchase assets, with Solana-MCP parsing and executing the transaction.
Integration with DApps allows users to easily manage assets within applications.
Perform staking on DeFi platforms effortlessly to maximize returns.
Use the API to access Solana-MCP from other applications and automate on-chain operations.