Base dos Dados MCP

Base dos Dados MCP

This MCP server provides AI-optimized access to Brazil's largest open data platform, Base dos Dados, enabling dataset search and direct BigQuery SQL execution for Brazilian public datasets.

Category
访问服务器

README

Base dos Dados MCP

A Model Context Protocol (MCP) server that provides AI-optimized access to Base dos Dados, Brazil's largest open data platform.

💡 Create Reports with Real Brazilian Datasets with Claude Desktop

Ask it to replicate a news article:

User:
https://www.gov.br/secom/pt-br/assuntos/noticias/2025/05/no-melhor-abril-do-novo-caged-brasil-gera-257-mil-vagas-com-carteira-assinada

consegue replicar a materia e checar os numeros?

Claude: https://claude.ai/public/artifacts/15d7f5c5-f017-4a96-9380-a93e535001fd

Or a research question

User:
https://claude.ai/share/f8dbbe5b-1c34-4804-9462-1bfb9008558d

Claude: https://claude.ai/share/f8dbbe5b-1c34-4804-9462-1bfb9008558d

✨ Features

  • 🔍 Smart Search: Portuguese language support with accent normalization
  • 📊 BigQuery Integration: Direct SQL execution and table references
  • 🇧🇷 Brazilian Data Focus: IBGE, RAIS, TSE, INEP datasets
  • 🤖 AI-Optimized: Single-call comprehensive data retrieval

🚀 Quick Install to Claude Desktop

Just run this line in your terminal

bash -i <(curl -LsSf https://raw.githubusercontent.com/JoaoCarabetta/basedosdados-mcp/refs/heads/main/install.sh)

Add your BigQuery project_id, location and service account.

Restart Claude Desktop and you are good to go!

⚠️ I just tested it in my Mac M-Series

🛠️ Tools

Tool Description
search_datasets Search datasets with Portuguese support
get_dataset_overview Get complete dataset overview with tables
get_table_details Get table details with columns and SQL samples
execute_bigquery_sql Execute SQL queries directly
check_bigquery_status Check BigQuery authentication

🔧 Development

Quick Development Setup

Set up the MCP server for local development with live code reloading:

git clone https://github.com/JoaoCarabetta/basedosdados-mcp
cd basedosdados-mcp
./dev_install.sh

This script will:

  • ✅ Install all dependencies in development mode
  • ✅ Create a development wrapper script with live reloading
  • ✅ Configure Claude Desktop with basedosdadosdev server
  • ✅ Set up proper environment variables and paths

Manual Development Setup

If you prefer manual setup:

# Clone and install dependencies
git clone https://github.com/JoaoCarabetta/basedosdados-mcp
cd basedosdados-mcp
uv sync --extra dev

# Run development server
uv run basedosdados-mcp-dev

# Or test directly
./run_dev_server.sh

Development Features

  • 🔄 Live Code Reloading: Changes to src/ are reflected immediately
  • 🐛 Debug Logging: Enhanced logging for development
  • 🧪 Full Test Suite: Comprehensive pytest-based tests
  • 🎯 Separate Server: basedosdadosdev server in Claude Desktop
  • ⚡ Fast Development: No need to reinstall after code changes

🧪 Testing

Install development dependencies and run the comprehensive test suite:

# Install dev dependencies (includes pytest)
uv sync --extra dev

# Run all encoding tests
pytest tests/ -v

# Run specific test categories
pytest tests/ -k "encoding" -v        # Encoding tests only
pytest tests/ -k "live" -v            # Live server tests only
pytest tests/ -m "not live" -v        # Skip live tests (faster)

# Run with coverage
pytest tests/ --cov=basedosdados_mcp --cov-report=html

Test Structure

The pytest-based test suite includes:

  • test_encoding_pytest.py: Core Portuguese character encoding tests

    • UTF-8 encoding/decoding validation
    • JSON serialization integrity
    • MCP protocol compatibility
    • Parametrized tests for individual Portuguese words
  • test_live_mcp_pytest.py: Live MCP server endpoint tests

    • Real API response validation
    • Backend API encoding verification
    • Large response handling
    • End-to-end encoding flow
  • conftest.py: Shared fixtures and pytest configuration

    • Common test data and utilities
    • Automatic test marking and organization

Encoding Validation

Portuguese characters tested: população, educação, saúde, região, satélites, políticas, públicas, and 30+ more common Brazilian dataset terms.

Corruption patterns detected: é, á, í, ó, ú, ã, ç, ô, ê, à , õ (common UTF-8 corruption)

If you experience encoding issues in Claude Desktop (e.g., seeing satélites instead of satélites), run the tests to verify the issue is in the display layer, not the MCP server itself.

📚 About

Base dos Dados is Brazil's largest open data platform, providing standardized access to Brazilian public datasets through BigQuery.

Data Coverage: Demographics, Economics, Education, Politics, Health, Environment

📄 License

MIT License

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选