# Senado Br Mcp

> MCP Server for Brazilian Federal Senate open data (legislators, bills, votes)

- **Type:** MCP server
- **Install:** `agentstack add mcp-sidneybissoli-senado-br-mcp`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [SidneyBissoli](https://agentstack.voostack.com/s/sidneybissoli)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 1.1.2
- **License:** MIT
- **Upstream author:** [SidneyBissoli](https://github.com/SidneyBissoli)
- **Source:** https://github.com/SidneyBissoli/senado-br-mcp

## Install

```sh
agentstack add mcp-sidneybissoli-senado-br-mcp
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

> # ⚠️ Deprecated — this repository has moved
>
> This server is **no longer maintained here.** The Brazilian Senate MCP server now lives at
> **[senado-br-mcp-cloudflare](https://github.com/SidneyBissoli/senado-br-mcp-cloudflare)** — **66 tools**
> with level-1 **provenance**, available both **hosted** (`https://senado.sidneybissoli.com/mcp`, no setup)
> and via **npm/stdio** (`npx senado-br-mcp`, v3.x). The npm package **`senado-br-mcp` now publishes that
> server** (v3.2.1+); versions `85% one way) - identifies broad agreement |

#### Legislative Ideas (Ideias Legislativas)

| Tool | Description |
|------|-------------|
| `senado_ecidadania_listar_ideias` | List citizen-proposed legislative ideas |
| `senado_ecidadania_obter_ideia` | Get idea details including full description and conversion to bill |
| `senado_ecidadania_ideias_populares` | Get most supported legislative ideas |

#### Interactive Events (Eventos Interativos)

| Tool | Description |
|------|-------------|
| `senado_ecidadania_listar_eventos` | List interactive events (hearings, confirmations, livestreams) |
| `senado_ecidadania_obter_evento` | Get event details including agenda, guests, and video link |
| `senado_ecidadania_eventos_populares` | Get events with most citizen comments and questions |

#### Analysis Tools

| Tool | Description |
|------|-------------|
| `senado_ecidadania_sugerir_tema_enquete` | AI-assisted analysis to suggest topics for monthly surveys based on participation metrics |

> **Note:** e-Cidadania tools use web scraping with rate limiting and caching. If the e-Cidadania website is temporarily unavailable, API tools (senators, bills, votes) remain operational.

## Usage Examples

### List senators from São Paulo

```
Use senado_listar_senadores with uf: "SP"
```

### Search for Constitutional Amendments in 2024

```
Use senado_buscar_materias with sigla: "PEC", ano: 2024
```

### Get recent votes

```
Use senado_votacoes_recentes with dias: 7
```

### Find a senator by name

```
Use senado_buscar_senador_por_nome with nome: "Randolfe"
```

### Get CCJ committee members

```
Use senado_membros_comissao with sigla: "CCJ"
```

### Get polarized public consultations

```
Use senado_ecidadania_consultas_polarizadas with minimoVotos: 5000
```

### Get most supported citizen ideas

```
Use senado_ecidadania_ideias_populares with limite: 5
```

### Find upcoming interactive events

```
Use senado_ecidadania_listar_eventos with status: "agendado"
```

## Response Format

All tools return structured JSON responses:

### Success Response

```json
{
  "success": true,
  "data": { ... },
  "metadata": {
    "fonte": "Senado Federal - Dados Abertos",
    "dataConsulta": "2024-01-15T10:30:00Z",
    "endpoint": "/senador/lista/atual"
  }
}
```

### Error Response

```json
{
  "success": false,
  "error": {
    "code": "SENADOR_NAO_ENCONTRADO",
    "message": "Senator with code 99999 was not found",
    "suggestion": "Use senado_buscar_senador_por_nome to find the correct code"
  }
}
```

## Development

### Prerequisites

- Node.js 18+
- npm

### Setup

```bash
npm install
```

### Build

```bash
# Build stdio version (npm package)
npm run build

# Build HTTP server version
npm run build:server

# Build both
npm run build:all
```

### Development Mode

```bash
# stdio mode
npm run dev

# HTTP server mode
npm run dev:server
```

### Type Check

```bash
npm run typecheck
```

### Test with MCP Inspector

```bash
npm run inspect
```

---

## Self-Hosting HTTP Server

You can host your own HTTP server instance.

### Local

```bash
npm run build:server
npm run start:server
# Server runs on http://localhost:3000
```

### Railway

1. Fork this repository
2. Connect Railway to your GitHub
3. Deploy (auto-detects configuration from `railway.json`)
4. Set environment variables:
   - `MONTHLY_REQUEST_LIMIT` (default: 10000)
   - `ALERT_WEBHOOK_URL` (optional, for notifications)

### Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `PORT` | Server port | 3000 |
| `MONTHLY_REQUEST_LIMIT` | Monthly request limit | 10000 |
| `ALERT_WEBHOOK_URL` | Webhook for alerts | - |
| `LOG_LEVEL` | Logging level | info |

## Data Sources

### Official API
- **API**: [Senado Federal - Dados Abertos](https://legis.senado.leg.br/dadosabertos)
- **Documentation**: https://legis.senado.leg.br/dadosabertos/docs/
- **Format**: JSON
- **Authentication**: None (public data)

### e-Cidadania (Web Scraping)
- **Website**: [e-Cidadania](https://www12.senado.leg.br/ecidadania)
- **Content**: Public consultations, legislative ideas, interactive events
- **Method**: HTML scraping with rate limiting (1 req/sec) and caching (15min-24h)
- **Fallback**: If e-Cidadania is unavailable, API tools continue working

## Bill Types (Tipos de Matéria)

| Code | Name | Description |
|------|------|-------------|
| PEC | Proposta de Emenda à Constituição | Constitutional Amendment |
| PL | Projeto de Lei | Ordinary Law Bill |
| PLP | Projeto de Lei Complementar | Complementary Law Bill |
| MPV | Medida Provisória | Provisional Measure |
| PDL | Projeto de Decreto Legislativo | Legislative Decree Bill |
| PRS | Projeto de Resolução do Senado | Senate Resolution Bill |
| PLC | Projeto de Lei da Câmara | Chamber of Deputies Bill |

## License

MIT

## Author

Sidney da Silva Pereira Bissoli

## Repository

https://github.com/SidneyBissoli/senado-br-mcp

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## Changelog

### 1.1.0

- Added e-Cidadania integration (11 new tools)
- Web scraping infrastructure with rate limiting and caching
- Public consultations analysis (polarized/consensual)
- Legislative ideas tracking
- Interactive events monitoring
- Survey topic suggestion tool

### 1.0.0

- Initial release
- 22 tools for Senate data access
- Senators, bills, votes, committees, agenda, and lookup tools

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [SidneyBissoli](https://github.com/SidneyBissoli)
- **Source:** [SidneyBissoli/senado-br-mcp](https://github.com/SidneyBissoli/senado-br-mcp)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v1.1.2 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **1.1.2** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-sidneybissoli-senado-br-mcp
- Seller: https://agentstack.voostack.com/s/sidneybissoli
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
