Tutorial

How to Build a Solana MCP Server with Web Data Grounding

Pair a Solana MCP server with Scavio's web MCP for token research, Reddit sentiment, and news grounding inside a trading agent.

Solana MCP servers expose on-chain data to LLM agents. Alone they miss the narrative side: community sentiment, token explainers, breaking news. This tutorial pairs a Solana MCP with Scavio's web MCP so the agent has both sides in the same session.

Prerequisites

  • Claude Desktop or a compatible MCP client
  • A Solana MCP server (e.g., solana-mcp)
  • A Scavio API key

Walkthrough

Step 1: Install the Solana MCP

Community servers expose RPC, token metadata, and wallet lookup.

Bash
npm install -g solana-mcp

Step 2: Register both MCPs in Claude Desktop

Both become tool classes in the same session.

JSON
{
  "mcpServers": {
    "solana": { "command": "solana-mcp", "env": { "SOLANA_RPC_URL": "..." } },
    "scavio": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.scavio.dev/mcp"],
      "env": { "SCAVIO_API_KEY": "${SCAVIO_API_KEY}" }
    }
  }
}

Step 3: Test cross-tool reasoning

Ask a question that requires both sides.

Text
> Look up token WIF on Solana and tell me the recent r/solana sentiment plus any breaking news.

Step 4: Build a trading-context prompt

Claude should call Solana for on-chain, Scavio for narrative.

Text
SYSTEM = '''You are a Solana trading research agent.
- Use solana_* tools for on-chain data (balances, holders, transactions).
- Use scavio_* tools for sentiment (Reddit), news (Google SERP), and explainers (YouTube).
- Cite every claim.'''

Step 5: Add a fast-decision loop

Use Scavio's fast search tier to stay under 1 second per call.

Text
# Scavio fast tier: pass fast: true in the tool call
# Latency target: under 1s round trip

Python Example

Python
# MCP config-first; Python parity for web-side data:
import os, requests
API_KEY = os.environ['SCAVIO_API_KEY']
r = requests.post('https://api.scavio.dev/api/v1/search',
    headers={'x-api-key': API_KEY},
    json={'query': 'WIF solana sentiment', 'platform': 'reddit'})
print(r.json().get('posts', [])[:5])

JavaScript Example

JavaScript
const API_KEY = process.env.SCAVIO_API_KEY;
const r = await fetch('https://api.scavio.dev/api/v1/search', {
  method: 'POST',
  headers: { 'x-api-key': API_KEY, 'Content-Type': 'application/json' },
  body: JSON.stringify({ query: 'WIF solana sentiment', platform: 'reddit' })
});
console.log(((await r.json()).posts || []).slice(0, 5));

Expected Output

JSON
Agent answers blend on-chain data (from Solana MCP) with narrative context (from Scavio). Useful for holding decisions without switching UIs.

Related Tutorials

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

Claude Desktop or a compatible MCP client. A Solana MCP server (e.g., solana-mcp). A Scavio API key. A Scavio API key gives you 500 free credits per month.

Yes. The free tier includes 500 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Start Building

Pair a Solana MCP server with Scavio's web MCP for token research, Reddit sentiment, and news grounding inside a trading agent.