unofficialmcp-gcp-web3-public-datasets
v1.0.0
Published
Unofficial MCP server for querying Google's Web3 public datasets on BigQuery — blockchain transactions, balances, smart contracts, DeFi, NFTs. 23 tools, 17 chains, built-in cost controls.
Maintainers
Readme
GCP Web3 Datasets MCP Server (Unofficial)
Unofficial MCP server for querying Google's Web3 public datasets on BigQuery. 17 blockchain chains, 23 tools, built-in cost controls.
Quick Start
npm install -g unofficialmcp-gcp-web3-public-datasetsOr use directly with npx:
npx unofficialmcp-gcp-web3-public-datasetsAdd to Claude Desktop
Add to your Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"gcp-web3-datasets": {
"command": "npx",
"args": ["unofficialmcp-gcp-web3-public-datasets"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "/path/to/your/bigquery-key.json",
"GCP_PROJECT_ID": "your-project-id"
}
}
}
}Optional cost control env vars:
MAX_COST_PER_QUERY_USD=1.0 (default: 1.0)
HARD_COST_CAP_USD=5.0 (default: 5.0)
MAX_ROWS=10000 (default: 10000)
QUERY_TIMEOUT_SECONDS=30 (default: 30)Supported Chains
| Family | Chains | |--------|--------| | EVM | Ethereum, Polygon, Ethereum Classic | | UTXO | Bitcoin, Bitcoin Cash, Litecoin, Dogecoin, Dash, Zcash | | Solana | Solana | | Beacon | Ethereum Beacon Chain | | Custom | Band, IoTeX, Tezos, Theta, Zilliqa, MultiversX |
Tools (23)
| Category | Tool | Description |
|----------|------|-------------|
| Discovery | list_chains | List available blockchain datasets |
| Discovery | get_schema | Get table and column details |
| Discovery | get_cost_estimate | Estimate query cost (dry-run) |
| EVM | evm_transactions | List individual transactions for address |
| EVM | evm_block_stats | Block stats for date range |
| EVM | evm_transaction_summary | Transaction summary for address |
| EVM | evm_token_transfers | ERC20/721 token transfers |
| EVM | evm_top_addresses | Top addresses by metric |
| EVM | evm_contract_info | Smart contract details |
| EVM | evm_eth_balance | Native token balance |
| EVM | evm_token_info | Token symbol/name/decimals |
| UTXO | utxo_transactions | List individual transactions for address |
| UTXO | utxo_block_stats | UTXO chain block stats |
| UTXO | utxo_transaction_summary | UTXO transaction stats |
| UTXO | utxo_address_activity | Address inputs + outputs |
| Solana | sol_transactions | List transactions for account |
| Solana | sol_block_stats | Solana block stats |
| Solana | sol_token_transfers | SPL token transfers |
| Solana | sol_transaction_summary | Transaction by signature |
| Beacon | beacon_validator_info | Validator status/balance |
| Beacon | beacon_block_stats | Block proposal stats |
| Query | build_and_run_query | Structured plan to SQL |
| Query | run_raw_sql | Raw SQL with cost gate |
Cost Controls
Every query goes through a dry-run cost estimate before execution:
- Per-query limit: $1.00 (configurable)
- Hard cap: $5.00 (configurable)
- Max rows: 10,000
- Timeout: 30 seconds
- Read-only: Only SELECT queries allowed
GCP Setup
Prerequisites
- Node.js 18+
- A Google Cloud account (free tier works)
Step 1: Create a GCP Project
- Go to Google Cloud Console
- Click Select a project > New Project
- Name it anything (e.g.
web3-datasets) and click Create - Note your Project ID (e.g.
web3-datasets-12345)
Step 2: Enable BigQuery API
- In your new project, go to APIs & Services > Enable APIs
- Search for BigQuery API and click Enable
Step 3: Create a Service Account
- Go to IAM & Admin > Service Accounts
- Click Create Service Account
- Name it
bigquery-reader - Add these two roles:
- BigQuery Data Viewer (reads public datasets)
- BigQuery Job User (runs queries)
- Click Done
Step 4: Download the Key
- Click on your new service account
- Go to the Keys tab
- Click Add Key > Create new key > JSON
- Save the downloaded JSON file somewhere safe (e.g.
~/bigquery-key.json)
Cost Expectations
The public blockchain datasets are free to access. You only pay for query compute (bytes scanned):
- BigQuery pricing: $6.25 per TB scanned
- Most single queries cost $0.00 - $0.01
- The full test suite costs ~$0.34
- The built-in cost gate rejects any query over $1.00 before it runs
Architecture
Agent (Claude) → MCP Tool Call → tools → api-client → BigQuery SDK → Google BigQuery
↓
query-builder (structured plan → SQL)
sql-sanitizer (BigQuery dialect fixes)
config (chain registry, cost limits)Two Query Modes
Structured Plan (
build_and_run_query): Agent provides a structured query plan (columns, filters, aggregations). The server generates correct BigQuery SQL deterministically.Raw SQL (
run_raw_sql): For complex queries (CTEs, JOINs, window functions). SQL is sanitized for BigQuery dialect, validated read-only, then dry-run cost checked before execution.
License
MIT
