Repository avatar
Text to Speech
v0.1.1
active

brazil-parliament-mcp-server

io.github.cyanheads/brazil-parliament-mcp-server

Trace bills, votes, members, speeches, and quota expenses in Brazil’s National Congress.

Documentation

@cyanheads/brazil-parliament-mcp-server

Trace bills, votes, members, speeches, and quota expenses in Brazil’s National Congress via MCP. STDIO or Streamable HTTP.

9 Tools

Version License Docker MCP SDK npm TypeScript Bun

Install in Claude Desktop Install in Cursor Install in VS Code

Framework


Overview

Follow legislation through Brazil’s Câmara dos Deputados and Senado Federal. Find recorded votes and party orientations, look up members and mandates, read speeches, and inspect receipts paid from parliamentary quotas. Use Portuguese search terms such as inteligência artificial. Records retain the published Portuguese wording.

Tools

ToolDescription
brparl_search_billsFind bills by type, number, year, keywords, author, or presentation dates
brparl_get_billRead a bill’s chamber stages, procedural history, and published disposition
brparl_search_votesFind votes by date, bill, legislative body, or participating senator
brparl_get_voteRead one recorded vote, with published member positions, counts, and leadership orientations
brparl_search_membersFind deputies and senators on current or historical rosters
brparl_get_memberRead one member’s profile, mandates, and selected supplementary records
brparl_search_speechesFind speeches within a date window and request complete published transcripts
brparl_search_expensesRead quota receipts and totals by category and supplier
brparl_list_referenceLook up chamber identifiers, coverage notes, and official reference codes

Capability reference

brparl_search_bills tool

  • Search both chambers or select camara or senado. Use author_state for Câmara and in_progress for Senado. Specify year for older bills because upstream defaults narrow some unscoped searches.
  • Search for PL 2338/2023 with {"type":"PL","number":"2338","year":2023}. Pass a returned chamber and ID to brparl_get_bill to select a particular record.

brparl_get_bill tool

  • Pass an identifier or a chamber and id. Bills can change numbers across chambers. Check coverage for the identifiers tried in each chamber and review the published disposition for linked stages.
  • Get a compact history page with {"identifier":"PL 2338/2023","include_related":false,"history_limit":5}. This omits related and attached bill lists. history_offset applies to every stage, and each stage reports its own next_history_offset.

brparl_search_votes tool

  • Search by paired inclusive dates, a bill such as {"bill":"PL 2338/2023"}, a body such as plenary or a Câmara body ID, or a Senado senator_id. Date-only Senado searches cover at most one calendar year.
  • Use brparl_get_bill for procedural history because symbolic decisions may appear only there. Pass a returned chamber and id to brparl_get_vote for the detail of a published vote.

brparl_get_vote tool

  • Câmara IDs use item-sequence. Senado IDs use session/session-vote, for example {"chamber":"senado","id":"594169/7109"}.
  • party, state, and position filter the displayed members. Counts cover the entire published roll. Secret votes may show attendance and aggregate totals.

brparl_search_members tool

  • Search by parliamentary name, party, state, sex, or legislature. The legislature defaults to the current one. Set in_office:true for members currently in exercise.
  • Historical Senado rosters can show a later party affiliation from the member’s identification record. Request party_history with brparl_get_member for dated evidence.

brparl_get_member tool

  • Use a chamber and a string member ID, for example {"chamber":"senado","id":"825","sections":["committees","party_history"]}. Both chambers support these sections. Senado also supports leaves. Câmara supports history, professions, occupations, and external mandates.
  • Check section_coverage for supplementary records that are unavailable.

brparl_search_speeches tool

  • Câmara requires a member_id. With a member, each chamber supports windows up to one year. A Senate plenary search without a member requires both dates and a window of at most one month.
  • contains looks for literal text within the selected window, ignoring case and accents. Set include_text:true for complete published transcripts. Check text_status and publication-lag notices, especially for recent Senate speeches.

brparl_search_expenses tool

  • Pass chamber and member_id, with an optional year. The default scope is the last six months for Câmara CEAP and the current Brasília year for Senado CEAPS. month and supplier_id filters apply to Câmara.
  • grand_total, totals_by_type, and totals_by_supplier cover the full filtered set. BRL amounts are decimal strings. senado_yearly_totals holds the separately published annual figures when available. Supplier CPFs are masked.

brparl_list_reference tool

  • Use topic to select chambers, bill_types, situations, subjects, parties, committees, legislatures, vote_codes, expense_types, or states. For example, {"chamber":"camara","topic":"committees"} lists the body IDs accepted by vote search.

Features

Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.

  • Results carry official sources URLs and attribution. Keep the source credit when quoting or republishing records.
  • Check coverage, next_offset, and notices before treating a page as complete. An unavailable chamber or transcript leaves gaps in the result.
  • The server omits member CPFs, personal contact details, and private addresses. Public parliamentary contact fields and masked supplier IDs can appear where published.

Data sources and reuse

Getting started

Add it to Claude Code with Node.js 24 or later available for npx:

claude mcp add brazil-parliament-mcp-server -- npx -y @cyanheads/brazil-parliament-mcp-server

For other clients, add this to your MCP client configuration file:

{
  "mcpServers": {
    "brazil-parliament-mcp-server": {
      "command": "npx",
      "args": ["-y", "@cyanheads/brazil-parliament-mcp-server"]
    }
  }
}

The data APIs require no keys. Connections to the Câmara and Senado legislative APIs timed out during testing on one US residential network. If a call reports a connection timeout, check whether those upstream hosts are reachable from the machine running the server.

For Docker or a source build, see Running the server.

Configuration

VariableDescriptionDefault
MCP_TRANSPORT_TYPETransport, stdio or http.stdio
MCP_HTTP_HOSTBind address in HTTP mode.127.0.0.1
MCP_HTTP_PORTPort in HTTP mode.3010
MCP_HTTP_ENDPOINT_PATHLocal HTTP endpoint path./mcp
MCP_SESSION_MODEHTTP session mode.stateless
MCP_USAGE_REPORTINGOpt in to sharing tool-call summaries.false

See .env.example for the full list of optional overrides.

Running the server

Local development

Building requires Bun v1.4.4 or higher. The built server runs on Node.js 24 or later.

git clone https://github.com/cyanheads/brazil-parliament-mcp-server.git
cd brazil-parliament-mcp-server
bun install
bun run rebuild
bun run start:stdio
# or
bun run start:http

In local HTTP mode, connect the client to http://127.0.0.1:3010/mcp.

bun run devcheck
bun run test
bun run lint:mcp

Docker

docker run --rm -p 127.0.0.1:3010:3010 ghcr.io/cyanheads/brazil-parliament-mcp-server:latest

The image defaults to HTTP transport, stateless sessions, and logs in /var/log/brazil-parliament-mcp-server. For stdio, use "command": "docker" with "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/brazil-parliament-mcp-server:latest"]. To build locally, run docker build -t brazil-parliament-mcp-server .. Pass --build-arg OTEL_ENABLED=false to omit OpenTelemetry peer dependencies.

Project structure

PathPurpose
src/index.tsRegisters the nine tools and configures the MCP server
src/mcp-server/toolsMCP schemas, handlers, pagination, and response formatting
src/servicesChamber API integration, validation, and normalization
tests/Contract and service tests

Development guide

  • Handlers throw failures for the framework to classify and render.
  • Use ctx.log for request-scoped logging and propagate ctx.signal to upstream work.
  • Register tools in src/index.ts. Keep structured and text outputs equivalent.
  • Validate upstream payloads, normalize them to domain types, and preserve missing or unknown values.

Contributing

Issues are welcome. Run bun run devcheck and bun run test before submitting. For vulnerabilities, follow the security policy.

License

Apache-2.0 applies to the server code. See LICENSE.

NPM
@cyanheads/brazil-parliament-mcp-server
Install Command
npm install @cyanheads/brazil-parliament-mcp-server
Runtime: npx
NPM
@cyanheads/brazil-parliament-mcp-server
Install Command
npm install @cyanheads/brazil-parliament-mcp-server
Runtime: npx