solana-metrics
MCP server for analyzing Solana blockchain metrics from InfluxDB and auto-generating Grafana dashboards. Built for AI-native validator monitoring.
claude mcp add --transport stdio wcampbellgalaxy-solana-metrics-mcp-server node /absolute/path/to/solana-metrics-mcp-server/build/index.js \ --env INFLUX_ORG="InfluxDB organization name (for v2) or placeholder for v1" \ --env INFLUX_URL="URL to your InfluxDB instance (e.g., http://localhost:8086)" \ --env INFLUX_TOKEN="Token for the InfluxDB user with read/write access" \ --env INFLUX_BUCKET="sol_metrics" \ --env INFLUX_VERSION=""v1" or "v2""
How to use
This Solana Metrics MCP Server connects to an InfluxDB instance containing the sol_metrics database and automatically generates Grafana dashboards for Solana metrics. It exposes tools to discover available metrics, analyze and categorize them, and generate importable Grafana dashboard JSON files into a grafana/ folder. It also provides a code search capability to locate metric definitions in the Solana Rust codebase. To use it, ensure the InfluxDB connection details are correctly configured via environment variables, start the MCP server, and invoke the built-in tools (list_metrics, analyze_metrics, generate_dashboard, search_rust_code) to explore, categorize, and export dashboards for various Solana subsystems like Consensus, Network, Banking, Accounts, RPC, Performance, and Jito/MEV.
How to install
Prerequisites:
- Node.js (LTS) installed on your system
- npm installed
- Access to a running InfluxDB instance with the sol_metrics database
Steps:
-
Clone the repository: git clone <repository-url> cd solana-metrics-mcp-server
-
Install dependencies: npm install
-
Build the server (if a build step exists): npm run build
-
Configure environment variables (example): export INFLUX_URL="http://your-influxdb-server:8086" export INFLUX_TOKEN="your_token" export INFLUX_ORG="your_org" export INFLUX_BUCKET="sol_metrics" export INFLUX_VERSION="v1" # or "v2" for InfluxDB v2
-
Start the server: npm start
or run directly if you prefer using the built index.js
node build/index.js
Additional notes
Environment variables are required to connect to InfluxDB. If you’re using InfluxDB v2, ensure INFLUX_VERSION is set to v2 and INFLUX_ORG is correctly specified. The server will export Grafana dashboard JSON files into the grafana/ folder and create timestamped backups for version history. If dashboards fail to generate, check that the sol_metrics bucket exists and that the InfluxDB credentials have sufficient permissions. The available tools (list_metrics, analyze_metrics, generate_dashboard, search_rust_code) can be invoked via the server's CLI or integrated in your workflow. For Claude Desktop or other integrations, point to the built index.js as shown in the documentation.
Related MCP Servers
frontmcp
TypeScript-first framework for the Model Context Protocol (MCP). You write clean, typed code; FrontMCP handles the protocol, transport, DI, session/auth, and execution flow.
solana-dev
Solana Model Context Protocol (MCP) Demo
prometheus
A Model Context Protocol (MCP) server implementation that provides AI agents with programmatic access to Prometheus metrics via a unified interface.
mcp-bun
Bun Javascript Runtime MCP Server for AI Agents
mcp-starwars
MCP Server for the SWAPI Star Wars API. The main goal of the project is to show how an MCP server can be used to interact with APIs.
mcp-demo
Example of using MCP Gateway with E2B sandboxes