
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.
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
| Tool | Description |
|---|---|
brparl_search_bills | Find bills by type, number, year, keywords, author, or presentation dates |
brparl_get_bill | Read a bill’s chamber stages, procedural history, and published disposition |
brparl_search_votes | Find votes by date, bill, legislative body, or participating senator |
brparl_get_vote | Read one recorded vote, with published member positions, counts, and leadership orientations |
brparl_search_members | Find deputies and senators on current or historical rosters |
brparl_get_member | Read one member’s profile, mandates, and selected supplementary records |
brparl_search_speeches | Find speeches within a date window and request complete published transcripts |
brparl_search_expenses | Read quota receipts and totals by category and supplier |
brparl_list_reference | Look up chamber identifiers, coverage notes, and official reference codes |
Capability reference
brparl_search_bills tool
- Search both chambers or select
camaraorsenado. Useauthor_statefor Câmara andin_progressfor Senado. Specifyyearfor 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 tobrparl_get_billto select a particular record.
brparl_get_bill tool
- Pass an
identifieror achamberandid. Bills can change numbers across chambers. Checkcoveragefor 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_offsetapplies to every stage, and each stage reports its ownnext_history_offset.
brparl_search_votes tool
- Search by paired inclusive dates, a bill such as
{"bill":"PL 2338/2023"}, abodysuch asplenaryor a Câmara body ID, or a Senadosenator_id. Date-only Senado searches cover at most one calendar year. - Use
brparl_get_billfor procedural history because symbolic decisions may appear only there. Pass a returnedchamberandidtobrparl_get_votefor the detail of a published vote.
brparl_get_vote tool
- Câmara IDs use
item-sequence. Senado IDs usesession/session-vote, for example{"chamber":"senado","id":"594169/7109"}. party,state, andpositionfilter 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, orlegislature. The legislature defaults to the current one. Setin_office:truefor members currently in exercise. - Historical Senado rosters can show a later party affiliation from the member’s identification record. Request
party_historywithbrparl_get_memberfor 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_coveragefor 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. containslooks for literal text within the selected window, ignoring case and accents. Setinclude_text:truefor complete published transcripts. Checktext_statusand publication-lag notices, especially for recent Senate speeches.
brparl_search_expenses tool
- Pass
chamberandmember_id, with an optionalyear. The default scope is the last six months for Câmara CEAP and the current Brasília year for Senado CEAPS.monthandsupplier_idfilters apply to Câmara. grand_total,totals_by_type, andtotals_by_suppliercover the full filtered set. BRL amounts are decimal strings.senado_yearly_totalsholds the separately published annual figures when available. Supplier CPFs are masked.
brparl_list_reference tool
- Use
topicto selectchambers,bill_types,situations,subjects,parties,committees,legislatures,vote_codes,expense_types, orstates. 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
sourcesURLs 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
- Câmara dos Deputados publishes legislative, member, vote, speech, and CEAP records through its public API. Its FAQ permits charging for applications that use the data. Câmara API · Câmara Dados Abertos FAQ
- Senado Federal provides legislative records and speeches through its legislative API and CEAPS quota expenses through its administrative API. Its portal policy allows lawful reuse with source attribution. Senado legislative API · Senado administrative API · Senado portal terms
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
| Variable | Description | Default |
|---|---|---|
MCP_TRANSPORT_TYPE | Transport, stdio or http. | stdio |
MCP_HTTP_HOST | Bind address in HTTP mode. | 127.0.0.1 |
MCP_HTTP_PORT | Port in HTTP mode. | 3010 |
MCP_HTTP_ENDPOINT_PATH | Local HTTP endpoint path. | /mcp |
MCP_SESSION_MODE | HTTP session mode. | stateless |
MCP_USAGE_REPORTING | Opt 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
| Path | Purpose |
|---|---|
src/index.ts | Registers the nine tools and configures the MCP server |
src/mcp-server/tools | MCP schemas, handlers, pagination, and response formatting |
src/services | Chamber API integration, validation, and normalization |
tests/ | Contract and service tests |
Development guide
- Handlers throw failures for the framework to classify and render.
- Use
ctx.logfor request-scoped logging and propagatectx.signalto 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.
@cyanheads/brazil-parliament-mcp-servernpm install @cyanheads/brazil-parliament-mcp-server@cyanheads/brazil-parliament-mcp-servernpm install @cyanheads/brazil-parliament-mcp-serverRelated Servers
io.github.cyanheads/anime-mcp-server
Search anime/manga, franchise relations, schedule, characters, rankings, studio filmography.
io.github.cyanheads/art-institute-chicago-mcp-server
Search the Art Institute of Chicago collection: artworks, artists, exhibitions, and audio guides.
io.github.cyanheads/arxiv-mcp-server
Search arXiv, fetch paper metadata, and read full-text content.