apuracao-2026
Provides an optional inline Telegram bot for querying official TSE election results, with commands such as /start, /br, and /uf SP [cargo].
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@apuracao-2026como está a apuração para presidente?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Apuração Eleições 2026 (TSE) — servidor MCP + bot Telegram
Resultados oficiais e parciais das eleições brasileiras, direto dos arquivos públicos da
divulgação do TSE (resultados.tse.jus.br), como tools MCP para Claude, Cursor, VS Code e
qualquer cliente Model Context Protocol — e, opcionalmente,
como bot inline do Telegram.
1º turno: domingo 04/10/2026 · 2º turno: 25/10/2026
Sem chave, sem cadastro: o TSE publica os JSON abertamente. Este projeto só decifra os códigos (
sp-c0003-e000xxx-r.json…), faz cache respeitoso (≥ 45 s por arquivo,If-Modified-Since) e normaliza a resposta.Neutralidade: só números oficiais, sempre com
apurado_pcte o horário do TSE. Nenhuma projeção, nenhum comentário, nenhum anúncio.Listado em awesome-mcp-brasil — hub curado e auto-verificado de servidores MCP e skills brasileiros (categoria Eleições / Governo).
Instalar
Docker (imagem publicada em ghcr.io)
docker run -i --rm ghcr.io/daniel-filius/apuracao-2026-mcp:v0.1.0Claude Desktop (claude_desktop_config.json) / Cursor / VS Code (mcp.json):
{
"mcpServers": {
"apuracao-2026": {
"command": "docker",
"args": ["run", "-i", "--rm", "ghcr.io/daniel-filius/apuracao-2026-mcp:v0.1.0"]
}
}
}Sem Docker (Python 3.11+ e uv)
uvx --from git+https://github.com/daniel-filius/apuracao-2026-mcp apuracao-mcp{
"mcpServers": {
"apuracao-2026": {
"command": "uvx",
"args": ["--from", "git+https://github.com/daniel-filius/apuracao-2026-mcp", "apuracao-mcp"]
}
}
}Claude Code:
claude mcp add apuracao-2026 -- uvx --from git+https://github.com/daniel-filius/apuracao-2026-mcp apuracao-mcp
# ou
claude mcp add apuracao-2026 -- docker run -i --rm ghcr.io/daniel-filius/apuracao-2026-mcp:v0.1.0Também está no registro MCP oficial
como io.github.daniel-filius/apuracao-2026.
Related MCP server: onpe-mcp
Tools
Tool | O que devolve |
| Eleições ordinárias no config oficial do TSE (ciclo, código, data, turno, cargos por abrangência) e histórico disponível |
| Parcial oficial por UF ( |
| Presidente, total nacional |
| Parcial oficial por município (nome exato, código IBGE ou código TSE) |
Cargos: presidente, governador, senador, deputado_federal, deputado_estadual,
deputado_distrital, prefeito, vereador.
Toda resposta inclui:
{
"fonte": "TSE – divulgação oficial, resultado parcial",
"atualizado_em": "04/10/2026 19:32:11",
"apurado_pct": 87.31,
"matematicamente_definido": false,
"eleicao": {"ano": 2026, "turno": 1, "codigo": "…", "ciclo": "ele2026"},
"cargo": "Governador", "abrangencia": "SP",
"totais": {"votos_validos": 0, "brancos": 0, "nulos": 0, "abstencao_pct": 0.0, "…": "…"},
"candidatos": [
{"posicao": 1, "nome": "…", "numero": "10", "partido": "…", "votos": 0, "pct": 0.0, "situacao": "…", "eleito": false}
]
}Exemplos de pergunta ao agente: "quem está na frente para governador do RS?", "como está a apuração para presidente?", "resultado de prefeito em Campinas em 2024".
Antes de o TSE publicar o pleito de 2026
Os códigos de 2026 só aparecem no config oficial (ele-c.json) perto da votação. Até lá, as
tools explicam isso e você pode usar dados históricos: ano=2022 (Eleições Gerais, 1º/2º turno)
e ano=2024 (municipais).
apuracao-mcp --smoke # lê o config do TSE e imprime o ciclo atual
apuracao-mcp --demo SP governador # resultado normalizado (2022) sem iniciar o MCPBot Telegram (opcional)
@Apuracao2026Bot em qualquer grupo: @Apuracao2026Bot SP governador ou @Apuracao2026Bot br.
Comandos: /start, /br, /uf SP [cargo].
O bot só sobe se existir APURACAO_BOT_TOKEN (ver .env.example); sem token ele sai
imediatamente. Long polling, stdlib apenas, métricas anônimas (ids hasheados) em metrics.jsonl.
APURACAO_BOT_TOKEN=... apuracao-botDesenvolvimento
python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"
pytest -q # fixtures reais do TSE (2022) em fixtures/
python -m apuracao_mcp.server # stdioPublicação: tag vX.Y.Z → workflow publish-mcp.yml roda os testes, publica a imagem em
ghcr.io/daniel-filius/apuracao-2026-mcp e registra no registro MCP oficial via GitHub OIDC
(server.json).
Apoie
Projeto voluntário, sem fins políticos e sem anúncios. Se foi útil na noite da apuração, um Pix ajuda a manter em 2028:
Pix copia-e-cola (valor livre):
00020101021226530014br.gov.bcb.pix0131danielfilho.workspace@gmail.com5204000053039865802BR5913DANIEL FILIUS6009SAO PAULO62160512APURACAO20266304CC54Fonte e limites
Dados: divulgação oficial do TSE (
https://resultados.tse.jus.br/oficial/…). Este projeto não é vinculado ao TSE. Números "parciais" podem mudar até a totalização final.Cache: 45 s por arquivo de resultado, 5 min para o config, 1 h para a lista de municípios; sem varredura de todas as UFs a cada chamada.
User-Agent identifica o projeto.
Licença MIT.
Available Tools
4 toolslistar_eleicoesListar eleiçõesA
Lista as eleições ordinárias presentes no config oficial do TSE (ciclo, código, data, turno e cargos por abrangência) e o histórico disponível. Use antes de resultado se não souber qual pleito está no ar.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the behavioral burden. It discloses the data source (official TSE config), scope (ordinary elections and available history), and returned fields, while the verb 'Lista' implies a read-only operation. However, it does not explicitly state absence of side effects, permissions, or rate limits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the tool's purpose and then the usage condition. Every sentence adds distinct value without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be fully explained. With no parameters and no annotations, the description still gives enough context: what is listed, which data source is used, and when to call it instead of `resultado`.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so there is no parameter semantics to add. Per the baseline for zero-parameter tools, a 4 is appropriate; the description does not need to explain parameters and correctly focuses on output scope and usage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Lista') and resource ('eleições ordinárias'), and names the fields returned (ciclo, código, data, turno, cargos). It also distinguishes itself from the sibling tool `resultado` by stating it should be used first when the active election is unknown.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly says when to use the tool: before `resultado` if the user does not know which election is currently active. The alternative tool is named and the selecting condition is clear, leaving little to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
municipioResultado por municípioC
Resultado parcial oficial de um cargo em um município. municipio: nome exato, código IBGE (7 dígitos) ou código TSE. Ex.: municipio('SP', 'São Paulo', 'governador').
| Name | Required | Description | Default |
|---|---|---|---|
| uf | Yes | ||
| ano | No | ||
| cargo | Yes | ||
| turno | No | ||
| limite | No | ||
| municipio | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It adds the useful qualifier 'parcial oficial' (partial, official tally) but says nothing about pagination (limite default 20), turno/year defaults, or whether results change over time as the count is finalized.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences plus a concrete example, front-loaded with the purpose. Efficient, though the example only reinforces what the first sentence already implies.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need no explanation. However, for a 6-parameter, 3-required query tool with zero annotation and zero schema coverage, the description leaves most parameters and all usage guidance undocumented.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% across 6 parameters, so the description must compensate. It documents seulement 'municipio' (exact name, 7-digit IBGE code, or TSE code), leaving uf, cargo, ano, turno and limite completely unexplained in both schema and description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource: it returns the official partial result for a cargo within a municipality. It is clear what the tool does, but it does not distinguish itself from the sibling 'resultado' (also a result tool) or explain how it differs from 'resumo_brasil' / 'listar_eleicoes'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no indication of when to use this tool versus 'resultado', 'resumo_brasil' or 'listar_eleicoes'. The example invocation shows syntax but not the selection condition, so the agent must infer scope from the name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
resultadoResultado por UFB
Resultado parcial oficial de um cargo em uma UF (ou BR para presidente). cargo: presidente, governador, senador, deputado_federal, deputado_estadual, deputado_distrital, prefeito, vereador. turno 1 ou 2. ano opcional (padrão: eleição ordinária mais próxima de hoje; 2022 para histórico).
| Name | Required | Description | Default |
|---|---|---|---|
| uf | Yes | ||
| ano | No | ||
| cargo | Yes | ||
| turno | No | ||
| limite | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It does disclose a meaningful behavioral trait – results are 'parcial' (partial) and 'oficial' – and defines the ano defaulting rule. It says nothing about pagination, data freshness, or rate/auth constraints, so the disclosure is partial rather than complete.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Dense, front-loaded, and telegraphic – the core purpose comes first, followed by the parameter notes. Slightly run-on due to stacked parentheticals, but no sentence is wasted.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be described. Still, for a 5-parameter tool with 0% schema coverage, the omission of limite semantics and the lack of any sibling-routing guidance leaves gaps an agent would have to guess at.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description must compensate and it largely does: cargo values are fully enumerated, turno is bounded to 1/2, ano's default behavior is explained, and uf gets a hint ('BR' for president). The fifth parameter, limite (default 20), is never mentioned, leaving pagination semantics undocumented.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource: retrieve the official partial result for a given office (cargo) in a given state (UF), with the BR special case for president. This is clearly distinguishable from siblings like municipio (city-level) and resumo_brasil (national summary), though the sibling contrast is left implicit.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It enumerates valid cargo values, restricts turno to 1 or 2, and explains the ano default, which is useful operational guidance. However, it never states when to prefer this tool over municipio or resumo_brasil, so the routing decision is only implied by the UF scope.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
resumo_brasilResumo Brasil (presidente)B
Resultado parcial oficial para presidente, total nacional. turno 1 ou 2; ano opcional.
| Name | Required | Description | Default |
|---|---|---|---|
| ano | No | ||
| turno | No | ||
| limite | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden. It discloses that results are 'parcial oficial' and national, but says nothing about read-only safety, authentication, rate limits, data freshness, or what 'limite' controls. Output schema exists, so return values need not be described, but safety and pagination context are absent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two telegraphic fragments with no wasted words; purpose is front-loaded before parameter hints. The brevity suits a simple lookup tool, and nothing extraneous is included.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Output schema exists, so return format is covered. However, with zero schema descriptions and no annotations, the description leaves gaps: 'limite' is unexplained, usage versus sibling tools is only implied, and behavioral traits like pagination or authentication are absent. Adequate for basic invocation, but not complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It adds a meaningful constraint for 'turno' (1 or 2) and notes that 'ano' is optional, but completely omits 'limite', leaving one of three parameters undocumented in both schema and description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States the resource precisely: official partial result for president, national total. Distinguishes from generic 'resultado' and 'municipio' siblings by specifying president/national scope. Lacks an explicit action verb but the title and noun phrase make the operation unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit when-to-use or when-not-to-use statement. The scope ('para presidente, total nacional') implies the appropriate context and differentiates from sibling tools, but no alternatives or exclusions are named. Parameter constraints (turno, ano) are not usage guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v0.1.0- First observed
listar_eleicoes - First observed
municipio - First observed
resultado - First observed
resumo_brasil
TDQS
Scored across 4 tools
Tools are mostly distinct by geographic scope: listar_eleicoes (election metadata), resultado (state-level results), resumo_brasil (national presidential summary), municipio (municipal results). However, resumo_brasil overlaps with resultado when cargo=presidente and UF=BR, which could cause confusion.
One tool follows a verb_noun pattern (listar_eleicoes), while the others are nouns (resultado, resumo_brasil, municipio). The mix is readable but not a consistent convention.
Four tools are well-scoped for a focused election results server: one for metadata, three for results at different geographic levels. Each tool earns its place without redundancy.
The surface covers listing elections, state-level results, national presidential summaries, and municipal results, with support for cargo, turno, and year. Minor gaps exist, such as candidate- or party-level drilldowns, but core retrieval workflows are covered.
Maintenance
Related MCP Connectors
Tribunal TSE: Situação Eleitoral, official-source lookup. Platform-hosted, pay per query with prepai
Tribunal TSE: Doadores e Fornecedores, official-source lookup. Platform-hosted, pay per query with p
Tribunal TSE: Certificate de Quitação Eleitoral, official-source lookup. Platform-hosted, pay per qu
IBGE: geography, census, economy and health from the official APIs, with provenance. 23 tools.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables querying Brazilian electoral data through TSE's official API. Supports candidate searches, election information, and campaign finance records for municipalities and states.72-
- FlicenseNot gradedqualityDmaintenanceMCP server for querying Peruvian electoral data (ONPE) including mesa results, candidate votes, and regional statistics. Enables natural language queries about the 2026 presidential election with local SQLite cache and live API fallback.-
- AlicenseAqualityDmaintenanceMCP Server for accessing 36 Brazilian public data sources and 1 agent, enabling AI agents to query government data on economy, legislation, transparency, judiciary, elections, environment, health, and more.6MIT
- AlicenseNot gradedqualityCmaintenanceEnables querying and retrieving Brazilian electoral clearance certificates (Certidão de Quitação Eleitoral) from the TSE using CPF, name, voter ID, birth date, and filiation. It provides a single read-only tool via MCP for integration with AI assistants.MIT