register-mcp
Provides access to the Swiss Federal Commercial Register (Zefix) for company search, verification, and reference data, enabling natural language queries for public administration use cases.
README
π¨π Part of the Swiss Public Data MCP Portfolio
ποΈ register-mcp
MCP Server for the Swiss Federal Commercial Register (Zefix/Handelsregister) and supporting reference data
Overview
register-mcp provides AI-native access to the Swiss Federal Commercial Register via the Zefix REST API, all without authentication:
| Source | Data | API |
|---|---|---|
| Zefix (Handelsregister) | Swiss companies, legal forms, SHAB mutations | ZefixREST v1 |
| SHAB | Official Gazette of Commerce β mutation publications | Embedded in Zefix |
Designed for Swiss public administration use cases: vendor verification, contract partner due diligence, procurement screening, and supplier onboarding β all via natural language queries.
Anchor demo query: "We want to sign a framework agreement with Lehrmittelverlag ZΓΌrich AG. Is the company active in the commercial register, what is its stated corporate purpose, and have there been any SHAB mutations in the past two years?"
Features
- ποΈ 6 tools for company search, verification, and reference data
- π
zefix_verify_companyβ quick active/dissolved status check - π Bilingual output (Markdown / JSON)
- π No API key required β open data from zefix.admin.ch
- βοΈ Dual transport β stdio (Claude Desktop) + SSE (cloud)
Prerequisites
- Python 3.11+
- uv (recommended) or pip
Installation
# Clone the repository
git clone https://github.com/malkreide/register-mcp.git
cd register-mcp
# Install
pip install -e .
# or with uv:
uv pip install -e .
Or with uvx (no permanent installation):
uvx register-mcp
Quickstart
# stdio (for Claude Desktop)
python -m register_mcp.server
# SSE (cloud deployment) β MCP_API_KEY is REQUIRED
MCP_API_KEY=$(openssl rand -hex 32) MCP_TRANSPORT=sse PORT=8000 \
python -m register_mcp.server
SSE / Cloud Deployment
When running with MCP_TRANSPORT=sse, the server enforces:
- Bearer-token auth β set
MCP_API_KEYto a secret string. Clients must sendAuthorization: Bearer <key>on every request. Missing or wrong β HTTP 401. The server refuses to start withoutMCP_API_KEYset. - Rate limiting β sliding window per bearer-token hash. Defaults: 60 req / 60 s.
Tunable via
MCP_RATE_LIMITandMCP_RATE_WINDOW. Exceeding the limit returns HTTP 429 withRetry-After. - Structured JSON logging β every tool call emits one line to stderr with
tool,status,latency_ms. Auth failures and rate-limit events are logged at WARNING level. Configure verbosity withLOG_LEVEL(defaultINFO). - Reference-data cache β Zefix legal-forms are cached for 24h
(
LEGAL_FORMS_TTLseconds) to avoid an extra upstream call per tool invocation. - Egress allow-list β outbound HTTP is restricted to
www.zefix.admin.chvia anhttpxrequest hook that also fires on redirects. ALocationheader pointing elsewhere raisesEgressDeniedand is never followed. Override withMCP_ALLOWED_HOSTS=host1,host2(comma-separated, lower-case). - Optional OpenTelemetry tracing β install with
pip install register-mcp[otel]and setOTEL_EXPORTER_OTLP_ENDPOINT(e.g.http://otel-collector:4318/v1/traces). Without the extra or without the env var the server stays silent β no hard dependency on the OTel SDK.
For multi-instance deployments, place a real gateway (Cloudflare, Railway internal networking, an API-Gateway with Redis-backed rate limiting) in front of the in-memory limiter, which is per-process by design.
Container deployment
A minimal multi-stage Dockerfile ships with the repo. The image runs as a
non-root mcp user; dependencies are resolved from uv.lock (uv sync --frozen), so the build is reproducible.
docker build -t register-mcp:local .
docker run --rm -p 8000:8000 \
-e MCP_TRANSPORT=sse \
-e MCP_API_KEY="$(openssl rand -hex 32)" \
register-mcp:local
For local iteration there is a compose.yaml with read_only, cap_drop: ALL
and no-new-privileges:
MCP_API_KEY=$(openssl rand -hex 32) docker compose up --build
See SECURITY.md for hardening notes (egress restriction, key rotation, SIEM forwarding).
Try it immediately in Claude Desktop:
"Is Lehrmittelverlag ZΓΌrich AG active in the commercial register?" "Look up the company with UID CHE-108.954.978" "List all Swiss legal forms"
Configuration
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"register": {
"command": "python",
"args": ["-m", "register_mcp.server"]
}
}
}
Or with uvx:
{
"mcpServers": {
"register": {
"command": "uvx",
"args": ["register-mcp"]
}
}
}
Config file locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Cloud Deployment (SSE for browser access)
For use via claude.ai in the browser (e.g. on managed workstations without local software):
Render.com (recommended):
- Push/fork the repository to GitHub
- On render.com: New Web Service β connect GitHub repo
- Set start command:
python -m register_mcp.server --http --port 8000 - In claude.ai under Settings β MCP Servers, add:
https://your-app.onrender.com/sse
π‘ "stdio for the developer laptop, SSE for the browser."
Available Tools
| Tool | Description |
|---|---|
zefix_search_companies |
Search companies by name, canton, legal form |
zefix_get_company |
Full company profile by internal EHRAID |
zefix_get_company_by_uid |
Company lookup by UID (CHE-xxx.xxx.xxx) |
zefix_verify_company |
Quick active/dissolved status check |
zefix_list_legal_forms |
All Swiss legal forms with IDs |
zefix_list_municipalities |
Swiss municipalities with BFS IDs |
Example Use Cases
| Query | Tool |
|---|---|
| "Is Lehrmittelverlag ZΓΌrich AG active?" | zefix_verify_company |
| "Look up CHE-108.954.978" | zefix_get_company_by_uid |
| "Find companies named Migros in canton ZH" | zefix_search_companies |
| "List all Swiss legal forms" | zefix_list_legal_forms |
| "Show municipalities in canton Bern" | zefix_list_municipalities |
Architecture
βββββββββββββββββββ ββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββ
β Claude / AI ββββββΆβ register-mcp ββββββΆβ Zefix (Handelsregister) β
β (MCP Host) βββββββ (MCP Server) βββββββ ZefixREST/api/v1 β
βββββββββββββββββββ β β ββββββββββββββββββββββββββββ
β 6 Tools β
β Stdio | SSE β
β No authentication required β
ββββββββββββββββββββββββββββββββ
Data Source Characteristics
| Source | Protocol | Coverage | Auth |
|---|---|---|---|
| Zefix (Phase 1) | REST/JSON | Swiss companies, legal forms, SHAB | None |
| ZefixPublicREST (Phase 2) | REST/JSON | Signatories, capital, full history | Basic Auth (free) |
| UID Register (Phase 3) | SOAP | MwSt, NOGA codes, cross-validation | Public (20 req/min) |
Phased Implementation
| Phase | API | Auth | Status |
|---|---|---|---|
| Phase 1 | ZefixREST/api/v1 |
None | Current |
| Phase 2 | ZefixPublicREST/api/v1 |
Basic Auth (free, email zefix@bj.admin.ch) | Planned |
| Phase 3 | UID-Register SOAP | Public (20 req/min) | Planned |
Phase 2 will add: signatory details, share capital, full historical entries. Phase 3 will add: MwSt status, NOGA industry codes, cross-register validation.
Project Structure
register-mcp/
βββ src/register_mcp/
β βββ __init__.py # Package
β βββ server.py # 6 tools (Zefix + reference data)
βββ tests/
β βββ test_server.py # Unit + integration tests (mocked HTTP)
βββ docs/demo/
β βββ demo.tape # vhs recording script β demo.gif
β βββ demo.py # Standalone CLI demo (live Zefix API)
β βββ README.md # How to generate the demo GIF
βββ .github/workflows/ci.yml # GitHub Actions (Python 3.11/3.12/3.13)
βββ pyproject.toml
βββ CHANGELOG.md
βββ CONTRIBUTING.md
βββ LICENSE
βββ README.md # This file (English)
βββ README.de.md # German version
Known Limitations
- Search by canton without a name filter may return API errors (Zefix API limitation)
- SHAB publication message text contains XML-style markup (
<FT TYPE="F">...) - Phase 1 API may be rate-limited under heavy load; retry after a short delay
- ZefixPublicREST (new API) requires registration: email zefix@bj.admin.ch
Safety & Limits
Rate Limits
| API | Limit | Notes |
|---|---|---|
| ZefixREST (Phase 1) | Not officially documented | Throttling possible under heavy load β retry after 1β2 s |
| ZefixPublicREST (Phase 2) | Not officially documented | Requires prior registration (free) |
| UID-Register SOAP (Phase 3) | 20 req/min | Hard limit, publicly documented |
Data Privacy
- Read-only access β all tools carry
readOnlyHint: True; the server performs no write, delete, or mutation operations against any API - No data storage β the server acts as a stateless proxy; no company data is persisted, cached, or logged beyond the current request
- Public register data only β the Zefix Handelsregister is a public federal register (HRegV); data returned is legally public information, not personal data in the sense of DSG/GDPR
- No personal tracking β the server does not transmit user identity, query history, or session data to zefix.admin.ch
Terms of Service & Data Sources
- Zefix API ToS: Usage of the Zefix REST API is governed by the zefix.admin.ch terms of use. The data is published under the Open Government Data (OGD) Switzerland principles.
- SHAB: Swiss Official Gazette of Commerce β published by the Federal Chancellery (BK). Public by law.
- Institutional use: This server is designed for read-only queries in public administration workflows. Not suitable for mass harvesting or automated surveillance use cases.
Security
- No credentials are stored or transmitted (Phase 1)
- Phase 2 credentials (
ZEFIX_USER,ZEFIX_PASSWORD) are passed via environment variables only β never hardcoded - All HTTP calls use HTTPS exclusively
- Tool inputs are validated via Pydantic v2 before any API call is made
Demo

π½οΈ Terminal GIF coming soon β see
docs/demo/to generate it locally with vhs
Example interaction:
User: "Is Lehrmittelverlag ZΓΌrich AG active in the commercial register?"
β Tool: zefix_verify_company(name="Lehrmittelverlag ZΓΌrich AG")
Claude: β
Lehrmittelverlag ZΓΌrich AG is ACTIVE in the Handelsregister.
UID: CHE-109.741.634 | Canton: ZH | Legal form: AG
Last SHAB mutation: 2024-06-15
β More use cases by audience β
To generate the demo GIF locally:
# Install vhs (macOS/Linux)
brew install vhs # macOS
# or: go install github.com/charmbracelet/vhs@latest
# Generate
vhs docs/demo/demo.tape
# β outputs docs/demo/demo.gif
Testing
# Unit tests (no API key required)
PYTHONPATH=src pytest tests/ -m "not live"
# Integration tests (live API calls)
pytest tests/ -m "live"
Changelog
See CHANGELOG.md
Contributing
See CONTRIBUTING.md
License
MIT License β see LICENSE
Author
Hayal Oezkan Β· malkreide
Credits & Related Projects
- Zefix: zefix.admin.ch β Swiss Federal Commercial Register (BJ/FOJ)
- SHAB: Swiss Official Gazette of Commerce β mutation publications
- Protocol: Model Context Protocol β Anthropic / Linux Foundation
- Related: fedlex-mcp β Commercial register ordinance (HRegV)
- Related: zurich-opendata-mcp β Company seat + geodata
- Related: swiss-statistics-mcp β Industry statistics by NOGA
- Related: swiss-snb-mcp β Economic indicators
- Portfolio: Swiss Public Data MCP Portfolio
<!-- mcp-name: io.github.malkreide/register-mcp -->
<!-- BEGIN GENERATED: install -->
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):
{
"mcpServers": {
"register-mcp": {
"command": "uvx",
"args": [
"register-mcp"
]
}
}
}
<!-- END GENERATED: install -->
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.