# Brazil 2026 Election: Official TSE Data — how to use (mcp.ai)

Ballot box reports, voting machine logs and official result releases from Brazil's electoral court (TSE) for the 2026 elections (1st and 2nd round), with file hash and source link, to look up and check with ChatGPT or Claude. Raw TSE data organized for lookup. Covers the 1st and 2nd round; the 2nd is the default. Every number comes with the TSE file, official link and SHA-256, with no opinion. Not an official report or analysis. Independent service, not affiliated with the TSE. Free.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_eleicoes?ms=1796396520000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `eleicoes_buscar_candidato`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/eleicoes`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://new.mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/eleicoes/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/eleicoes/buscar/candidato` — Candidates for every 2026 office (president, governor, senator, deputies) by ballot name or number: party, office, state, status and 1st round votes summed from the ballot box reports, with votes by city.
  - body: { ano?: integer, termos: string|number[], cargo?: string, uf?: string }
- `POST https://api.mcp.ai/api/eleicoes/cobertura` — How much data is available: sections with a ballot box report (BU) and with a voting machine log per state, out of the TSE total, and the time of the last sync. Use it before drawing conclusions from per-section data.
  - body: { ano?: integer, turno?: number }
- `POST https://api.mcp.ai/api/eleicoes/como/ler` — Short, neutral glossary: ballot box report, voting machine log, load code, why some sections close after 5 pm, extension, time zones, aggregate biometrics, file versions and SHA-256. Also shows where each piece of data comes from.
  - body: { ano?: integer }
- `POST https://api.mcp.ai/api/eleicoes/comparar/turnos` — 1st and 2nd round side by side, numbers only: for Brazil, a state or a city (official totals) or a section (ballot box report), with the 2nd minus 1st difference in each field and a check that the changes add up.
  - body: { ano?: integer, uf: string, municipio?: string, zona?: string|number, secao?: string|number, cargo?: string }
- `POST https://api.mcp.ai/api/eleicoes/conferir/bu/impresso` — Returns the official ballot box report of a section, field by field, to compare with a printed report. Find it by the load code printed on the paper or by state + city + zone + section. Does not read photos: the comparison is yours to make.
  - body: { ano?: integer, codigo_carga?: string, turno?: number, uf?: string, municipio?: string, zona?: string|number, secao?: string|number, itens?: object[] }
- `POST https://api.mcp.ai/api/eleicoes/consulta/sql` — Runs ONE read-only SELECT (or WITH … SELECT) on the public election tables (see eleicoes_esquema first). A pre-flight check on the query plan estimates the rows read and refuses above 5 million before running.
  - body: { ano?: integer, sql: string, limite?: integer }
- `POST https://api.mcp.ai/api/eleicoes/consultar/secao` — Official ballot box report (BU) of an electoral section in the 2026 elections: votes per candidate, blank, null, eligible voters, turnout, opening and closing time (local and Brasília), aggregate biometrics, load code, urn number and type, and from the log the urn model, versions, signature checks, power-on time and load computer, with the source file and SHA-256.
  - body: { ano?: integer, turno?: number, uf?: string, municipio?: string, zona?: string|number, secao?: string|number, secoes?: object[] }
- `POST https://api.mcp.ai/api/eleicoes/esquema` — Public tables and columns of this MCP's SQL database (secoes, municipios, totais_municipio, candidatos, votos_por_minuto, fontes), with the meaning of each column, 5 example queries and the source files.
  - body: { ano?: integer }
- `POST https://api.mcp.ai/api/eleicoes/estimar/sql` — Only the pre-flight check of eleicoes_consulta_sql, without running it: validates the SELECT, shows the plan, the estimated rows per table and whether it would be refused (limit of 5 million rows read).
  - body: { ano?: integer, sql: string }
- `POST https://api.mcp.ai/api/eleicoes/exportar/csv` — Same slice as filtrar_secoes, for one state (optionally one city), exported as a full CSV: returns a link that expires in 24 h, the CSV's sha256 and the row count. Up to 200 thousand rows per export.
  - body: { ano?: integer, turno?: number, uf: string, municipio?: string, filtros?: object[] }
- `POST https://api.mcp.ai/api/eleicoes/filtrar/secoes` — Filters and aggregates sections (president) without SQL, on the server: filters {field, op, value} (e.g.: closing > '18:00', votos_13, turnout, abstention %, without-biometrics %, log votes since 5 pm), aggregations and pagination.
  - body: { ano?: integer, turno?: number, uf?: string, municipio?: string, filtros?: object[], agrupar_por?: string, metricas?: string[], ordenar?: object, limite?: integer, cursor?: integer }
- `POST https://api.mcp.ai/api/eleicoes/timeline/divulgacao` — Release timeline of the 2nd round in Brazil or a state: each version of the results file published by the TSE (or one row per hour, with the votes added in that hour), with % of sections counted and votes per candidate.
  - body: { ano?: integer, uf?: string, cargo?: string, agrupar?: string, max_pontos?: integer, de?: string, ate?: string }
- `POST https://api.mcp.ai/api/eleicoes/totais` — Official totals per candidate (votes, % of valid votes, blank, null, turnout, abstentions, sections counted) for Brazil, a state or a city, from the latest collected version of the results file.
  - body: { ano?: integer, turno?: number, nivel?: string, codigo?: string, uf?: string, municipio?: string, cargo?: string }
- `POST https://api.mcp.ai/api/eleicoes/verificar/hash` — Tells whether a SHA-256 matches an official TSE file available here and which file it is; or, given a file name (e.g.: o03221pr7691000660045-bu.dat, br-c0001-e006258-u.json), returns its recorded SHA-256 and official link.
  - body: { ano?: integer, sha256?: string, arquivo?: string, itens?: object[] }
- `POST https://api.mcp.ai/api/eleicoes/votos/por/horario` — Votes cast per time slot (Brasília) in the 2nd round, counted from the voting machine logs, by state, by city or with uf 'BR' for all states side by side. States how many sections have a log available in each case.
  - body: { ano?: integer, turno?: number, uf: string, municipio?: string, de?: string, ate?: string, intervalo_minutos?: number }

## Example prompts
- "Compare the 1st and 2nd round for president in Brazil: the change for each candidate, blank, null and abstention, and whether the changes add up to the change in the electorate. For each number, show the TSE file, official link and SHA-256."
- "In the 2nd round voting machine logs, how many votes were cast between 5:30 pm and 7 pm, by state? Say how many sections have a log available in each state."
- "I have a printed ballot box report with load code [CODE]. Find the section and show the votes, eligible voters, blank and null votes and closing time from the official file, so I can compare with the paper."
- "Show the 2nd round results release timeline for Brazil, one row per hour: % of sections counted and votes per candidate. Say from what time the data starts."
- "For the state [CODE], compare the 1st and 2nd round for president: votes and valid-vote share for each candidate, abstention, blank and null votes, with the difference for each field."
- "For the city [NAME] in [STATE], compare the 1st and 2nd round for president field by field, and check that candidates, blank and null votes add up to turnout in both rounds."
- "In [CITY]/[STATE], pick a section that closed after 5:30 pm and show its ballot box report: opening, closing, votes per candidate and the log summary. Compare with the 1st round of the same section."
- "What was each candidate's share of valid votes in Santa Catarina in the 1st and 2nd round, and how many percentage points did it change? Do the same for Brazil."
- "How many more voters turned out in the 2nd round than in the 1st in Brazil? Show next to it the change in votes for each candidate."
- "What was the abstention in the 1st and 2nd round of 2026, in number and %? If earlier elections are not available, say so and point to where to check at the TSE."
- "For [STATE], show the votes cast in 30-minute slots between 4 pm and 7:30 pm from the voting machine logs, with log coverage. Repeat for [OTHER STATE] side by side."
- "Check the SHA-256 [HASH] against the TSE files available: which file and version it belongs to, and how I can check the current file on the TSE website."

## More
- Page: https://new.mcp.ai/eleicoes
- Agent spec (llms.txt): https://new.mcp.ai/eleicoes/llms.txt
- Postman collection: https://new.mcp.ai/eleicoes/postman.json
