Web3 MCP

Web3 MCP

A Model Context Protocol server for unified blockchain data access.

3
Stars
1
Forks
3
Watchers
0
Issues
Web3 MCP is a Model Context Protocol server that provides access to blockchain data through Ankr's Advanced API. It allows large language models to interact seamlessly with multiple blockchain networks such as Ethereum, BSC, Polygon, and Avalanche. With support for NFT, token, and blockchain query APIs, it enables users and AI agents to retrieve on-chain data, statistics, and analytics efficiently within an MCP context.

Key Features

Implements the Model Context Protocol server
Complete wrapper for Ankr Advanced API endpoints
Supports multiple blockchain networks including Ethereum, BSC, Polygon, and Avalanche
Comprehensive NFT metadata, holders, and transfer information
Token balance, price, and holders tracking
Blockchain statistics, blocks, and transaction data queries
Flexible environment variable configuration
Python library and CLI support
Seamless integration for large language models
Fast data access optimized for MCP clients

Use Cases

Allowing LLMs to access real-time blockchain data
Retrieving NFT metadata for bot or agent analysis
Querying token balances and holder distributions
Fetching transaction histories for wallets or contracts
Aggregating blockchain statistics for analytics platforms
Automating blockchain data retrieval for context-aware AI
Building dashboards for cross-chain NFT and token tracking
Developing research agents for on-chain activity monitoring
Powering context providers in conversational AI applications
Supporting multi-chain DeFi data aggregation tools

README

Web3 MCP

Tests codecov PyPI version License: MIT

An MCP server implementation wrapping Ankr Advanced API.

Overview

FastMCP is a Model Context Protocol (MCP) server that provides access to Ankr's Advanced API for blockchain data. It allows LLMs to interact with blockchain data across multiple chains including Ethereum, BSC, Polygon, Avalanche, and more.

MCP Client Setting

json
{
  "mcpServers": {
    "web3": {
      "command": "uvx",
      "args": [
        "web3-mcp"
      ],
      "env": {
        "ANKR_ENDPOINT": "https://rpc.ankr.com/...",
      }
    }
  }
}

Features

  • Complete wrapper for all Ankr Advanced API endpoints
  • NFT API: Get NFT metadata, holders, transfers, and ownership information
  • Query API: Access blockchain statistics, blocks, logs, and transaction data
  • Token API: Get token balances, prices, holders, and transfer history
  • Support for multiple blockchain networks

Installation

bash
# Clone the repository
git clone https://github.com/tumf/web3-mcp.git
cd web3-mcp

# Install with uv
uv pip install -e .

Configuration

Set the following environment variables:

bash
# Required
export ANKR_ENDPOINT="your_ankr_rpc_endpoint"

# Optional but recommended for authenticated requests
export ANKR_PRIVATE_KEY="your_private_key"

Usage

Running the server

python
from web3_mcp.server import init_server

# Initialize MCP server
mcp = init_server(
    name="Ankr MCP",
    endpoint="your_ankr_endpoint",  # Optional, defaults to ANKR_ENDPOINT env var
    private_key="your_private_key"  # Optional, defaults to ANKR_PRIVATE_KEY env var
)

# Run server
mcp.run()

Using with FastMCP CLI

bash
# Set environment variables first
export ANKR_ENDPOINT="your_ankr_endpoint"
export ANKR_PRIVATE_KEY="your_private_key"

# Run the server
python -m web3_mcp

API Categories

NFT API

  • get_nfts_by_owner: Get NFTs owned by a wallet address
  • get_nft_metadata: Get metadata for a specific NFT
  • get_nft_holders: Get holders of a specific NFT collection
  • get_nft_transfers: Get transfer history for NFTs

Query API

  • get_blockchain_stats: Get blockchain statistics
  • get_blocks: Get blocks information
  • get_logs: Get blockchain logs
  • get_transactions_by_hash: Get transactions by hash
  • get_transactions_by_address: Get transactions by address
  • get_interactions: Get wallet interactions with contracts

Token API

  • get_account_balance: Get token balances for a wallet
  • get_currencies: Get available currencies
  • get_token_price: Get token price information
  • get_token_holders: Get token holders
  • get_token_holders_count: Get token holders count
  • get_token_transfers: Get token transfer history

License

MIT

Star History

Star History Chart

Repository Owner

tumf
tumf

User

Repository Details

Language Python
Default Branch main
Size 319 KB
Contributors 2
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

Python
93.18%
Makefile
6.82%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • FastMCP

    FastMCP

    The fast, Pythonic way to build MCP servers and clients.

    FastMCP is a production-ready framework for building Model Context Protocol (MCP) applications in Python. It streamlines the creation of MCP servers and clients, providing advanced features such as enterprise authentication, composable tools, OpenAPI/FastAPI generation, server proxying, deployment tools, and comprehensive client libraries. Designed for ease of use, it offers both standard protocol support and robust utilities for production deployments.

    • 20,201
    • MCP
    • jlowin/fastmcp
  • anki-mcp

    anki-mcp

    MCP server for seamless integration with Anki via AnkiConnect.

    An MCP server that bridges Anki flashcards with the Model Context Protocol, exposing AnkiConnect functionalities as standardized MCP tools. It organizes Anki actions into intuitive services covering decks, notes, cards, and models for easy access and automation. Designed for integration with AI assistants and other MCP-compatible clients, it enables operations like creating, modifying, and organizing flashcards through a unified protocol.

    • 6
    • MCP
    • ujisati/anki-mcp
  • Wanaku MCP Router

    Wanaku MCP Router

    A router connecting AI-enabled applications through the Model Context Protocol.

    Wanaku MCP Router serves as a middleware router facilitating standardized context exchange between AI-enabled applications and large language models via the Model Context Protocol (MCP). It streamlines context provisioning, allowing seamless integration and communication in multi-model AI environments. The tool aims to unify and optimize the way applications provide relevant context to LLMs, leveraging open protocol standards.

    • 87
    • MCP
    • wanaku-ai/wanaku
  • Blockchain MCP powered by Tatum

    Blockchain MCP powered by Tatum

    MCP server for universal blockchain data access across 130+ networks.

    Blockchain MCP powered by Tatum is a Model Context Protocol (MCP) server that enables large language models (LLMs) to read and write blockchain data across more than 130 networks. It provides unified access to both the Tatum Blockchain Data API and direct RPC gateways, supporting tools for retrieving balances, portfolios, transactions, and more. The platform is designed for seamless integration via API key and configurable MCP client setups, making it easier to build blockchain-aware AI solutions. Comprehensive documentation and extensive network compatibility facilitate robust development and scalability.

    • 12
    • MCP
    • tatumio/blockchain-mcp
  • Alchemy MCP Server

    Alchemy MCP Server

    A Model Context Protocol server for structured AI access to blockchain data and actions via Alchemy.

    Alchemy MCP Server enables AI agents to interact with Alchemy’s blockchain APIs using the Model Context Protocol. It provides structured endpoints for querying token prices, NFT data, transaction history, asset transfers, and executing blockchain transactions. The server streamlines blockchain data retrieval while supporting multi-network operations and advanced actions like swaps and contract transactions when paired with wallet agents. It is designed for quick setup and seamless integration with AI tools.

    • 68
    • MCP
    • alchemyplatform/alchemy-mcp-server
  • EVM MCP Server

    EVM MCP Server

    Unified Model Context Protocol server for multi-chain EVM blockchain access

    EVM MCP Server provides a comprehensive Model Context Protocol-compliant interface for blockchain services across 30+ EVM-compatible networks. It enables AI agents and other clients to interact programmatically with Ethereum, Optimism, Arbitrum, Base, Polygon, and more via standardized tools and resources. Features include blockchain data access, smart contract interactions, token transfers (including NFTs), ENS name resolution, and multi-network support. The server ensures a consistent and context-aware interface for AI and software agents to discover and leverage on-chain functionality.

    • 340
    • MCP
    • mcpdotdirect/evm-mcp-server
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results