Grok AI (Solana Blockchain Analysis) MCP server

Integrates with xAI's Grok API to provide blockchain analysis tools for Solana, enabling transaction analysis, address investigation, image interpretation, and general queries with optional context support.
Back to servers
Setup instructions
Provider
8bitsats
Release date
Mar 17, 2025
Language
TypeScript
Stats
2 stars

The Grok AI MCP Server integrates with the xAI Grok API to provide AI-driven analysis tools for the Solana blockchain. It can analyze transactions and addresses, process images using Grok's vision capabilities, answer general questions, and operates using the Model Context Protocol (MCP) over standard I/O transport.

Installation Requirements

Before installing the Grok AI MCP Server, ensure you have:

  • Node.js version 16 or higher
  • npm (Node package manager)
  • An xAI API key
  • Basic understanding of Solana blockchain concepts (helpful but not required)

Installation Steps

Clone the Repository

git clone https://github.com/yourusername/grok-ai-mcp-server.git
cd grok-ai-mcp-server

Install Dependencies

npm install

Configure Environment Variables

Create a .env file in the root directory and add your xAI API key:

XAI_API_KEY=your-xai-api-key-here

Start the Server

npm start

If successful, you should see this message:

Grok AI MCP server running on stdio

Using the MCP Server

The server provides four main tools via the MCP interface:

Analyze Transaction

Tool Name: analyze_transaction

Analyzes a Solana transaction signature.

Input Parameters:

  • signature (required): Transaction signature string
  • screenshot (optional): Base64-encoded image
  • details (optional): JSON string with additional transaction data

Example:

{
  "name": "analyze_transaction",
  "arguments": {
    "signature": "5y2...abc",
    "screenshot": "data:image/jpeg;base64,...",
    "details": "{\"amount\": \"1.5 SOL\", \"program\": \"Tokenkeg...\"}"
  }
}

Analyze Address

Tool Name: analyze_address

Analyzes a Solana address.

Input Parameters:

  • address (required): Solana address string
  • screenshot (optional): Base64-encoded image

Example:

{
  "name": "analyze_address",
  "arguments": {
    "address": "7xK...xyz",
    "screenshot": "data:image/jpeg;base64,..."
  }
}

Analyze Image

Tool Name: analyze_image

Analyzes an image with a user-provided prompt.

Input Parameters:

  • prompt (required): Question or instruction
  • image (optional): Base64-encoded image
  • image_url (optional): URL to an image

Example:

{
  "name": "analyze_image",
  "arguments": {
    "prompt": "What does this chart show?",
    "image": "data:image/jpeg;base64,..."
  }
}

Ask Grok

Tool Name: ask_grok

Ask Grok a general question.

Input Parameters:

  • question (required): The question to ask
  • context (optional): Additional context
  • image (optional): Base64-encoded image
  • image_url (optional): URL to an image

Example:

{
  "name": "ask_grok",
  "arguments": {
    "question": "What is Solana's consensus mechanism?",
    "context": "I'm new to blockchain technology."
  }
}

Interacting with the Server

The server uses MCP over stdio. You can interact with it programmatically using an MCP client or by sending JSON requests via a compatible interface. For details on client implementation, refer to the MCP SDK Documentation.

Configuration Details

  • API Key: Set via the XAI_API_KEY environment variable
  • Model Selection:
    • Uses grok-2-vision-latest for vision tasks
    • Uses grok-2-latest for text-only queries
  • Temperature: Set to 0.7 for balanced creativity and accuracy

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "grok-ai" '{"command":"npx","args":["-y","grok_mcp"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "grok-ai": {
            "command": "npx",
            "args": [
                "-y",
                "grok_mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "grok-ai": {
            "command": "npx",
            "args": [
                "-y",
                "grok_mcp"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later