parlament-mcp

parlament-mcp

An MCP server connecting AI models to the Swiss Federal Parliament via the Curia Vista OData API, enabling queries of motions, votes, members, sessions, and debate transcripts without authentication.

Category
Visit Server

README

πŸ›οΈ parlament-mcp

CI PyPI version License: MIT Swiss Public Data MCP Portfolio

Part of the Swiss Public Data MCP Portfolio – connecting AI models to Swiss public data sources.

An MCP server that connects AI models to the Swiss Federal Parliament via the Curia Vista OData API (ws.parlament.ch). Access motions, interpellations, votes, members, sessions, and debate transcripts – with no API key required (Phase 1 – No-Auth-First).


🎯 Anchor Demo Query

"Welche VorstΓΆsse zu KI in der Schule sind hΓ€ngig?" β†’ parlament_search_business(keyword="KI", keyword2="Schule", status="Eingereicht")

β†’ More use cases by audience β†’

Perfect for the KI-Fachgruppe Stadtverwaltung ZΓΌrich: find pending motions on AI in education, digitisation initiatives, or any policy topic – instantly.

<p align="center"> <img src="assets/demo.svg" alt="Demo: Claude queries pending AI motions via MCP tool call" width="720"> </p>


πŸ”§ Tools

Tool Description
parlament_search_business Search VorstΓΆsse by keyword, type, status, council, date
parlament_get_business Full details of a single business (texts, FC response)
parlament_search_members Find councillors by canton (e.g. ZH), party, council
parlament_get_votes Parliamentary votes with Ja/Nein meaning
parlament_get_sessions List recent sessions with IDs for follow-up queries
parlament_get_transcripts Debate excerpts by keyword or speaker (Amtliches Bulletin)

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     MCP Host (Claude Desktop /   β”‚
β”‚     Claude API / IDE)            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚ MCP Protocol (JSON-RPC 2.0)
              β”‚ Transport: stdio (local) / SSE (cloud)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         parlament-mcp            β”‚
β”‚   FastMCP Β· Python Β· Pydantic v2 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚ HTTPS / OData v3
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  ws.parlament.ch / odata.svc     β”‚
β”‚  Curia Vista – No Auth Required  β”‚
β”‚                                  β”‚
β”‚  Business Β· Vote Β· MemberCouncil β”‚
β”‚  Session Β· Transcript Β· ParlGroupβ”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Installation

Claude Desktop (stdio)

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "parlament": {
      "command": "uvx",
      "args": ["parlament-mcp"]
    }
  }
}

Local development

git clone https://github.com/malkreide/parlament-mcp
cd parlament-mcp
pip install -e .
python -m parlament_mcp.server

Cloud / Railway (SSE)

MCP_TRANSPORT=sse MCP_HOST=0.0.0.0 PORT=8080 python -m parlament_mcp.server
# SSE endpoint: http://your-host:8080/sse

Network binding

By default the server binds to 127.0.0.1 (localhost only). Set MCP_HOST=0.0.0.0 only inside a container/cloud context (Docker, Railway, Render, Kubernetes). Never bind to 0.0.0.0 on a local dev machine – it exposes the server to your local network (NeighborJack risk); the server logs a warning if you do so outside a detected container.

Transport is selected via MCP_TRANSPORT (stdio default, or sse / streamable-http); --http is kept as an alias for streamable-http.

Authentication (optional)

The HTTP transport is open by default (public read-only data). To require a bearer token, serve via the CORS/auth app factory and set MCP_BEARER_TOKENS:

MCP_BEARER_TOKENS="alice:tok_abc,bob:tok_def" MCP_ALLOWED_ORIGINS="https://claude.ai" \
  uvicorn parlament_mcp.server:create_http_app --factory --host 0.0.0.0 --port 8080

Each request then needs Authorization: Bearer <token>; identity comes from the validated token, not a session header (see docs/security.md).

Docker

docker compose up --build          # binds 127.0.0.1:8080 only
# or build the hardened image directly (non-root, read-only FS):
docker build -t parlament-mcp .

Kubernetes manifests (hardened securityContext, resource limits, egress NetworkPolicy, Mcp-Session-Id sticky routing) live in deploy/k8s/; an HAProxy stick-table example is in deploy/haproxy.cfg.


πŸ”— Synergies

Partner Server Combination
fedlex-mcp Law text ↔ parliamentary debate that created it
zurich-opendata-mcp City policy ↔ cantonal/federal motions
swiss-statistics-mcp Data backing ↔ motions citing statistics

Power query example:

"Zeige mir alle ZΓΌrcher Motionen zu KI in der Bildung
 und verlinke die relevanten Bundesgesetze aus fedlex-mcp."

πŸ“Š Data Source

  • API: ws.parlament.ch/odata.svc
  • Authentication: None (Phase 1 – No-Auth-First)
  • Protocol: OData v3 / JSON
  • Coverage: All parliamentary businesses since 1978; votes and transcripts
  • Update cycle: Real-time (official government data)

πŸ“œ Data sources & licenses

Source License Attribution
Curia Vista (ws.parlament.ch) CC BY 4.0 Β© Schweizer Parlament, CC BY 4.0

Every tool returns a typed structured response (FastMCP exposes the output schema) carrying source, license, provenance, match_type and count alongside typed results. Data is passed through unmodified.

🧭 Phase

This server is in Phase 1 β€” Read-only Wrapper (all tools readOnlyHint: true, no writes). The full phase model and transition criteria are in docs/roadmap.md.

πŸ”– MCP Protocol Version

Tested/targeted against MCP spec 2025-06-18 (pinned as PROTOCOL_VERSION in src/parlament_mcp/config.py). SDK updates are proposed monthly via Dependabot; spec-version bumps are recorded in CHANGELOG.md.

🧱 MCP primitives

Phase 1 uses Tools only β€” rationale and the Phase-2 Resources plan are in docs/adr/ADR-003-mcp-primitives.md.

🏷️ Tool annotations

All tools declare explicit annotations consistent with their behaviour:

Tool readOnly destructive idempotent openWorld
parlament_search_business βœ… β€” βœ… βœ…
parlament_get_business βœ… β€” βœ… βœ…
parlament_search_members βœ… β€” βœ… βœ…
parlament_get_votes βœ… β€” βœ… βœ…
parlament_get_sessions βœ… β€” βœ… βœ…
parlament_get_transcripts βœ… β€” βœ… βœ…

πŸ“ˆ Observability

Structured JSON logs go to stderr (stdout stays reserved for the stdio protocol). OpenTelemetry tracing wraps each tool call and auto-instruments outgoing HTTP; set OTEL_EXPORTER_OTLP_ENDPOINT (with the otel-export extra) to ship spans. See docs/security.md for the full security posture (Lethal-Trifecta assessment, egress allow-list, gateway hardening).


πŸ›‘οΈ Safety & Limits

Aspect Details
Access Read-only (readOnlyHint: true) β€” the server cannot modify or delete any data
Personal data Parliamentary businesses are public record by law (BGΓ–). No private data is accessed or stored.
Rate limits Built-in per-query caps: max. 100 results (businesses/members), 50 (votes/transcripts), 10 (sessions)
Timeout 20 seconds per API call
Authentication No API keys required β€” Curia Vista is publicly accessible
Data source Official Swiss federal government data (Schweizerische Parlamentsdienste)
Terms of Service Subject to ToS of ws.parlament.ch β€” Schweizerische Parlamentsdienste

Known Limitations

  • OData substringof() filter is case-sensitive for some fields
  • Transcript text search can be slow for very broad queries (use limit to control)
  • Session names may be null in the API for very recent sessions – use session ID
  • Language filter is mandatory; currently only DE is fully tested (FR, IT available)

Contributing

See CONTRIBUTING.md.


License

MIT malkreide

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured