termdat-mcp
MCP server for TERMDAT, the terminology database of the Swiss Federal Administration, giving AI agents officially validated designations of Swiss authorities, departments, and legal acts across DE/FR/IT/EN with source references and validation status.
README
π¨π Part of the Swiss Public Data MCP Portfolio β open-source MCP servers connecting AI agents to Swiss public and open data. This is a private project. It is independent of any employer or institutional affiliation.
π·οΈ termdat-mcp
Official, validated Swiss administrative designations across DE / FR / IT / EN β with source references and validation status.
Overview
MCP server for TERMDAT, the terminology database of the Swiss Federal Administration, maintained by the Federal Chancellery. It gives an AI agent the officially validated designations of Swiss authorities, departments and legal acts across DE / FR / IT / EN β with source references and validation status.
Discovered through i14y-mcp, which catalogues TERMDAT as data service ff0c37eb-2f7c-4ff6-996e-d22b77bf52fc.
What this is β and what it is not. TERMDAT is not a subject dictionary. It is a certified name-plate archive: it will not tell you what Β«SonderpΓ€dagogikΒ» means, but it will tell you the official name of the authority responsible for it, and what that authority is called in French.
Measured coverage (live, 2026-07-19, German search over the Terminus field):
| Search term | Hits |
|---|---|
| Departement | 20 |
| Bildung | 13 |
| Verordnung | 8 |
| Schule | 5 |
| BehΓΆrde | 4 |
| SonderpΓ€dagogik | 3 |
| Volksschule Β· Lehrperson Β· Schulleitung Β· Unterricht Β· Kindergarten | 0 |
The thirteen Β«BildungΒ» hits are organisational names β Bildungsdirektion, Erziehungsdepartement, Departement fΓΌr Volkswirtschaft und Bildung β not pedagogical concepts. Plan accordingly: this server is strong for authority naming, official titles and abbreviations, and largely silent on domain vocabulary.
Features
- Seven read-only tools over the official TERMDAT public v2 API.
- Official designations across DE / FR / IT / EN, with source reference and validation status on every response.
- Communication QA: check up to 25 terms in one call against validated designations.
- Vocabulary cache (24 h TTL) for the 140 collections and 23 classifications, with stale-serve fallback.
- Retry with exponential backoff (2/4/8 s); explicit
MaxEntryCountto avoid silent truncation. - Dual transport:
stdio(local) and SSE (cloud). - No authentication required β public, unauthenticated API (No-Auth-First).
π― Anchor demo query
Β«What are the official French and Italian names of the education directorates of the German-speaking cantons?Β»
Resolved with list_classifications β search_terms β translate_term.
Prerequisites
- Python 3.10+
uv/uvx(recommended) orpip- Network access to
api.termdat.bk.admin.chβ no API key needed
Installation
uvx termdat-mcp
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"termdat": {
"command": "uvx",
"args": ["termdat-mcp"]
}
}
}
Quickstart
# Run locally over stdio (default transport)
uvx termdat-mcp
# From a checkout, without installing
PYTHONPATH=src python -m termdat_mcp
Configuration
All configuration is via environment variables. Defaults are safe for local use.
| Variable | Default | Purpose |
|---|---|---|
TERMDAT_MCP_TRANSPORT |
stdio |
Transport: stdio (local) or sse / streamable-http / http (cloud) |
HOST |
127.0.0.1 |
Bind host (SSE transport only). Loopback by default; set HOST=0.0.0.0 only inside a container |
PORT |
8000 |
Bind port (SSE transport only) |
TERMDAT_MCP_CORS_ORIGINS |
[] |
SSE only: explicit allowed browser origins (default-deny; never a wildcard in production) |
TERMDAT_MCP_LOG_LEVEL |
INFO |
structlog level (JSON to stderr) |
TERMDAT_MCP_VOCAB_TTL |
86400 |
Vocabulary cache TTL in seconds |
Configuration is loaded once into a typed Settings object (pydantic-settings).
Cloud (Render / Railway):
TERMDAT_MCP_TRANSPORT=sse PORT=8000 termdat-mcp # exposes /sse
Available Tools
| Tool | Purpose |
|---|---|
search_terms |
Search TERMDAT with field flags, collection and classification filters |
translate_term |
Official equivalent of an administrative term in another national language |
check_terms |
Communication QA: check up to 25 terms against validated designations |
get_entries |
Fetch known entries by numeric ID |
list_collections |
The ~140 terminology collections (filter values) |
list_classifications |
The 23 subject classifications, e.g. BILD = education |
api_status |
Availability; never returns silently empty |
All tools are annotated readOnlyHint: true, destructiveHint: false.
MCP primitives. This server uses only the Tools primitive. TERMDAT answers
are live queries with no stable resource hierarchy to expose as Resources, and
there are no server-authored Prompts. The seven tools are small and closely
related, so they live in a single server.py rather than a tools/ package.
Architecture
βββββββββββββββββββ stdio / SSE ββββββββββββββββββββββββββββ
β MCP host β ββββββββββββββββΊ β termdat-mcp β
β (Claude, IDE) β ββββββββββββββββ β β
βββββββββββββββββββ β vocabulary cache (24 h) β
β 140 collections β
β 23 classifications β
ββββββββββββββ¬ββββββββββββββ
β httpx + retry (2/4/8 s)
βΌ
https://api.termdat.bk.admin.ch/v2
βββ /Search (SearchTerm + InLanguageCode)
βββ /Entry (EntryIds)
βββ /Collection (140 values)
βββ /Classification ( 23 values, incl. BILD)
Architecture decision
This server uses Architecture A (live API only), with caching limited to the two controlled vocabularies.
Rationale (verified live on 2026-07-19):
- The API publishes a complete OpenAPI 3.0.4 specification at
/swagger/v2/swagger.jsonand declares no security schemes β unauthenticated access, No-Auth-First satisfied. - Server-side search works properly, including 11 field flags and filters by collection and classification. There is no reason to mirror the database locally, and no bulk dump is offered.
/Collection(140 entries) and/Classification(23 entries) change rarely and are needed to make filter arguments legible to an agent, so they are cached with a 24-hour TTL and a stale-serve fallback.
Consequences:
- Every search is a live call;
provenanceislive_apiexcept for vocabulary lookups. - Validation errors arrive as clean RFC 9110 payloads and are surfaced rather than swallowed.
Project Structure
termdat-mcp/
βββ src/termdat_mcp/
β βββ __init__.py
β βββ __main__.py # entry point; dual transport (stdio / SSE)
β βββ client.py # httpx client, retry, vocabulary cache
β βββ models.py # Pydantic models
β βββ server.py # MCP tool definitions
βββ tests/
β βββ test_client.py # offline, respx-mocked
β βββ test_live.py # hits the real TERMDAT API
βββ README.md
βββ README.de.md
βββ CHANGELOG.md
βββ LICENSE
βββ pyproject.toml
Safety & Limits
- Read-only. Every tool is annotated
readOnlyHint: true,destructiveHint: false; the server never writes to TERMDAT. - No credentials handled. The API is unauthenticated; the server stores and forwards no secrets.
- No silent empties.
api_statusand error paths surface failures instead of returning an empty result that looks complete. - Truncation is explicit.
MaxEntryCountis always sent andtruncatedis reported (see Known Limitations). - Licence caution. TERMDAT content carries no licence statement; every response repeats this in
source. Clarify terms with the Federal Chancellery before republishing downstream. - Egress allow-list. Requests can only reach
api.termdat.bk.admin.ch(HTTPS), enforced before every call by a frozenALLOWED_HOSTSset β no user input can redirect egress. Seedocs/network-egress.md. - Loopback by default. SSE binds to
127.0.0.1;0.0.0.0is an explicit container opt-in that warns on stderr. SSE also sets default-deny CORS, exposing onlyMcp-Session-Id. - Errors are masked. Upstream/internal error detail is logged to stderr (structlog JSON) and never returned to the model.
- Accepted risks (ADRs): DNS pinning (ADR 0001) and stateful load balancing (ADR 0002) are deliberately deferred β low risk for a single-instance, single-host, no-auth server.
- Container. A hardened, non-root
Dockerfileis provided for SSE deployments.
Known Limitations
- Administrative scope only. See the coverage table above.
check_termsreturnsnot_found, never Β«incorrectΒ», precisely because absence from TERMDAT is not evidence of error. MaxEntryCounthas a silent default of ~25. Omitting it looks like a complete result set. This server always sends the parameter explicitly and reportstruncated.- Multilingual variants are opt-in. Without
OutLanguageCode, entries return German designations only.translate_termsets it for you. - No licence statement. The I14Y catalogue record carries
license: null. Clarify terms with the Federal Chancellery before republishing TERMDAT content downstream. Every response repeats this insource. - Entry-level language coverage varies. Not every entry exists in all four languages;
translate_termomits entries without a target-language variant rather than inventing one.
Live probe findings (2026-07-19)
| Endpoint | HTTP | Status | Note |
|---|---|---|---|
/swagger/v2/swagger.json |
200 | β | OpenAPI 3.0.4, 132 KB, securitySchemes: [] |
/v2/Search |
200 | β | requires SearchTerm, InLanguageCode, ReturnType |
/v2/Entry |
200 | β | requires EntryIds, InLanguageCode |
/v2/Collection |
200 | β | 140 values |
/v2/Classification |
200 | β | 23 values, incl. BILD (education) |
/v2/ (root) |
404 | β | no index; the I14Y record points here |
InLanguageCode=deu / de-CH |
400 | β | only two-letter ISO codes, case-insensitive |
Probe note: a correction worth recording. An earlier probe concluded that OutLanguageCode filters the result set, because adding it appeared to drop all hits. It does not. Two variables had been changed at once β the parameter and the search term β and the term itself (Β«VolksschuleΒ») genuinely has zero hits. Verified afterwards across four broad terms: result counts are identical with and without OutLanguageCode; the parameter is purely additive. A regression test (test_out_language_is_additive_not_filtering) now guards this.
Rule of thumb: change one variable per probe call, or the API will confess to a crime it did not commit.
Project Phase
This server is in Phase 1 (read-only). All tools are annotated
readOnlyHint: true / destructiveHint: false and only ever query the public
TERMDAT v2 API β there are no write, send, or filesystem capabilities.
| Phase | Scope | Status |
|---|---|---|
| 1 β Read-only | Search, translate and check administrative designations | β current |
| 2 β Write-capable | (none planned) | β |
| 3 β Multi-agent | (none planned) | β |
A transition to a later phase would require a re-audit and human-in-the-loop controls before any write-capable tool is added.
MCP Protocol Version
The protocol version is negotiated at the initialize handshake by the
mcp Python SDK (pinned to >=1.2.0 in
pyproject.toml). The SDK is kept current via monthly Dependabot PRs
(.github/dependabot.yml); protocol-relevant bumps are noted in
CHANGELOG.md.
Testing
PYTHONPATH=src pytest tests/ -m "not live" # offline, respx-mocked
PYTHONPATH=src pytest tests/ -m live # hits the real API
PYTHONPATH=src ruff check src tests
Changelog
See CHANGELOG.md.
Security
See SECURITY.md for the security posture, hardening controls, and how to report a vulnerability.
Contributing
Issues and pull requests are welcome. Please keep tools read-only, run ruff check and the offline test suite before submitting, and add a CHANGELOG.md entry under [Unreleased] for user-facing changes.
Maintainers: see PUBLISHING.md for the step-by-step PyPI release process (Trusted Publishing via GitHub Release).
License
MIT for this server β see LICENSE. TERMDAT content remains subject to the Federal Chancellery's terms.
Author
Hayal Oezkan Β· github.com/malkreide
Credits & Related Projects
- Data: TERMDAT, Swiss Federal Chancellery (BK).
- Catalogue entry: I14Y data service
ff0c37eb⦠- Discovery server: i14y-mcp
- Portfolio index: swiss-public-data-mcp
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.