svm402-mcp

svm402-mcp

An MCP server that provides AI agents with Solana token analysis from svm402.com, handling x402 USDC payments automatically.

Category
Visit Server

README

svm402-mcp

An MCP (Model Context Protocol) server that provides AI agents with Solana token analysis from svm402.com via x402 USDC payments.

What It Does

Agents call simple named tools — the MCP server handles the x402 payment flow automatically:

Agent calls: analyze_token("DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263")
  → MCP server pays $0.05 USDC to svm402.com via x402
  → Returns: price, safety, holders, risk score, metadata

The agent never sees wallets, private keys, or x402 protocol details. Just call a tool, get data.

Disclaimer

This software is experimental and provided "as is", without warranty of any kind. Use at your own risk.

This software initiates real cryptocurrency transactions that are irreversible. Test on devnet before using on mainnet.

Tools

Tool Cost Description
analyze_token $0.05 USDC Full analysis: price, liquidity, safety, holders, metadata
check_safety $0.02 USDC Safety/honeypot risk check with deterministic 0-10 score
get_price $0.01 USDC Price, liquidity, market cap, 24h volume, multi-timeframe changes

Each tool handles the x402 payment automatically — the agent just provides a Solana token address.

Quick Start

1. Install

git clone https://github.com/dchu3/svm402-mcp.git
cd svm402-mcp
npm install
npm run build

2. Configure

Copy .env.example and set your Solana private key:

cp .env.example .env
# Edit .env with your private key
Variable Required Default Description
SOLANA_PRIVATE_KEY Base58-encoded Solana private key
SOLANA_NETWORK mainnet mainnet or devnet
SOLANA_RPC_URL api.mainnet-beta.solana.com Custom RPC (use Helius for cloud servers)
SVM402_BASE_URL https://svm402.com svm402 service URL
MAX_PAYMENT_PER_CALL 0.05 Max USDC per payment
MAX_DAILY_SPEND 10.00 Max daily USDC spend
PAYMENT_LOG_PATH ./svm402-payments.jsonl Payment audit log

3. Connect to Your Agent

Hermes Agent

The hermes mcp add command has issues with --env flags. Use hermes config set instead:

# 1. Add the MCP server
hermes config set mcp_servers.svm402.command "node"
hermes config set mcp_servers.svm402.args '["/path/to/svm402-mcp/dist/index.js"]'
hermes config set mcp_servers.svm402.enabled true

# 2. Set environment variables (as a YAML dict, not string)
python3 -c "
import yaml
with open('$HOME/.hermes/config.yaml') as f:
    config = yaml.safe_load(f)
config['mcp_servers']['svm402']['env'] = {
    'SOLANA_PRIVATE_KEY': 'your-base58-key',
    'SOLANA_NETWORK': 'mainnet',
    'SOLANA_RPC_URL': 'https://api.mainnet-beta.solana.com',
}
with open('$HOME/.hermes/config.yaml', 'w') as f:
    yaml.dump(config, f, default_flow_style=False, allow_unicode=True)
print('Config saved')
"

# 3. Restart Hermes gateway
hermes gateway restart

# 4. Test connection
hermes mcp test svm402

Note: If the connection test times out, increase the connect timeout:

hermes config set mcp_servers.svm402.connect_timeout 30
hermes config set mcp_servers.svm402.timeout 60
hermes gateway restart

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "svm402": {
      "command": "node",
      "args": ["/path/to/svm402-mcp/dist/index.js"],
      "env": {
        "SOLANA_PRIVATE_KEY": "your-base58-key",
        "SOLANA_NETWORK": "mainnet",
        "SOLANA_RPC_URL": "https://api.mainnet-beta.solana.com"
        # For cloud servers (GCE, AWS), use Helius instead:
        # "SOLANA_RPC_URL": "https://mainnet.helius-rpc.com/?api-key=your-key"
      }
    }
  }
}

Cursor / Windsurf / Other MCP Clients

Use the same JSON config as Claude Desktop, adapted for your client.

Usage Examples

Analyze a token ($0.05)

analyze_token({ address: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263" })

Returns: token metadata, price, market cap, safety risk score (0-10), top holders with LP detection, buy/sell tax, liquidity lock status, and degraded flag for partial data.

Check safety ($0.02)

check_safety({ address: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263" })

Returns: risk score, honeypot check, mint/freeze authority status, liquidity lock, buy/sell tax, holder concentration.

Get price ($0.01)

get_price({ address: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263" })

Returns: price, market cap, FDV, liquidity, 24h volume, multi-timeframe price changes (1h/6h/24h), organic score, holder count.

Safety Features

  • Spending limitsMAX_PAYMENT_PER_CALL and MAX_DAILY_SPEND prevent runaway costs
  • Payment logging — every payment logged to JSONL audit trail
  • Structured errors — clear error codes for rate limits, insufficient balance, failed payments
  • Degraded flag — svm402.com returns degraded: true when data is partial

How It Works

Agent → MCP tool: analyze_token(address)
     → MCP server: HTTP request to svm402.com/analyze
     → svm402.com: returns 402 (payment required)
     → MCP server: signs USDC payment on Solana
     → MCP server: retries with payment proof
     → svm402.com: verifies via CDP facilitator, returns data
     → MCP server: returns data to agent

The agent never touches a wallet or payment. Just data in, data out.

Data Sources

svm402.com uses:

  • Jupiter v3/v2 API — price, market cap, liquidity, 24h stats, organic score, audit data
  • Helius RPC — mint/freeze authority, holders, honeypot checks, liquidity lock detection
  • Pump.fun bonding curve — price fallback for brand new tokens not yet on Jupiter

Development

npm install
npm run build
npm start

Tech Stack

License

MIT — see LICENSE

Links

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured