
Parlament Mcp
io.github.malkreide由 GitHub 账号 malkreide 发布v0.4.1更新于 Oct 24, 2026
Swiss Federal Parliament Curia Vista OData API
概览
只读 MCP 服务器,让助手检索瑞士联邦议会数据:动议、表决、议员、会期以及逐字辩论记录。
- 可以做什么
- 按关键词、类型、状态、议会或日期检索议会事务(动议、质询),并查看单个事务的完整详情与文本。按州、党派或议会查找议员,并列出近期会期及其编号。查询议会表决结果及赞成与反对的含义。检索辩论记录,返回带 AB 引注和来源链接的可引用摘录,再按编号获取单篇发言的逐字全文,支持分页并标注是否截断。
- 适用场景
- 适合研究瑞士联邦政治:查找某议题上待决或已处理的动议、查看某位议员的表决立场,或引用议会中确切发言并附可核实的引注。它只覆盖联邦层面;州和市镇议会由另一个服务器负责。
- 运行要求
- 通过 stdio 在本地运行,通常用 uvx 从 parlament-mcp 的 PyPI 包启动(需要 Python)。无需 API 密钥或账号。需要能通过 HTTPS 访问 ws.parlament.ch 的 Curia Vista OData 接口。也可通过 MCP_TRANSPORT、MCP_HOST、MCP_BEARER_TOKENS 等环境变量以 HTTP/SSE 方式托管。
安装
在 SourceWeft 中
- 打开 控制台中的 Parlament Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
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.
Note: This server covers the federal level (Curia Vista). This repo additionally hosts a self-contained subproject under
openparldata-mcp/— the subnational counterpart for the 26 cantons and ~70 municipal parliaments (OpenParlData.ch). The two are independent servers.
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 the verbatim
debate transcripts of the Amtliches Bulletin – with no API key required
(Phase 1 – No-Auth-First).
🎯 Anchor Demo Queries
Metadata layer:
"Welche Vorstösse zu KI in der Schule sind hängig?" →
parlament_search_business(keyword="KI", keyword2="Schule", status="Eingereicht")
Verbatim transcripts (Amtliches Bulletin):
"What did National Councillor Munz say in the 2024 spring session about the Volksschule? Give me the exact wording with a correct AB citation." →
parlament_search_transcripts(speaker_name="Munz", session_id=5202, keyword="Volksschule")→ thenparlament_get_transcript(transcript_id=…)for the full wording.Returns short, citable excerpts (
AB 2024 N, 2024-03-13, Munz Martina) with a stable source URL; the verbatim text is fetched on demand, never in bulk.
Perfect for the KI-Fachgruppe Stadtverwaltung Zürich: find pending motions on AI in education, or quote what was actually said in the chamber – instantly.
[Demo: Claude queries pending AI motions via MCP tool call]
🔧 Tools
🏗️ Architecture
🚀 Installation
Claude Desktop (stdio)
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
Local development
Cloud / Railway (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:
Each request then needs Authorization: Bearer <token>; identity comes from the
validated token, not a session header (see docs/security.md).
Docker
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
Power query example:
📊 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 since ~2000. Structured verbatim transcripts (Amtliches Bulletin) from 1999-12-06 onward (earlier years 1891–1999 exist only as archive scans — see Known Limitations).
- Update cycle: Real-time (official government data)
Copyright — verbatim quotation is allowed
Official proceedings of Swiss authorities are excluded from copyright under Art. 5 para. 1 lit. a URG (Swiss Copyright Act). The verbatim wording of parliamentary debates in the Amtliches Bulletin may therefore be reproduced and quoted freely — which is exactly what the transcript tools return: the wording itself, never a summary standing in for it.
📜 Data sources & licenses
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
This server speaks two protocol eras over the same endpoint. The client's first request on a connection decides which one applies; a later claim from the other era is refused.
Both revisions are pinned in
tests/test_protocol_version.py and asserted
against the installed SDK, so a Dependabot bump of mcp cannot move either one
silently. The same file also measures the negotiation: one real client
connection per era against the registered server, reading the revision off the
connection instead of inferring it from a constant.
In the 2026-07-28 era there is no handshake to carry the server's identity;
the SDK stamps io.modelcontextprotocol/serverInfo into the result _meta
instead. The server passes its package version there
(tests/test_server_info.py), so both eras report
the same version.
Note that the SDK's LATEST_PROTOCOL_VERSION is an alias for the modern
era, not for the handshake era — pinning against it alone would leave the era
that current clients actually negotiate free to drift.
Update policy. When the gate fails, do not edit the constant blindly: read
the spec changelog between the two revisions, verify the server still behaves,
then move the constant, this section, README.de.md and
CHANGELOG.md together.
🧱 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:
📈 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
Known Limitations
General
- OData
substringof()filter is case-sensitive for some fields. - Session names may be
nullin the API for very recent sessions – use session ID.
Transcripts (Amtliches Bulletin) — verified live 2026-07-19:
- Temporal coverage: from 1999-12-06 only. The structured
Transcriptentity reaches back to Dec 1999. Debates from 1891–1999 exist only as scanned archive documents (Bundesarchiv / Amtsdruckschriften) and are not connected here (no OCR in scope). A query whose whole date window predates coverage returns an explanatory error, not an empty result. - No page number in the source. The API carries no page/column field, so the
classic
AB <year> N <page>form cannot be built. We emit a stable, verifiable substitute —AB <year> <N|S>, <date>, <speaker>— plus the authoritativesource_url(SubjectId) and thetranscript_id. This is a documented, honest trade-off, not an omission. - Language behaviour (important).
Languageis the edition, not the spoken language. The tools filterLanguage eq 'DE'purely to deduplicate the three byte-identical editions (DE/FR/IT) down to one copy. Every speech is returned in its original wording; a French or Italian speech is not hidden — its real language is reported in thelanguagefield (de/fr/it). The response states this vialanguage_note. - Truncation is explicit, never silent. Search returns short excerpts
(
snippet, ~320 chars) withis_excerpt,total_length_charsand a hint to fetch the full text.parlament_get_transcriptcaps output atmax_chars; when it truncates it setsis_excerpt=Trueand returns anext_offsetto continue. - Verbatim only, never summarised. The wording is the product; the tools never substitute a summary for the actual text.
- Latency: a free-text
keywordcombined with aspeaker_nameis the slowest path (~40 s). Add asession_id,business_numberor date window to keep reads around 1–2 s.
🧪 Testing
HTTP is mocked with respx; network-dependent tests are marked
@pytest.mark.live and excluded from CI via -m "not live". Tool definitions are
pinned in tool-hashes.json (python -m parlament_mcp.tool_hashes --check).
Contributing
See CONTRIBUTING.md.
Security
See SECURITY.md for the security policy and posture (vulnerability reporting, Lethal-Trifecta assessment, accepted risks).
License
MIT © Hayal Oezkan — see LICENSE
Author
Hayal Oezkan · github.com/malkreide
Installation
Run via uv's uvx — no clone or manual install needed. Add to your MCP client config (mcpServers for Claude Desktop, Cursor and Windsurf; use a top-level servers key for VS Code in .vscode/mcp.json):
来源:README.md,提交 48a55f7
工具
0版本历史
2- v0.4.1最新Sep 27, 2026
- v0.3.5Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分