Blockchain.com Data and Query MCP server

Integrates with Blockchain.com's Data and Query APIs to enable Bitcoin blockchain data retrieval, analysis, and market monitoring for cryptocurrency applications.
Back to servers
Setup instructions
Provider
Pavel Kiselyov
Release date
Feb 23, 2025
Language
Python
Stats
1 star

This MCP Blockchain Query Server provides tools for retrieving Bitcoin blockchain data through Blockchain Data and Query APIs, following the Model Context Protocol standard. It offers multiple query capabilities for blockchain statistics and transaction information.

Installation

To install the MCP Blockchain Query Server, follow these steps:

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Running the Server

Standard Input/Output (stdio) Mode

To run the server in stdio mode (the default mode):

python main.py

Server-Sent Events (SSE) Mode

To run the server in SSE mode:

python main.py --transport sse --port 8000

Configuration Options

The server accepts the following command-line arguments:

  • --transport: Specify the transport type (stdio or sse, default: stdio)
  • --port: Set the port number for SSE transport (default: 8000)

Available Tools

The server provides the following blockchain query tools:

Block and Transaction Data

  • Get block by hash
  • Get transaction by hash
  • Get address by hash
  • Get block count
  • Get latest hash

Network Statistics

  • Get difficulty
  • Get hash rate
  • Get average transaction size
  • Get block interval
  • Get unconfirmed count
  • Get 24-hour transaction count

Bitcoin Economics

  • Get address balance
  • Get total bitcoins
  • Get block reward
  • Get probability of finding a block
  • Get 24-hour market price
  • Get next retarget

These tools enable applications to retrieve real-time data from the Bitcoin blockchain through a standardized Model Context Protocol interface.

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 "mcp-blockchain-query" '{"command":"python","args":["main.py"],"cwd":"${workspaceFolder:mcp-blockchain-query}"}'

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": {
        "mcp-blockchain-query": {
            "command": "python",
            "args": [
                "main.py"
            ],
            "cwd": "${workspaceFolder:mcp-blockchain-query}"
        }
    }
}

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": {
        "mcp-blockchain-query": {
            "command": "python",
            "args": [
                "main.py"
            ],
            "cwd": "${workspaceFolder:mcp-blockchain-query}"
        }
    }
}

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