MCP server for querying the Swiss Zefix company register (Handelsregister)
Project description
mcp-server-zefix
Look up any Swiss company directly from Claude.
An MCP server that connects Claude to Zefix, Switzerland's official company register (Handelsregister). Zefix is operated by the Federal Office of Justice and provides authoritative data from all 26 cantonal commercial registers -- company details, legal forms, audit firms, corporate history, and official gazette publications.
What you can ask
- "Search for Novartis on Zefix"
- "Find all foundations in Basel"
- "Who audits Novartis AG?"
- "What companies has Novartis taken over?"
- "Show me the corporate history of Huber Baustoffe AG"
- "What capital changes has cohaga AG had recently?"
- "Find all GmbHs in Zurich"
- "List all Swiss legal forms in English"
Quick Start
Claude Code
claude mcp add zefix -- uvx mcp-server-zefix
Claude Desktop
Add to your claude_desktop_config.json (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):
{
"mcpServers": {
"zefix": {
"command": "uvx",
"args": ["mcp-server-zefix"]
}
}
}
No API key or credentials needed. Works out of the box.
Tools
| Tool | Description |
|---|---|
search_companies |
Search by name (wildcards supported), filter by canton and legal form |
get_company_by_uid |
Full company profile: address, purpose, audit firm, takeover history, branch offices, previous names |
get_company_by_chid |
Same as above, using the CH-ID identifier |
get_company_publications |
SHAB timeline: board changes, capital changes, mergers, address changes, and more |
list_legal_forms |
All Swiss legal forms (AG, GmbH, Stiftung, etc.) with IDs for filtering |
What you get
A company lookup returns:
- Identifiers -- name, UID, CH-ID, status, legal form
- Location -- registered office, full address
- Purpose -- the company's stated business purpose
- Audit firm -- name and UID of the auditor
- Corporate history -- companies absorbed, acquisitions, previous names
- Branch offices -- all registered branch locations
- SHAB publications -- timeline of legally significant events from the Swiss Official Gazette (board changes, capital changes, mergers, purpose changes)
- Cantonal register link -- direct link to the full excerpt with board members and signatories
Configuration
Works with zero configuration using the public Zefix API. For the official authenticated API, set these environment variables:
| Variable | Default | Description |
|---|---|---|
ZEFIX_BASE_URL |
https://www.zefix.ch/ZefixREST/api/v1 |
API base URL |
ZEFIX_USERNAME |
(none) | Username for ZefixPublicREST API |
ZEFIX_PASSWORD |
(none) | Password for ZefixPublicREST API |
To use the official API, request credentials from zefix@bj.admin.ch, then:
{
"mcpServers": {
"zefix": {
"command": "uvx",
"args": ["mcp-server-zefix"],
"env": {
"ZEFIX_BASE_URL": "https://www.zefix.admin.ch/ZefixPublicREST/api/v1",
"ZEFIX_USERNAME": "your-username",
"ZEFIX_PASSWORD": "your-password"
}
}
}
}
Development
git clone https://github.com/johnphilipp/mcp-server-zefix.git
cd mcp-server-zefix
uv sync --all-extras
uv run ruff check . # lint
uv run pytest tests/ -v # test (50 tests, all use fakes, no network)
npx @modelcontextprotocol/inspector uv --directory . run mcp-server-zefix # interactive
Architecture
Follows Architecture Patterns with Python (Percival & Gregory):
- Domain models (
models.py) -- frozen dataclasses (Company,LegalForm,ShabPublication), domain exceptions, no infrastructure imports - Port + adapter (
zefix_client.py) --AbstractZefixClientprotocol;HttpZefixClienttranslates HTTP to domain objects and httpx exceptions to domain exceptions - Service layer (
server.py) --handle_*functions accept the abstract client, never import httpx - Fakes over mocks -- tests use
FakeZefixClient, a working in-memory implementation; test files never import httpx
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_server_zefix-0.3.0.tar.gz.
File metadata
- Download URL: mcp_server_zefix-0.3.0.tar.gz
- Upload date:
- Size: 20.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66cef5c8ffd27eeb826dbb8af4faf7abbc0737f13d41051b55b3458c896f605f
|
|
| MD5 |
42ee54f140992147626c6f4f48f176bf
|
|
| BLAKE2b-256 |
8917d0bd5fa08da99d4eb5bf84a6f22d8bb81bca12bd1a2dd1a40f2ad5200fc5
|
Provenance
The following attestation bundles were made for mcp_server_zefix-0.3.0.tar.gz:
Publisher:
publish.yml on johnphilipp/mcp-server-zefix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_server_zefix-0.3.0.tar.gz -
Subject digest:
66cef5c8ffd27eeb826dbb8af4faf7abbc0737f13d41051b55b3458c896f605f - Sigstore transparency entry: 1263171485
- Sigstore integration time:
-
Permalink:
johnphilipp/mcp-server-zefix@d23af97083f0d1aec53c58ff0eabb3cb4ac4c8fb -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/johnphilipp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d23af97083f0d1aec53c58ff0eabb3cb4ac4c8fb -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcp_server_zefix-0.3.0-py3-none-any.whl.
File metadata
- Download URL: mcp_server_zefix-0.3.0-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6c800550ba38961c2cd36e527859a7168d49fc150a19b9696e6d03e4e2407d8
|
|
| MD5 |
794e0a3a54202103c67f8d6e55abbb7b
|
|
| BLAKE2b-256 |
d1efbe680b74b42baa15b5032f33e34af99077cbfe14c768ea6cc65472426790
|
Provenance
The following attestation bundles were made for mcp_server_zefix-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on johnphilipp/mcp-server-zefix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_server_zefix-0.3.0-py3-none-any.whl -
Subject digest:
c6c800550ba38961c2cd36e527859a7168d49fc150a19b9696e6d03e4e2407d8 - Sigstore transparency entry: 1263171490
- Sigstore integration time:
-
Permalink:
johnphilipp/mcp-server-zefix@d23af97083f0d1aec53c58ff0eabb3cb4ac4c8fb -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/johnphilipp
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d23af97083f0d1aec53c58ff0eabb3cb4ac4c8fb -
Trigger Event:
release
-
Statement type: