obol-mcp

v0.2.0
obol-mcp Checked 10 hours ago Published 1 month ago

Read-only MCP server for the public Obol API: DV cluster troubleshooting and monitoring

A read-only MCP server, built on FastMCP, that lets an LLM look up Distributed Validator (DV) clusters, validators, exit coordination status and operators through the public Obol API (https://api.obol.tech). It exposes 21 tools. None of them can change anything: the server only sends GET requests, plus one POST to the read-only positions lookup. Supported networks: mainnet, hoodi, sepolia, gnosis. Holesky has been retired by the API and is rejected.

Summary extracted from the README.

Obol MCP

PyPI version Python 3.10+

A read-only MCP server, built on FastMCP, that lets an LLM look up Distributed Validator (DV) clusters, validators, exit coordination status and operators through the public Obol API (https://api.obol.tech).

It exposes 21 tools. None of them can change anything: the server only sends GET requests, plus one POST to the read-only positions lookup.

Tools

Tool What it returns Obol API endpoint
obol_api_health API, database and beacon node health GET /v1/_health
obol_cluster_lock_by_hash Cluster lock: definition (name, operators, threshold) and distributed validators GET /v1/lock/{lockHash}
obol_lock_by_config_hash Latest lock created from a definition GET /v1/lock/configHash/{configHash}
obol_locks_by_network Page of locks on a network (hashes only unless details=true) GET /v1/lock/network/{network}
obol_cluster_search Locks matching part of a lock hash or cluster name GET /v1/lock/search/{network}
obol_network_summary Total clusters, operators and ETH staked (mainnet only) GET /v1/lock/network/summary/{network}
obol_cluster_effectiveness Per-validator effectiveness ({pubkey: {"all": 0-1}}) GET /v1/effectiveness/{lockHash}
obol_cluster_validator_states Per-validator beacon state, status and balance (ETH) GET /v1/state/{lockHash}
obol_operator_clusters Locks where an address is an operator GET /v1/lock/operator/{address}
obol_operator_info Page of operators on a network GET /v1/address/network/{network}
obol_search_operators Operators matching part of an address GET /v1/address/search/{network}
obol_operator_badges Badges (Lido, Genesis Dappnode, ...) and whether each is earned GET /v1/address/badges/{address}
obol_operator_techne Techne credentials held (base, bronze, silver, gold) GET /v1/address/techne/{address}
obol_operator_incentives Claimable Obol incentives GET /v1/address/incentives/{network}/{address}
obol_cluster_exit_status_summary Signed exits per operator and validators ready to exit GET /v1/exp/exit/status/summary/{lockHash}
obol_cluster_exit_status Per-validator exit signature status (1-indexed pages) GET /v1/exp/exit/status/{lockHash}
obol_cluster_definition Pre-DKG cluster definition GET /v1/definition/{configHash}
obol_operator_definitions Definitions that include an operator GET /v1/definition/operator/{address}
obol_positions Clusters where an address is withdrawal address or fee recipient POST /v1/positions/{network}/{address} (read-only lookup)
obol_owr_tranches OWR contract recipients and threshold GET /v1/owr/{network}/{address}
obol_terms_signed_status Whether an address signed the latest terms GET /v1/termsAndConditions/{address}

Supported networks: mainnet, hoodi, sepolia, gnosis. Holesky has been retired by the API and is rejected.

Input rules

Every value that goes into a URL is validated before any request is made:

  • lock_hash, config_hash: 0x + 64 hex characters
  • addresses: 0x + 40 hex characters
  • validator pubkeys: 0x + 96 hex characters
  • network: one of the supported networks
  • sortBy, sortOrder, pool: fixed lists (see each tool's description)
  • page sizes are capped (50 for most lists, 5 for obol_locks_by_network with details=true, 100 for exit status); larger values are reduced to the cap

Guardrails

The server is meant for answering questions about specific clusters, not for bulk data collection.

  • Identifies itself: every request carries User-Agent: obol-mcp/<version>, plus (<OBOL_MCP_CLIENT_ID>) if set.
  • Rate limited: by default 30 upstream requests per minute (burst of 10). Past that, tools return an error telling the model to slow down instead of queueing.
  • No retries: upstream errors, including 5xx, are reported once and not retried.
  • Short cache: identical lookups within 30 seconds are served from memory.
  • Size limits: responses over 20 MiB are not downloaded. Results bigger than about 40 KB have long lists cut down (nested lists of up to 32 items, such as a cluster's operators, are kept whole), with a _obol_mcp_truncated field giving the full lengths.
  • Short errors: tool errors carry the HTTP status and, for 4xx, the API's one-line message. Upstream bodies, stack traces and internal exception text are never passed through.
  • No redirects are followed, and the API host is allowlisted.

Installation

pip install obol-mcp      # or: uvx obol-mcp

Claude Code

The obol plugin bundles this server along with the distributed-validators skill, which tells Claude when and how to use the tools:

claude plugin marketplace add ObolNetwork/skills
claude plugin install obol@obol

To add only the server: claude mcp add obol -- uvx obol-mcp.

Claude Desktop

Config file: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows).

{
  "mcpServers": {
    "Obol MCP": {
      "command": "uvx",
      "args": ["obol-mcp"]
    }
  }
}

Without uvx, use "command": "python", "args": ["-m", "obol_mcp"] with obol-mcp installed in that Python.

Cursor

Settings → MCP → "Add new global MCP server", with the same mcpServers entry as above.

Docker (HTTP)

docker run -p 8000:8000 -e OBOL_MCP_AUTH_TOKEN="$(openssl rand -hex 32)" ghcr.io/obolnetwork/obol-mcp

The image serves Streamable HTTP at /mcp on port 8000, runs as an unprivileged user, and installs exactly the hash-pinned dependencies in uv.lock. Clients send Authorization: Bearer <token>.

Configuration

All settings are environment variables, validated at startup; an invalid value stops the server with an error.

Variable Default Meaning
OBOL_MCP_API_BASE_URL https://api.obol.tech API origin. Must be https and one of api.obol.tech, obol-api-nonprod-dev.dev.obol.tech, obol-api-nonprod-qa.dev.obol.tech. A trailing /v1 is accepted.
OBOL_MCP_ALLOW_CUSTOM_API_URL false Allow any https host, or plain http on localhost (for a local obol-api).
OBOL_MCP_CLIENT_ID unset Appended to the User-Agent, e.g. obol-mcp/0.2.0 (slack-bot), so API operators can tell deployments apart. [A-Za-z0-9._-], up to 64 characters.
OBOL_MCP_TRANSPORT stdio stdio or http (Streamable HTTP).
OBOL_MCP_HOST 127.0.0.1 HTTP bind address. The Docker image sets 0.0.0.0.
OBOL_MCP_PORT 8000 HTTP port.
OBOL_MCP_AUTH_TOKEN unset If set (at least 32 characters), HTTP requests must send Authorization: Bearer <token>. Strongly recommended whenever the HTTP port is reachable by anything other than a trusted client.
OBOL_MCP_TIMEOUT_SECONDS 15 Per-request timeout (1–60).
OBOL_MCP_RATE_LIMIT_PER_MINUTE 30 Upstream requests per minute (1–600).
OBOL_MCP_RATE_LIMIT_BURST 10 Requests allowed back to back (1–100).
OBOL_MCP_MAX_CONCURRENCY 4 Concurrent upstream requests (1–16).
OBOL_MCP_CACHE_TTL_SECONDS 30 Cache lifetime for successful lookups; 0 disables (0–600).
OBOL_MCP_MAX_RESPONSE_BYTES 20971520 Largest upstream response that will be downloaded.
OBOL_MCP_MAX_OUTPUT_BYTES 40000 Budget for a tool result before lists are truncated. Sized to stay under Claude Code's default 25,000-token MCP output limit (hex-heavy JSON is about 2 bytes per token).

No API keys are needed: every endpoint used is public.

Example

import asyncio
from fastmcp import Client

async def main():
    async with Client("server.py") as client:
        print(await client.call_tool("obol_api_health"))
        print(await client.call_tool("obol_network_summary", {"network": "mainnet"}))
        print(await client.call_tool("obol_cluster_exit_status_summary", {"lock_hash": "0x<64 hex chars>"}))

asyncio.run(main())

Typical flows:

  • Cluster health: obol_cluster_lock_by_hash → obol_cluster_effectiveness → obol_cluster_validator_states.
  • Voluntary exit progress: obol_cluster_exit_status_summary, then obol_cluster_exit_status filtered by operatorAddress (validators that operator has not signed yet) or validatorPubkey.
  • Operator background: obol_operator_clusters, obol_operator_techne, obol_operator_badges, obol_terms_signed_status.

Development

git clone https://github.com/ObolNetwork/obol-mcp.git
cd obol-mcp
python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"

pytest                     # unit tests, no network access needed
fastmcp dev server.py      # MCP Inspector UI
python -m obol_mcp         # run over stdio

Code lives in obol_mcp/: config.py (environment settings), validation.py (input checks), client.py (the single HTTP client and its guardrails) and server.py (tool definitions). The root server.py is a shim for fastmcp dev and fastmcp.json.

Dependencies are locked in uv.lock. After changing pyproject.toml, run uv lock; CI fails if the lock is out of date.

Security checks

uv export --frozen --no-dev --no-emit-project -o /tmp/req.txt
uvx pip-audit --disable-pip -r /tmp/req.txt

CI runs the same audit on every push and pull request and weekly. Report vulnerabilities to security@obol.tech (see SECURITY.md).

License

Apache License 2.0. See LICENSE.