Lobbywatch.ch transparency data on parliamentarians, interests, access badges
An MCP server that connects AI models to Lobbywatch.ch, the largest lobby database of the Swiss Federal Parliament β conflicts of interest, lobby groups, access badges, and transparency scores.
Part of the Swiss Public Data MCP Portfolio β connecting AI models to Swiss public data sources.
"Welche Mitglieder der WBK-N haben Interessenbindungen zu Bildungsverlagen oder privaten BildungstrΓ€gern, und wie ist ihre Transparenz-Bewertung?"
Which members of the National Council's Education Commission have declared conflicts of interest with educational publishers or private education providers, and how does their compensation transparency score compare?
β More use cases by audience β
Lobbywatch.ch maintains the largest public database on Swiss federal parliamentarians and their connections to lobby organisations: 245 parliamentarians, ~7'800 interessenbindungen (declared mandates), 139 lobby groups, 368 access-badge holders, updated weekly, licensed CC BY-SA 4.0.
lobbywatch-mcp exposes this data to Large Language Models via the Model Context Protocol. It is designed to be used alongside parlament-mcp (the official Swiss Parliament's Curia Vista data): the pair makes it possible to ask what a parliamentarian did officially and who they are connected to β in a single conversation.
dataIF REST API is used only where it returns reliable data (lobby groups, search).stale block with its download time, age and the reason the refresh failed. The source is retried every 15 minutes; lobbywatch_refresh_dump never falls back.stdio for Claude Desktop, streamable-http / sse for cloud deployments. βββββββββββββββββββββββββββββββ
LLM client β LobbywatchClient β
(Claude Desktop, β β
Inspector, β¦) β βββββββββββββββββββββ β
β β β Dump cache β β cms.lobbywatch.ch
β MCP β β (24 h TTL, β β ββββββββββββββββββββ
βΌ stdio / β β ~80 MB resident)βββββββΌββββββΊβ weekly JSON β
βββββββββββ HTTP β βββββββββββββββββββββ β β export (~17 MB) β
β FastMCP βββββββΊβ β ββββββββββββββββββββ
β server β β βββββββββββββββββββββ β ββββββββββββββββββββ
βββββββββββ β β dataIF REST βββββββΌββββββΊβ /interface/v1/ β
β β (live fallback) β β β json/β¦ β
β βββββββββββββββββββββ β ββββββββββββββββββββ
βββββββββββββββββββββββββββββββ
Outbound HTTP runs through a single httpx.AsyncClient with follow_redirects=False, an SSRF guard that blocks RFC1918 / link-local / metadata IPs, and an httpx event hook that re-resolves on every request. The dump path is the primary source of truth for parliamentarian queries; dataIF is only used for lobby group lookups and the search endpoint.
From PyPI (after first release):
pip install lobbywatch-mcp
From source:
git clone https://github.com/malkreide/lobbywatch-mcp.git
cd lobbywatch-mcp
pip install -e ".[dev]"
lobbywatch-mcp
This starts the server in stdio mode. For HTTP:
LOBBYWATCH_MCP_TRANSPORT=http LOBBYWATCH_MCP_PORT=8000 lobbywatch-mcp
A hardened multi-stage Dockerfile ships with the repo (non-root,
read-only-rootfs compatible). See docs/deployment.md
and deploy/docker-compose.example.yml
for resource limits, sticky-LB guidance and egress hardening.
docker build -t lobbywatch-mcp:0.2.0 .
docker run --rm -p 127.0.0.1:8000:8000 lobbywatch-mcp:0.2.0
Add to your claude_desktop_config.json:
{
"mcpServers": {
"lobbywatch": {
"command": "uvx",
"args": ["lobbywatch-mcp"]
}
}
}
A full example is provided in claude_desktop_config.json.
Once connected, try prompts such as:
All tool names use the lobbywatch_ namespace prefix (since 0.2.0) to
avoid collisions with sibling portfolio servers.
| Tool | Purpose | Source |
|---|---|---|
lobbywatch_get_parlamentarier(name_or_id) | Full profile + all conflicts of interest | Dump |
lobbywatch_list_interessenbindungen(name_or_id, nur_hauptberuflich, nur_aktiv) | Filtered mandate list | Dump |
lobbywatch_search_parlamentarier_nach_branche(branche_query, kommission, limit) | Cross-filter by industry and commission | Dump |
lobbywatch_get_lobbygruppe(name_or_id) | Lobby group with connected MPs and organisations | Live dataIF |
lobbywatch_get_ranking(kriterium, kommission, partei, limit) | Top-N by criterion | Dump |
lobbywatch_get_transparenzquote(kommission) | Distribution of compensation transparency labels | Dump |
lobbywatch_refresh_dump() / lobbywatch_dump_status() | Cache control | Dump |
All behaviour is controlled via environment variables:
| Variable | Default | Purpose |
|---|---|---|
LOBBYWATCH_MCP_TRANSPORT | stdio | Transport (stdio, http, sse) |
LOBBYWATCH_MCP_HOST | 127.0.0.1 | HTTP bind host (set to 0.0.0.0 only behind an auth gateway) |
LOBBYWATCH_MCP_PORT | 8000 | HTTP bind port |
LOBBYWATCH_MCP_CACHE_DIR | ~/.cache/lobbywatch-mcp | Dump cache location |
LOBBYWATCH_MCP_CACHE_TTL | 86400 (24h) | Cache time-to-live in seconds |
LOBBYWATCH_MCP_STALE_MAX_AGE | 604800 (7 days) | Oldest cached dump that may answer when the refresh fails, in seconds; 0 disables the fallback |
LOBBYWATCH_MCP_HTTP_TIMEOUT | 60 | HTTP timeout in seconds |
LOBBYWATCH_MCP_CORS_ORIGINS | (unset) | Comma-separated origin allow-list for HTTP/SSE; when set, exposes Mcp-Session-Id to browsers |
LOBBYWATCH_MCP_LOG_FORMAT | text | text (stdlib formatter) or json (structured via structlog) |
LOBBYWATCH_MCP_LOG_LEVEL | INFO | DEBUG / INFO / WARNING / ERROR |
LOBBYWATCH_MCP_OTEL_ENABLED | 0 | Set to 1 to enable OpenTelemetry tracing (requires pip install 'lobbywatch-mcp[obs]') |
LOBBYWATCH_MCP_OTEL_ENDPOINT | (unset) | OTLP/HTTP collector endpoint (e.g. http://localhost:4318/v1/traces) |
lobbywatch-mcp/
βββ src/lobbywatch_mcp/
β βββ __init__.py
β βββ __main__.py # CLI + transport selection
β βββ config.py # URLs, cache paths, attribution
β βββ client.py # Dump download + dataIF client
β βββ models.py # Pydantic v2 response envelopes
β βββ server.py # FastMCP tool registrations
βββ tests/
β βββ conftest.py # Fixture parliamentarians
β βββ test_client.py # Respx-mocked unit tests
β βββ test_server.py # Tool integration tests
β βββ test_live.py # @pytest.mark.live β excluded from CI
βββ .github/workflows/
β βββ ci.yml # Test matrix + ruff
β βββ publish.yml # PyPI OIDC Trusted Publisher
βββ claude_desktop_config.json
βββ pyproject.toml
βββ ...
The code is released under the MIT License.
The data served through this MCP is Β© Lobbywatch.ch and licensed under CC BY-SA 4.0. Every response envelope includes the attribution string. Downstream users must:
/table/parlamentarier/... dataIF REST endpoint currently returns empty result sets. The server works around this by using the weekly JSON dump instead.zutrittsberechtigungen (access badges) are not populated in the "essential" dump variant used here. A future release will add a dedicated tool using the non-essential dump.See CONTRIBUTING.md.
See SECURITY.md for the security posture, accepted-risk decisions, and how to report a vulnerability.
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.
| Era | Revision | Who reaches it |
|---|---|---|
initialize handshake | 2024-11-05 β¦ 2025-11-25 | What today's clients speak. The server answers with the revision asked for, or with the 2025-11-25 ceiling when the request asks for something newer. |
| Per-request envelope | 2026-07-28 | A request carrying the 2026-07-28 _meta envelope opens a modern connection. |
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 constants alone are the weaker form, so
tests/test_spec_2026_07_28.py measures both
eras through the assembled ASGI app: server/discover without a session, an
initialize asking for a future revision capped at 2025-11-25, and every
tool called over a 2026-07-28 connection with SDK deprecations raised as
errors.
Native to 2026-07-28. lobbywatch_refresh_dump reports its progress as
notifications/progress, which both eras deliver to any client that sends a
progressToken. It used to log via notifications/message; logging is
deprecated in 2026-07-28 (SEP-2577) and only delivered on requests that opt
in with a log level, so modern clients silently received nothing. serverInfo
now carries the package version β under 2026-07-28 it is stamped into the
_meta of every response.
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.
See CHANGELOG.md.
MIT License β see LICENSE. Data CC BY-SA 4.0 β see NOTICE.md.
malkreide Β· GitHub
Part of the Swiss Public Data MCP Portfolio.
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):
{
"mcpServers": {
"lobbywatch-mcp": {
"command": "uvx",
"args": [
"lobbywatch-mcp"
]
}
}
}
Source-derived launch command. Check the maintainerβs required arguments and credentials before running:
uvx lobbywatch-mcpMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-malkreide-lobbywatch-mcp": {
"command": "uvx",
"args": [
"lobbywatch-mcp"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the clientβs tool list, then try a read-only example from its documentation.
Claude Desktop setup referencelobbywatch-mcppypiio.github.malkreide/lobbywatch-mcp works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.