A Model Context Protocol server for Solana blockchain data
This is a TypeScript-based MCP server that implements a Solana data query system. It demonstrates core MCP concepts by providing:
- Resources representing Solana catalog metadata
- Tools for querying Solana blockchain data via Flipside API
- Prompts for SQL query examples
DEMO: https://x.com/toannhu21096/status/1900031746848284916
- Access Solana catalog metadata via
catalog:///
URIs - Each catalog contains structured metadata about Solana data tables
- JSON format for easy parsing and exploration
solana_query
- Query Solana blockchain data- Takes SQL query as a required parameter
- Executes queries against Flipside API
- Returns results in JSON format
solana_sql_examples
- Provides example SQL queries for Solana data analysis- Includes sample queries for common use cases
- Helps users understand how to query Solana data effectively
- Node.js and npm/yarn
- Flipside API key (get one at https://flipsidecrypto.xyz/)
- Clone the repository
- Install dependencies:
npm install
- Copy
.env.example
to.env
and add your Flipside API key:
cp .env.example .env
- Edit
.env
and setFLIPSIDE_API_KEY
to your actual API key
Build the server:
npm run build
For development with auto-rebuild:
npm run watch
To use with Claude Desktop, add the server config:
On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"spice": {
"command": "node",
"env": {
"FLIPSIDE_API_KEY": "your_flipside_api_key_here"
},
"args": [
"/absolute/path/to/build/index.js"
]
}
}
}
Replace /absolute/path/to/build/index.js
with the actual path to the built index.js file on your system.
Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:
npm run inspector
The Inspector will provide a URL to access debugging tools in your browser.
Here are some example SQL queries you can run with the solana_query
tool:
-- Get volume of swaps for last 24 hours
SELECT SUM(SWAP_FROM_AMOUNT) AS volume
FROM SOLANA.defi.fact_swaps
WHERE block_timestamp > NOW() - INTERVAL '24 hours'
AND SUCCEEDED = TRUE