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
Visit Server

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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured