@cyanheads/brazil-parliament-mcp-server
by cyanheads
README.md
<div align="center">
<h1>@cyanheads/brazil-parliament-mcp-server</h1>
<p><b>Trace bills, votes, members, speeches, and quota expenses in Brazil’s National Congress via MCP. STDIO or Streamable HTTP.</b></p>
<div>9 Tools</div>
</div>
<div align="center">
[](https://github.com/cyanheads/brazil-parliament-mcp-server/releases) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/brazil-parliament-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/brazil-parliament-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
</div>
<div align="center">
[](https://github.com/cyanheads/brazil-parliament-mcp-server/releases/latest/download/brazil-parliament-mcp-server.mcpb) [](https://cursor.com/en/install-mcp?name=brazil-parliament-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvYnJhemlsLXBhcmxpYW1lbnQtbWNwLXNlcnZlciJdfQ==) [](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22brazil-parliament-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cyanheads%2Fbrazil-parliament-mcp-server%22%5D%7D)
[](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
</div>
---
## 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` <sub>tool</sub>
- 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` <sub>tool</sub>
- 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` <sub>tool</sub>
- 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` <sub>tool</sub>
- 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` <sub>tool</sub>
- 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` <sub>tool</sub>
- 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` <sub>tool</sub>
- 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` <sub>tool</sub>
- 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` <sub>tool</sub>
- 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`](https://github.com/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
- 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](https://dadosabertos.camara.leg.br/swagger/api.html) · [Câmara Dados Abertos FAQ](https://dadosabertos.camara.leg.br/faq/faq-home.html)
- 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](https://legis.senado.leg.br/dadosabertos/api-docs/swagger-ui/index.html) · [Senado administrative API](https://adm.senado.gov.br/adm-dadosabertos/v3/api-docs) · [Senado portal terms](https://www12.senado.leg.br/institucional/documentos/politica-de-uso-do-portal-do-senado-federal)
## Getting started
Add it to Claude Code with Node.js 24 or later available for `npx`:
```sh
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:
```json
{
"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](#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`](./.env.example) for the full list of optional overrides.
## Running the server
### Local development
Building requires [Bun v1.4.4](https://bun.sh/) or higher. The built server runs on Node.js 24 or later.
```sh
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`.
```sh
bun run devcheck
bun run test
bun run lint:mcp
```
### Docker
```sh
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.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](.github/SECURITY.md).
## License
Apache-2.0 applies to the server code. See [LICENSE](LICENSE).
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues