MCP ExplorerExplorer

Spice

@getnimbuson 10 months ago
2 MIT
FreeCommunity
AI Systems
A Model Context Protocol server for Solana blockchain data

Overview

What is Spice

Spice is a Model Context Protocol (MCP) server designed for querying Solana blockchain data. It provides a structured way to access and analyze metadata related to Solana’s data tables.

Use cases

Use cases for Spice include generating reports on Solana blockchain transactions, analyzing data trends, and providing insights for decentralized applications (dApps) built on the Solana network.

How to use

To use Spice, clone the repository, install the necessary dependencies using npm or yarn, and configure your Flipside API key in the .env file. After building the server, you can integrate it with applications like Claude Desktop by adding the server configuration.

Key features

Key features of Spice include access to Solana catalog metadata via URIs, tools for executing SQL queries against the Flipside API, and example prompts for common SQL queries to facilitate data analysis.

Where to use

Spice is primarily used in blockchain data analysis, particularly for developers and analysts working with Solana blockchain data. It can be utilized in various applications that require querying and analyzing blockchain metadata.

Content

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

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers