Skip to main content

Celo MCP Server

A Model Context Protocol (MCP) server for interacting with the Celo blockchain. It provides read access to Celo blockchain data, tokens, smart contract calls, gas estimation, governance and staking, plus a testnet faucet.

Installation

  1. Clone the repository:
git clone https://github.com/celo-org/celo-mcp
cd celo-mcp
  1. Install dependencies:
pip install -e .
  1. Set up environment variables (optional):
export CELO_MCP_RPC_URL="https://forno.celo.org"  # Default: Celo mainnet
export CELO_MCP_USE_TESTNET=true                  # Use Celo Sepolia instead

MCP Integration

Cursor IDE Integration

To use this MCP server with Cursor IDE, add the following configuration to your MCP settings file (~/.cursor/mcp.json):

{
  "mcpServers": {
    "celo-mcp": {
      "command": "uvx",
      "args": ["--refresh", "celo-mcp"]
    }
  }
}

The --refresh flag ensures that the latest code is always loaded when the MCP server starts.

Claude Desktop Integration

For Claude Desktop, add this configuration to your MCP settings file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "celo-mcp": {
      "command": "uvx",
      "args": ["--refresh", "celo-mcp"]
    }
  }
}

Claude Code

claude mcp add celo-mcp -- uvx --refresh celo-mcp

Add --scope user to make it available in every project. To use the faucet tools, pass the key through: claude mcp add celo-mcp -e CELO_MCP_FAUCET_API_KEY=<key> -- uvx --refresh celo-mcp.

Hosted endpoint (no install)

Celo runs a public instance of this server over Streamable HTTP:

https://mcp.celo.org/mcp

It exposes the 27 read-only tools against Celo mainnet, with no authentication and no faucet. Connect from any remote-capable MCP client, for example:

claude mcp add --transport http celo-network https://mcp.celo.org/mcp

Looking for documentation rather than chain data? That is the separate Celo Docs server at https://docs.celo.org/mcp; this server reads the chain itself.

Connect remotely (Streamable HTTP)

The server can also run as a remote MCP endpoint over Streamable HTTP, so clients connect with a single URL — no local Python install. The stdio setup above is unchanged; this is an additional transport.

Run it in HTTP mode:

celo-mcp-server --transport http --port 3000
# or via env:
MCP_TRANSPORT=http PORT=3000 celo-mcp-server

Then point any remote-capable MCP client at the URL:

{
  "mcpServers": {
    "celo": { "url": "https://<your-host>/mcp" }
  }
}

Configuration (environment variables):

Var Purpose Default
MCP_TRANSPORT stdio or http stdio
HOST / PORT HTTP bind host / port 127.0.0.1 / 3000
MCP_ALLOWED_HOSTS Hostnames accepted by the SDK's DNS-rebinding check, comma-separated. Set to your public hostname(s), or * to disable the check localhost only
MCP_CORS_ORIGINS Comma-separated allowed origins (or *) *
MCP_RATE_LIMIT / MCP_RATE_WINDOW Requests per client per window (seconds); /health is exempt 60 / 60
MCP_TRUST_PROXY Number of X-Forwarded-For hops your infrastructure appends, so the rate limiter keys on the client rather than the proxy address. 1 for a single reverse proxy, 2 behind a Google external load balancer. Counted from the right — see deployment unset
MCP_AUTH_TOKEN If set, requires Authorization: Bearer <token> on /mcp unset (open)
CELO_MCP_RPC_URL Celo RPC endpoint Forno for the selected network
CELO_MCP_USE_TESTNET Use Celo Sepolia (chain ID 11142220) instead of mainnet false
CELO_MCP_FAUCET_API_KEY Enables the faucet tools. Create one at faucet.celo.org/keys — see Faucet access unset (faucet tools disabled)
CELO_MCP_IPFS_GATEWAY HTTP gateway for ipfs:// NFT metadata and images (public gateways rate-limit) https://ipfs.io/ipfs/

GET /health returns 200 for hosting health checks. See docs/DEPLOYMENT.md for container/hosting instructions.

Usage

Running the Server

# Run the MCP server
python -m celo_mcp.server

# Or use the CLI entry point
celo-mcp-server

Available Tools

The list below is what the server registers; tests/test_readme_tools.py fails if the two drift apart. Every tool except request_faucet_funds only reads from the chain, apart from the two x402 tools, which read third-party HTTPS endpoints (a seller's URL and the Celo facilitator): nothing here signs or sends a transaction. The two faucet tools are only listed when CELO_MCP_FAUCET_API_KEY is set, so a server without a key exposes 27 read-only tools.

Blockchain Data Operations

  1. get_network_status

    • Get current network status and connection information, including the chain ID and explorer URL of the network the server is using
    • No parameters required
  2. get_block

    • Fetch block information by number, hash, or "latest"
    • Parameters: block_identifier, include_transactions (optional)
  3. get_transaction

    • Get transaction details by hash
    • Parameters: tx_hash
  4. get_account

    • Get an account's CELO balance, nonce, and whether it is a contract or an externally owned account
    • Parameters: address, include_code (optional, default false; contract bytecode can be large)
  5. get_latest_blocks

    • Get information about recent blocks
    • Parameters: count (optional, default: 10, max: 100), offset (optional, default: 0)

Token Operations

  1. get_token_info

    • Get ERC-20 token information (name, symbol, decimals, total supply)
    • Parameters: token_address
  2. get_token_balance

    • Get token balance for a specific address
    • Parameters: token_address, address
  3. get_celo_balances

    • Get CELO and stable token balances for an address
    • Parameters: address
  4. get_stable_token_balance

    • Get balances of the major stable tokens and CELO for an address in one multicall
    • Parameters: address

NFT Operations

  1. get_nft_info

    • Get an NFT's standard (ERC-721 or ERC-1155, detected via ERC-165), owner, metadata URI and the metadata behind it when it can be fetched (metadata_error says why when it cannot). Metadata fetches are capped at 1 MiB, 10 s and 3 redirects, and never go to private or loopback addresses
    • Parameters: contract_address, token_id
  2. get_nft_balance

    • Get how many tokens of an NFT contract an address holds (ERC-721: tokens of the collection; ERC-1155: balance of one token ID)
    • Parameters: contract_address, address, token_id (required for ERC-1155, ignored for ERC-721)
  3. get_mento_quote

    • Quote a swap on Mento from on-chain state: how much to_token you get for amount of from_token, via the Broker's getAmountOut. No external price API
    • Only pairs a single Mento exchange lists are quoted; otherwise available is false and reason says why (no direct Mento pair, or no Broker on Celo Sepolia)
    • Parameters: from_token (symbol or address), to_token (symbol or address), amount (whole tokens, e.g. 100)

Smart Contract Operations

  1. call_contract_function

    • Call a contract function with eth_call and return the decoded result. Read-only, including for functions that would change state
    • Integers above 2^53 come back as decimal strings and bytes as 0x-prefixed hex, so JavaScript clients do not round token amounts
    • Parameters: contract_address, function_name, abi (JSON array or JSON string), function_args (optional), from_address (optional)
  2. estimate_contract_gas

    • Estimate gas for a contract function call and its cost at the current gas price
    • Parameters: contract_address, function_name, abi, from_address, function_args (optional), value (optional, in wei)

Transaction Operations

  1. estimate_transaction

    • Estimate gas and cost for a transaction
    • Parameters: to, from_address, value (optional, in wei), data (optional)
  2. get_gas_fee_data

    • Get current gas fee data including EIP-1559 fees
    • No parameters required

Governance Operations

  1. get_governance_proposals

    • Get Celo governance proposals with pagination support
    • Parameters: include_inactive (optional), include_metadata (optional), page (optional), page_size (optional), offset (optional), limit (optional)
  2. get_proposal_details

    • Get detailed information about a specific governance proposal including content and voting history
    • Parameters: proposal_id

Staking Operations

  1. get_staking_balances

    • Get staking balances for an address, including active and pending stakes broken down by validator group
    • Parameters: address
  2. get_activatable_stakes

    • Get information about pending stakes that can be activated for earning rewards
    • Parameters: address
  3. get_validator_groups

    • Get information about all validator groups, including their members, votes, capacity, and performance metrics
    • Parameters: page (optional), page_size (optional), offset (optional), limit (optional)
  4. get_validator_group_details

    • Get detailed information about a specific validator group including its members and performance data
    • Parameters: group_address
  5. get_total_staking_info

    • Get network-wide staking information including total votes and participation metrics
    • No parameters required

Agent Identity and Reputation (ERC-8004)

Read-only views over the ERC-8004 Identity and Reputation Registries. The addresses follow the selected network, so testnet mode reads the Celo Sepolia registries.

  1. get_agent_identity

    • Resolve an agent by id: the owner of its ERC-721 token, its agent wallet, its registration URI, and the registration JSON behind that URI when it is https:// on a public host or ipfs://. Fetches have a 10 s deadline and a 256 KiB cap and do not follow redirects; anything else (other schemes, data: URIs, redirects, private or local hosts, oversize or non-JSON files) leaves registration null and explains why in registration_error
    • ipfs:// URIs are fetched through the gateway in CELO_MCP_IPFS_GATEWAY (a URL prefix the CID is appended to; default https://ipfs.filebase.io/ipfs/). Whether they resolve depends on that gateway: ipfs.io and dweb.link rate-limit fresh IPs with 429, so point the setting at your own node or a pinning service's gateway for anything load-bearing
    • An unregistered id is an error ("Agent not found"), not a traceback
    • Parameters: agent_id
  2. get_agent_reputation

    • Summarise the feedback clients left for an agent: the client addresses, the feedback count, the aggregate value with its decimals (also pre-scaled in summary_value_formatted), and every non-revoked feedback entry. An agent with no clients returns an empty summary
    • Parameters: agent_id, tag1 (optional), tag2 (optional)

x402 Operations

Read-only discovery for x402 paid APIs on Celo. The server never pays: it reads a seller's terms and the facilitator's asset list so an agent can decide whether to pay from its own wallet.

  1. get_x402_payment_requirements

    • Request a URL without a payment header and decode the HTTP 402 terms: scheme, network, pay_to, asset, atomic amount, timeout, extra, plus amount_formatted when the asset is on the Celo facilitator's list. Handles x402 v2 (payment-required header) and v1 (accepts in the body); a non-402 response returns is_x402: false with the status code
    • HTTPS on port 443 only, to hosts that resolve to public addresses (the vetted address is pinned for the connection); no URL credentials, no redirects, no request body, never sends X-PAYMENT or payment-signature; one 10 s deadline for the whole exchange, response capped at 64 KiB and the header at 16 KiB
    • Parameters: url, method (optional, GET or POST, default GET)
  2. get_x402_facilitator_support

    • List the kinds the Celo x402 facilitator settles: scheme, network, protocol version, extensions, default asset and supported assets with symbol, decimals and transfer method
    • Parameters: network (optional, mainnet or testnet, default mainnet)

Faucet Operations

Both faucet tools are testnet-only and require CELO_MCP_FAUCET_API_KEY (see Faucet access below).

  1. request_faucet_funds

    • Request testnet CELO for an address. Returns the payout transaction hash if it lands while the request is open, otherwise a request_key to poll with
    • Sends 3 CELO per request, and CELO only — no USDm or other stablecoins
    • Parameters: beneficiary, network (optional, only celo-sepolia), wait (optional, default true)
  2. get_faucet_request_status

    • Check whether a queued faucet request has paid out
    • Parameters: request_key, network (optional, only celo-sepolia)

Network selection

The server talks to one network at a time, chosen when it starts:

Setting Network RPC Explorer
default Celo mainnet (chain ID 42220) https://forno.celo.org https://explorer.celo.org
CELO_MCP_USE_TESTNET=true Celo Sepolia (chain ID 11142220) https://forno.celo-sepolia.celo-testnet.org https://celo-sepolia.blockscout.com

CELO_MCP_RPC_URL replaces the RPC endpoint but not the network: the staking and governance tools pick their contract addresses from CELO_MCP_USE_TESTNET. If you point CELO_MCP_RPC_URL at a Celo Sepolia node, also set CELO_MCP_USE_TESTNET=true. get_network_status returns a warning when the chain ID the endpoint reports does not match the configured network. Alfajores is sunset and no longer supported.

Responses and errors

Every tool returns its result as JSON text. Tools whose result has a fixed shape also declare an outputSchema and return the same data as structuredContent, so clients can validate it. Those are every tool except get_network_status, get_block, get_transaction, get_account, get_latest_blocks, get_celo_balances and get_total_staking_info, which return JSON text only.

When a call fails, the result has isError: true and a text message starting with Error:. That covers an unknown tool name (the message lists the available tools), a missing required argument (the message names it), an invalid address or hash, and RPC failures. Some tools report a failure inside a normal result instead: call_contract_function and estimate_contract_gas return success: false with the revert reason in error, and the governance tools return an error field.

Faucet access

The faucet's browser flow is gated on reCAPTCHA v3, which scores headless callers badly, so the faucet tools use its API-key path instead. Create a key at faucet.celo.org/keys (sign in with GitHub; up to 2 keys, 90-day expiry) and set it in your MCP client's env block:

{
  "mcpServers": {
    "celo-mcp": {
      "command": "uvx",
      "args": ["celo-mcp"],
      "env": { "CELO_MCP_FAUCET_API_KEY": "cfk_..." }
    }
  }
}

The key is read from the environment and never passed as a tool argument, so it does not enter the model's context or the conversation transcript.

Limits are set by the faucet, not by this server: 10 requests per 24 hours, counted per GitHub account and per beneficiary address — holding two keys does not double the allowance. Global daily and 10-minute burst ceilings apply across all keys on top of that. celo-sepolia (chain ID 11142220) is the only supported network; there is no mainnet faucet.

The faucet publishes its API contract at openapi.json and llms-full.txt; treat those as the source of truth if amounts or limits change.

Deployment note: the HTTP transport is open unless MCP_AUTH_TOKEN is set. Only configure a faucet key for stdio or authenticated deployments — otherwise anyone reaching /mcp can spend your daily allowance on arbitrary addresses, and the key can be revoked for abuse.

Key Features

Token Support

  • ERC20 Standard: Full support for ERC20 tokens
  • Mento Stable Tokens: Built-in support for USDm, EURm and BRLm (formerly cUSD, cEUR and cREAL), plus XOFm, KESm, PHPm, COPm and GHSm
  • Balance Queries: Get token balances with proper decimal formatting
  • Token Information: Retrieve name, symbol, decimals, and total supply

Smart Contract Interactions

  • Function Calls: Call contract functions with eth_call (read-only)
  • Gas Estimation: Estimate gas costs for contract interactions

Transaction Estimates

  • Gas Estimation: Gas and cost estimates for transactions
  • EIP-1559 Support: Current base fee and priority fee

Governance Support

  • Proposal Management: Retrieve and analyze Celo governance proposals
  • Voting Data: Access proposal voting history and results
  • Metadata Integration: Fetch proposal metadata from GitHub repositories
  • Pagination Support: Efficiently browse through large sets of proposals

Staking Support

  • Staking Balances: View active and pending stakes by validator group
  • Activation Tracking: Check which pending stakes can be activated
  • Validator Information: Comprehensive validator and validator group data
  • Performance Metrics: Validator scores, election status, and capacity
  • Network Statistics: Total voting power and staking participation

Development

Running Tests

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run with coverage
pytest --cov=celo_mcp

Code Quality

# Format code
black src/
isort src/

# Lint code
flake8 src/
mypy src/

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass
  6. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For questions, issues, or contributions, please:

  1. Check the existing issues on GitHub
  2. Create a new issue with detailed information
  3. Join the community discussions

Acknowledgments

  • Built on the Model Context Protocol (MCP) framework
  • Uses Web3.py for Ethereum/Celo blockchain interactions
  • Supports the Celo ecosystem and its stable token infrastructure

Metadata

Release files for celo-mcp 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for celo-mcp 0.6.0
File Size Uploaded Provenance Actions
celo_mcp-0.6.0.tar.gz 293.6 kB With provenance Details for celo_mcp-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for celo-mcp 0.6.0
File Interpreter ABI Platform Actions
celo_mcp-0.6.0-py3-none-any.whl Python 3 none any Details for celo_mcp-0.6.0-py3-none-any.whl

Total release size: 417.1 kB

Release files / celo_mcp-0.6.0.tar.gz

Download URL celo_mcp-0.6.0.tar.gz
Size 293.6 kB
Tags Source
SHA-256 checksum
How to use checksums
dc99c8fc82ce22732a5201220aa2c7b5e82bf7060c670d522fbfdbc1d067157e
BLAKE2b-256 checksum
How to use checksums
ee21e60aacd3730a5db96b377ff9f8a3a24189c7c937efe10e18634b1133e305
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / celo_mcp-0.6.0-py3-none-any.whl

Download URL celo_mcp-0.6.0-py3-none-any.whl
Size 123.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26a414288d48472ba3cb7cec7d01a5abf0264ffd0f70d3722dd671e3ed7fba35
BLAKE2b-256 checksum
How to use checksums
ac01ce6008c099f54894c56e64922c5105defba5c40d3defffd29a805ea70238
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for celo-mcp 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for celo_mcp-0.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page