Skip to content

A Model Context Protocol server for Solana blockchain data

Notifications You must be signed in to change notification settings

getnimbus/spice

Repository files navigation

spice MCP Server

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

Features

Resources

  • Access Solana catalog metadata via catalog:/// URIs
  • Each catalog contains structured metadata about Solana data tables
  • JSON format for easy parsing and exploration

Tools

  • solana_query - Query Solana blockchain data
    • Takes SQL query as a required parameter
    • Executes queries against Flipside API
    • Returns results in JSON format

Prompts

  • 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

Development

Prerequisites

Setup

  1. Clone the repository
  2. Install dependencies:
npm install
  1. Copy .env.example to .env and add your Flipside API key:
cp .env.example .env
  1. Edit .env and set FLIPSIDE_API_KEY to your actual API key

Building

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Installation

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.

Debugging

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.

Example Queries

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

Resources

About

A Model Context Protocol server for Solana blockchain data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published