Emendas parlamentares do Brasil

io.github.projects-betanullPublished by GitHub account projects-betanullv1.2.0Updated Nov 7, 2026

Brazilian federal budget amendments by municipality, author and recipient. Paid via Lightning.

VerifiedStreamable HTTPWeb executableFinanceData & Analytics

Overview

AI-generated overview

Remote MCP server for Brazilian federal parliamentary amendment (emenda) data by municipality, with free lookups and paid detail, rankings and contract tools.

What you can do
  • Find municipalities by name and get IBGE code, state and total amendments received
  • Get a municipality summary: total, per-capita value and page link, plus yearly, author, recipient (CNPJ), area and type breakdowns with a paid token
  • Rank municipalities by total or per-capita amendment value, nationally or within a state (paid)
  • List a municipality's contracts published in the PNCP over the last 12 months, with top suppliers and recent contracts (paid)
  • Buy a 24-hour pass by generating a Lightning invoice and activating it after payment
When to use it
Useful when you need quick facts on Brazilian federal budget amendments for a municipality, comparisons between municipalities, or recent municipal contract data, without building your own ETL from the Transparency Portal.
Requirements
Remote streamable HTTP endpoint; no account or API key declared. Free tools work without a token; paid tools need a 24-hour access token obtained by paying a Lightning invoice through the purchase and activation tools.
Before you install
Paid tools require spending money via a Lightning invoice; the token is issued only after payment is confirmed. Data comes from public sources (Transparency Portal, PNCP) and may be incomplete or lag behind. The README mentions R2 secrets for the ETL pipeline, which is separate from using this endpoint.

Installation

In SourceWeft

  1. Open Emendas parlamentares do Brasil in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.projects-betanull%2Fpainel-emendas/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "emendas-parlamentares-do-brasil": {
      "type": "http",
      "url": "https://painel-emendas.pages.dev/mcp"
    }
  }
}

README

Painel de Emendas — ETL (semana 1)

Baixa as emendas parlamentares do Portal da Transparência, liga cada linha ao município (código IBGE) e gera as tabelas do painel. Roda de graça todo dia no GitHub Actions.

O que sai em data/out/

ArquivoConteúdo
fato_emenda.parquetUma linha por emenda × localidade × ano, com valores empenhado / liquidado / pago, escopo (municipal, estadual, regional, nacional, outro), municipio_ibge, uf e modalidade (pix / outras)
fato_favorecido.parquetQuem recebeu o dinheiro de cada emenda (CNPJ, natureza jurídica), por mês, com municipio_ibge
metricas_municipio.parquetValor recebido por município e ano (a partir dos favorecidos), nº de emendas, autores e favorecidos, posição no ranking da UF
autores.parquetTotais por parlamentar (ou bancada/comissão) e ano
qualidade.json% do valor pago que foi ligado a um município e as 20 localidades não resolvidas de maior valor

Rodar no seu computador

bash
python -m venv .venv && source .venv/bin/activatepip install -r requirements.txtpython -m pytest -q          # testes com a amostra em tests/fixturespython -m etl.build          # baixa os dados reais e gera data/out/

ANO_INICIAL=2015 python -m etl.build muda o primeiro ano (padrão: 2020).

Colocar no ar (custo zero)

  1. Crie um repositório público no GitHub e suba esta pasta (Actions é ilimitado em repositório público).
  2. Em Actions, rode o workflow "ETL diário de emendas" na mão uma vez e baixe o artefato qualidade.
  3. Quando quiser publicar os dados: crie um bucket no Cloudflare R2 e, em Settings → Secrets and variables → Actions, cadastre R2_ACCOUNT_ID, R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY e R2_BUCKET. Sem esses segredos o workflow só gera e guarda o relatório.

Resultado da primeira execução real (02/11/2026)

  • 46.510 emendas desde 2020 e 654.094 pagamentos a favorecidos.
  • No arquivo principal, 83% do valor pago vem com localidade "MÚLTIPLO"; por isso o total por município usa o arquivo de favorecidos.
  • 99,8% do valor recebido ficou ligado a um município (5.568 municípios). O resto é "Sem informação" na própria fonte.
  • A API do IBGE não responde a partir do GitHub; a lista de municípios vem de uma cópia pública no GitHub.

Pontos a conferir

  • Nomes das colunas do CSV: o código aceita variações (etl/normalize.py, dicionário COLUNAS). Se o Portal mudar um rótulo, o build para e lista as colunas encontradas; basta acrescentar o novo nome ali.
  • Formato da localidade: os padrões reconhecidos são CIDADE - UF, CIDADE/UF, ESTADO (UF), REGIÃO (REGIÃO) e NACIONAL. O qualidade.json mostra o que sobrou; grafias diferentes entram em ALIASES_MUNICIPIO.
  • Emendas Pix: identificadas pelo nome da ação ("Transferência Especial"). Conferir com o tipo de emenda do arquivo real.
  • Acesso ao Portal a partir do GitHub: se o download falhar por bloqueio de IP estrangeiro, a alternativa é rodar o ETL no seu computador e subir os arquivos para o R2.

Próximas etapas

  • Semana 2: Transferegov (planos de ação das Emendas Pix) e população do IBGE para valor por habitante.
  • Semanas 3–4: páginas estáticas por município e parlamentar.

Source: README.md at commit 0dcca82

Tools

6

buscar_municipio

Buscar município

Encontra municípios pelo nome e devolve código IBGE, UF e total recebido em emendas parlamentares (gratuito).

Parametersnomerequired

resumo_municipio

Resumo de emendas do município

Resumo das emendas parlamentares recebidas por um município: total, por habitante e página. Com token pago, inclui por ano, autores, favorecidos (com CNPJ), áreas e tipos.

Parameterstokencodigo_ibgerequired

ranking_municipios

Ranking de municípios

Ranking dos municípios que mais receberam emendas, no Brasil ou numa UF, por valor total e por habitante (municípios acima de 50 mil habitantes). Requer token pago.

Parametersuftokenrequired

contratos_prefeitura

Contratos da prefeitura (PNCP)

Contratos dos últimos 12 meses publicados no PNCP pela prefeitura de um município: principais fornecedores (CNPJ) e contratos recentes. Requer token pago.

Parameterstokenrequiredcodigo_ibgerequired

comprar_acesso

Comprar passe de 24 h

Gera uma fatura Lightning para um passe de 24 horas às ferramentas pagas. Pague a fatura e depois chame ativar_acesso com o id.

Takes no parameters.

ativar_acesso

Ativar passe

Confere o pagamento de uma fatura gerada por comprar_acesso e devolve o token de acesso de 24 horas.

Parametersfatura_idrequired

Version history

3
  1. v1.2.0LatestNov 7, 2026
  2. v1.1.0Nov 5, 2026
  3. v1.0.0Nov 4, 2026

Score

90% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

    Declare a license in the repository or the registry entry.