{
  "markdown": "🇨🇭 **Part of the [Swiss Public Data MCP Portfolio](https://github.com/malkreide/swiss-public-data-mcp)**\n\n# 💡 swiss-ip-mcp\n\n**MCP Server for Swiss Intellectual Property Data (IGE/IPI)**\n\n![Version](https://img.shields.io/badge/version-1.1.6-blue)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)\n[![MCP](https://img.shields.io/badge/MCP-Model%20Context%20Protocol-purple)](https://modelcontextprotocol.io/)\n[![Data Source](https://img.shields.io/badge/Data-swissreg.ch-red)](https://www.swissreg.ch/public/apidocs/)\n[![CI](https://github.com/malkreide/swiss-ip-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/malkreide/swiss-ip-mcp/actions)\n\n🇩🇪 [Deutsche Version → README.de.md](README.de.md)\n\n---\n\n## Overview\n\n`swiss-ip-mcp` is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that gives AI models structured, language-driven access to the Swiss intellectual property register [Swissreg](https://www.swissreg.ch), operated by the **Swiss Federal Institute of Intellectual Property (IGE/IPI)**.\n\nIt is the successor to [`patent-mcp`](https://github.com/malkreide/patent-mcp) and covers all available domains of the [Swissreg Datadelivery API](https://www.swissreg.ch/public/apidocs/): trademarks, patents, patent publications, and supplementary protection certificates (SPC/ESZ).\n\n**This server is model-agnostic.** It works with Claude, GPT-4, Llama, and any other MCP-compatible client – not just Claude Desktop.\n\n![Demo: Claude querying the Swiss trademark register via swiss-ip-mcp](docs/assets/demo.svg)\n\n---\n\n## Example Queries\n\nThe real power is natural language. Instead of manually searching the register, just ask a question:\n\n> \"Which trademarks does the City of Zurich hold at the IGE?\"\n\n> \"Is the name 'Learning City Zurich' registered as a trademark in Switzerland?\"\n\n> \"Which pharmaceutical companies have filed Swiss patents in the last six months?\"\n\n> \"Show me all trademark applications in the education sector (Nice class 41) since January 2025.\"\n\n> \"What supplementary protection certificates does Novartis hold in Switzerland?\"\n\n---\n\n## Covered Domains\n\n| Domain | Description |\n|--------|-------------|\n| **Trademarks** | Swiss trademark register – filing, protection, owners, Nice classes |\n| **Patents** | CH patents – filing, grant, IPC classes, applicants, inventors |\n| **Patent publications** | Official patent publications in the Swiss Official Gazette |\n| **SPC / ESZ** | Supplementary protection certificates for medicinal and plant-protection products |\n\n> **Note:** Design search is not yet available in the Swissreg Datadelivery API.\n\n---\n\n## Tools (11)\n\n| Tool | Function |\n|------|---------|\n| `swiss_ip_search_trademarks` | Free-text trademark search (wildcard `*` supported) |\n| `swiss_ip_get_trademark` | Retrieve a trademark by registration number |\n| `swiss_ip_search_trademarks_by_owner` | Find all trademarks held by a given owner |\n| `swiss_ip_search_trademarks_by_class` | Filter trademarks by Nice classification class |\n| `swiss_ip_search_patents` | Free-text patent search |\n| `swiss_ip_get_patent` | Retrieve a patent by number |\n| `swiss_ip_search_patents_by_applicant` | Find patents by applicant or inventor name |\n| `swiss_ip_search_patent_publications` | Search patent publications |\n| `swiss_ip_search_spc` | SPC/ESZ search (pharma and plant protection) |\n| `swiss_ip_search_recent_filings` | Filter filings by date range across all domains |\n| `swiss_ip_get_quota` | Check remaining API data transfer quota |\n\n### Resources & Prompts\n\nBeyond tools, the server exposes two more MCP primitives:\n\n**Resources** (read-only metadata, `swissip://` URI scheme):\n\n| URI | Content |\n|-----|---------|\n| `swissip://about` | Server + data-source metadata (provenance, covered domains) |\n| `swissip://domains` | List of covered IP domains |\n\n**Prompts** (curated workflow templates):\n\n| Prompt | Arguments | Purpose |\n|--------|-----------|---------|\n| `trademark_availability` | `name` | Check whether a name is a registered Swiss trademark |\n| `competitor_ip_report` | `company` | IP overview (trademarks + patents) for a company |\n| `recent_ip_filings_report` | `ip_type, date_from, date_to` | Report on recent filings in a period |\n\n### Error semantics\n\nTool **execution errors** (API failures, timeouts, missing credentials) are\nreturned with MCP `isError: true` and a masked, user-friendly message — internal\ndetails (stack traces, raw API bodies) go only to the server log. A specific\nnumber lookup that finds nothing is **not** an error: it returns a normal result\nwith `match_type: \"none\"` and a `message`.\n\n---\n\n## Project Phase\n\nThis server is in **Phase 1 (read-only)** of the MCP phased-rollout model: every\ntool is read-only and writes nothing. See [`ROADMAP.md`](ROADMAP.md) for the\nphase plan and the prerequisites for any future write-capable phase.\n\n---\n\n## Architecture\n\n```\nAI client (Claude Desktop, Cursor, VS Code + Continue, …)\n         │\n         │  MCP (stdio or SSE)\n         ▼\n   swiss-ip-mcp\n         │\n         │  HTTPS + OAuth2 (IGE IDP)\n         ▼\n  Swissreg Datadelivery API\n  https://www.swissreg.ch/public/api/v1\n         │\n         ├── TrademarkSearch\n         ├── PatentSearch\n         ├── PatentPublicationSearch\n         ├── SPCSearch\n         └── UserQuota\n```\n\n### Transport Modes\n\n| Transport | Use case | Configuration |\n|-----------|----------|---------------|\n| **stdio** | Claude Desktop, local development | Default (no extra setup) |\n| **Streamable HTTP** | Cloud deployment (Render.com etc.) | `MCP_TRANSPORT=streamable-http` |\n| **SSE** | Legacy HTTP clients | `MCP_TRANSPORT=sse` |\n\nTransport is selected at startup from the `MCP_TRANSPORT` environment variable\n(default `stdio`). The HTTP transports are served by uvicorn and honour:\n\n| Variable | Default | Purpose |\n|----------|---------|---------|\n| `MCP_HOST` | `127.0.0.1` | Bind address. Use `0.0.0.0` **only** inside a container / behind a reverse proxy. |\n| `PORT` / `MCP_PORT` | `8000` | Bind port (`PORT` wins — PaaS convention). |\n| `MCP_ALLOWED_ORIGINS` | _(empty)_ | Comma-separated CORS origin allow-list. No wildcard in production. |\n| `MCP_ALLOWED_HOSTS` | _(empty)_ | Comma-separated `Host`-header allow-list; enables DNS-rebinding protection when set. |\n\nThe `Mcp-Session-Id` header is exposed via CORS so browser-based clients can\nread and echo it on follow-up requests.\n\n---\n\n## Prerequisites\n\n1. **IGE credentials** (free): Sign the [terms of use](https://www.ige.ch/en/services/digital-resources/ip-data/data-delivery-api) and send the form by post to the IGE. Credentials are issued upon receipt.\n2. **Python 3.11 or later**\n3. **`uv`** (recommended) or `pip`\n\n---\n\n## Installation\n\n```bash\n# Run directly with uv (recommended, no local installation needed)\nuvx swiss-ip-mcp\n\n# Local development installation\ngit clone https://github.com/malkreide/swiss-ip-mcp\ncd swiss-ip-mcp\npip install -e \".[dev]\"\n```\n\n---\n\n## Configuration\n\n### Environment Variables\n\n```bash\nexport IGE_USERNAME=\"your_username\"\nexport IGE_PASSWORD=\"your_password\"\n```\n\n### Claude Desktop\n\nOpen the config file:\n- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`\n- **Windows:** `%APPDATA%\\Claude\\claude_desktop_config.json`\n\n```json\n{\n  \"mcpServers\": {\n    \"swiss-ip\": {\n      \"command\": \"uvx\",\n      \"args\": [\"swiss-ip-mcp\"],\n      \"env\": {\n        \"IGE_USERNAME\": \"your_username\",\n        \"IGE_PASSWORD\": \"your_password\"\n      }\n    }\n  }\n}\n```\n\n### Other MCP Clients\n\n`swiss-ip-mcp` is compatible with any MCP-capable client:\n\n| Client | Configuration |\n|--------|--------------|\n| Cursor | Add to `~/.cursor/mcp.json` (same format as Claude Desktop) |\n| VS Code + Continue | Add via `continue.json` MCP server block |\n| Windsurf | Add via MCP server settings |\n| Self-hosted (mcp-proxy) | Use SSE transport with `MCP_TRANSPORT=sse` |\n\n### Cloud / Render.com (Streamable HTTP)\n\n```bash\nMCP_TRANSPORT=streamable-http \\\n  MCP_HOST=0.0.0.0 PORT=8000 \\\n  MCP_ALLOWED_ORIGINS=\"https://your-client.example\" \\\n  MCP_ALLOWED_HOSTS=\"your-app.onrender.com\" \\\n  IGE_USERNAME=... IGE_PASSWORD=... \\\n  swiss-ip-mcp\n```\n\n> **Security note:** bind to `0.0.0.0` only inside a container or behind a\n> reverse proxy. Always set `MCP_ALLOWED_ORIGINS` and `MCP_ALLOWED_HOSTS` for\n> public deployments — this enables CORS scoping and DNS-rebinding protection.\n> The endpoint is unauthenticated and serves only public IP-register data; do\n> not place credentialed or non-public tools behind this transport without\n> adding authentication first.\n\n### Docker / Kubernetes\n\nA hardened multi-stage [`Dockerfile`](Dockerfile) (non-root UID 10001,\n`HEALTHCHECK` on `/health`), a [`docker-compose.yml`](docker-compose.yml) with\nresource limits, and Kubernetes manifests + an HAProxy sticky-session config\nunder [`deploy/`](deploy/) are included.\n\n```bash\ndocker compose up --build   # reads IGE_* from .env\n```\n\nSee [`docs/deployment.md`](docs/deployment.md) for hardening, resource limits and\nscaling (stateless vs. sticky-session) details.\n\n---\n\n## Tests\n\n```bash\n# Unit tests (no credentials needed)\nPYTHONPATH=src pytest tests/ -v\n\n# Including live integration tests against the real API\nIGE_USERNAME=... IGE_PASSWORD=... PYTHONPATH=src pytest tests/ -v\n```\n\nThe CI workflow runs on Python 3.11, 3.12, and 3.13.\n\n---\n\n## Observability (optional)\n\nThe server can emit OpenTelemetry traces — one span per tool call plus child\nspans for the backend Swissreg/IDP HTTP calls. Tracing is **off by default** and\nadds no overhead until enabled.\n\n```bash\npip install 'swiss-ip-mcp[otel]'\n\nMCP_OTEL_ENABLED=1 \\\n  OTEL_EXPORTER_OTLP_ENDPOINT=http://your-collector:4318 \\\n  MCP_ENV=production \\\n  swiss-ip-mcp\n```\n\n| Variable | Purpose |\n|----------|---------|\n| `MCP_OTEL_ENABLED` | Set to `1` to enable trace export (or just set the endpoint below). |\n| `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP/HTTP collector endpoint (standard OTEL variable). |\n| `MCP_ENV` | Value for the `deployment.environment` resource attribute (default `production`). |\n\nTool spans carry only `mcp.tool.name` and `mcp.tool.result.is_error` — **no\nquery arguments, credentials or response bodies** are recorded.\n\n### Logging\n\nThe server logs structured JSON to **stderr** (stdout is reserved for the\nstdio protocol). Every tool call binds a `tool` name and a `correlation_id`, so\nall log lines for one call are correlated. Set the level with `LOG_LEVEL`\n(`DEBUG` / `INFO` / `WARNING` / `ERROR`, default `INFO`):\n\n```json\n{\"event\": \"tool.call.start\", \"tool\": \"swiss_ip_search_trademarks\", \"correlation_id\": \"da55…\", \"level\": \"info\", \"timestamp\": \"…Z\"}\n```\n\n---\n\n## MCP Protocol Version\n\nThis server speaks **two protocol eras** over the same endpoint. The client's\nfirst request on a connection decides which one applies; a later claim from the\nother era is refused.\n\n| Era | Revision | Who reaches it |\n|---|---|---|\n| `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. |\n| Per-request envelope | **`2026-07-28`** | A request carrying the `2026-07-28` `_meta` envelope opens a modern connection. |\n\nBoth revisions are pinned in\n[`tests/test_protocol_version.py`](tests/test_protocol_version.py) and asserted\nagainst the installed SDK, so a Dependabot bump of `mcp` cannot move either one\nsilently. This server builds no ASGI app to send an `initialize` through, so\nthe gate asserts the SDK constants rather than a measured response — the\nweaker form, named rather than left unsaid.\n\nNote that the SDK's `LATEST_PROTOCOL_VERSION` is an alias for the **modern**\nera, not for the handshake era — pinning against it alone would leave the era\nthat current clients actually negotiate free to drift.\n\n**Update policy.** When the gate fails, do not edit the constant blindly: read\nthe spec changelog between the two revisions, verify the server still behaves,\nthen move the constant, this section, `README.de.md` and\n[`CHANGELOG.md`](CHANGELOG.md) together.\n\n---\n\n## Data Source\n\nAll data is provided by the [IGE/IPI Swissreg Datadelivery API](https://www.swissreg.ch/public/apidocs/). The API is free after signing the usage terms, subject to a monthly data transfer quota. Check your remaining quota at any time using the `swiss_ip_get_quota` tool.\n\n| Field | Value |\n|-------|-------|\n| Provider | Swiss Federal Institute of Intellectual Property (IGE/IPI) |\n| Source | Swissreg Datadelivery API — <https://www.swissreg.ch/public/apidocs/> |\n| License / terms | [IGE/IPI Swissreg Datadelivery API Terms of Use](https://www.ige.ch/en/services/digital-resources/ip-data/data-delivery-api) |\n\n**Provenance:** every tool response carries a `source` block (provider, source\nURL, license) so downstream consumers retain attribution. The result envelope is\n`{ source, total, count, match_type, results, next_page_token }`.\n\n---\n\n## Safety & Limits\n\n- **Read-only:** All tools perform authenticated POST requests to the Swissreg API — no data is written, modified, or deleted on any system.\n- **No personal data:** The API returns public IP register entries (trademark names, patent titles, applicant organisations). No personally identifiable information (PII) is processed or stored by this server beyond what the IGE API returns in its public records.\n- **Rate limits & quota:** The IGE Swissreg API enforces a monthly data transfer quota per account. Use the `swiss_ip_get_quota` tool to monitor remaining quota. The server enforces a 60s timeout per request. Avoid large `page_size` values (>20) for exploratory queries.\n- **Authentication:** Credentials (`IGE_USERNAME`, `IGE_PASSWORD`) are read from environment variables at runtime and never logged or persisted.\n- **Terms of service:** Data is subject to the [IGE Swissreg Datadelivery API terms of use](https://www.ige.ch/en/services/digital-resources/ip-data/data-delivery-api). A signed usage agreement with IGE/IPI is required before API access is granted.\n- **Address list verified without credentials (2026-08-08).** Every address, the Keycloak realm and the `client_id` this server builds are the ones the source publishes. A null result — and recorded as one, because a null result nobody wrote down is not one on the next pass. Three independent proofs, because one would not have carried:\n  - The IDP discriminates: `realms/egov` with wrong credentials → `invalid_grant` (\"Invalid user credentials\"); an invented realm → 404 \"Realm does not exist\"; an invented `client_id` → `invalid_client`. So realm and client exist and only the credentials are missing.\n  - The realm declares its own token endpoint under `.well-known/openid-configuration` — identical to the URL built here.\n  - The official API documentation states both addresses verbatim, including the `client_id` as a \"constant string\".\n- **Why the third proof is needed:** the Swissreg API itself does **not** discriminate. A POST without a token returns 403, with an invented token 401 — and a freely invented path under `/public/api/` returns exactly the same. A status code proves nothing there. `scripts/record_fixtures.py` re-measures this on every run and aborts if a control stops discriminating.\n- **Response payloads are not recorded.** They need credentials; `PROVENANCE.md` lists them as NOT RECORDED with the measured status rather than giving them a date they never had. What stays unproven is the *shape* of the responses — whether the XML fields are named as the parser reads them.\n- **No guarantees:** This server is a community project, not affiliated with the Swiss Federal Institute of Intellectual Property (IGE/IPI). Availability depends on upstream API uptime.\n\n---\n\n## Related Servers\n\n| Server | Content |\n|--------|---------|\n| [`zurich-opendata-mcp`](https://github.com/malkreide/zurich-opendata-mcp) | City of Zurich open data (CKAN, weather, parking, geodata) |\n| [`fedlex-mcp`](https://github.com/malkreide/fedlex-mcp) | Swiss federal law via Fedlex SPARQL |\n| [`swiss-transport-mcp`](https://github.com/malkreide/swiss-transport-mcp) | Public transport, disruptions, tickets, train formations |\n| [`swiss-road-mobility-mcp`](https://github.com/malkreide/swiss-road-mobility-mcp) | Shared mobility, EV charging stations, traffic data |\n| [`global-education-mcp`](https://github.com/malkreide/global-education-mcp) | UNESCO / OECD education data |\n| [`patent-mcp`](https://github.com/malkreide/patent-mcp) | ⚠️ Deprecated – superseded by this server |\n\n---\n\n## Contributing\n\nSee [`CONTRIBUTING.md`](CONTRIBUTING.md) ([Deutsch](CONTRIBUTING.de.md)) for how to\nreport bugs and submit changes.\n\n---\n\n## Security\n\nSee [`SECURITY.md`](SECURITY.md) for the security posture, hardening summary, and how to report a vulnerability.\n\n---\n\n## License\n\nMIT License — see [LICENSE](LICENSE)\n\n---\n\n## Author\n\n**Hayal Oezkan** · [github.com/malkreide](https://github.com/malkreide)\n\n<!-- mcp-name: io.github.malkreide/swiss-ip-mcp -->\n\n<!-- BEGIN GENERATED: install -->\n## Installation\n\nRun via [`uv`](https://docs.astral.sh/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`):\n\n```json\n{\n  \"mcpServers\": {\n    \"swiss-ip-mcp\": {\n      \"command\": \"uvx\",\n      \"args\": [\n        \"swiss-ip-mcp\"\n      ],\n      \"env\": {\n        \"IGE_USERNAME\": \"<your IGE_USERNAME>\",\n        \"IGE_PASSWORD\": \"<your IGE_PASSWORD>\"\n      }\n    }\n  }\n}\n```\n\nRequires credentials: set `IGE_USERNAME`, `IGE_PASSWORD` (replace the placeholder values above).\n<!-- END GENERATED: install -->\n",
  "bytes": 17784,
  "sha": "92ae443d5e70b4fb6a70bd79fac3eae2ca6650b0ea38726c44e512a5057cc1f3",
  "repo_slug": "malkreide/swiss-ip-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_malkreide_swiss_ip_mcp_190b064f/readme"
}