[build-system] requires = ["hatchling"] build-backend = "hatchling.build" [project] name = "swiss-ip-mcp" version = "1.1.6" description = "MCP server for Swiss intellectual property data (trademarks, patents, SPC) via the IGE/IPI Swissreg API" readme = "README.md" license = { file = "LICENSE" } requires-python = ">=3.11" keywords = ["mcp", "model-context-protocol", "swiss", "ip", "trademark", "patent", "ige", "ipi", "swissreg", "llm"] classifiers = [ "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] dependencies = [ # Upper bound kept deliberately: a future `mcp` 3.x may move the API again, # the way 2.0.0 moved it from `mcp.server.fastmcp` to `mcp.server.mcpserver`. # That migration is a decision to take on purpose, not one a resolver should # make silently on a fresh install. # # `fastmcp` stood above this line until the 2026-07-28 work and was removed # there: nothing under `src/` or `tests/` has ever imported it, and the # comment here claimed the opposite — «this server imports # `mcp.server.fastmcp` directly». That was true before the 2.x migration and # silently became false with it. Measured before removing: `mcp` does not # depend on `fastmcp` (nor `fastmcp` on `mcp` — it pulls `fastmcp-slim`), so # neither was holding the other up, and the suite is green without it. # # Ohne `[cli]`: Das Extra liefert einzig den `mcp`-Konsolenbefehl # (`mcp -> mcp.cli:app [cli]`), und `typer`/`python-dotenv` kommen im ganzen # SDK nur in `mcp/cli/cli.py` vor. Dieser Server ruft ihn nie auf, kein Pfad # unter `src/`, `tests/` oder `scripts/` importiert eines der beiden, und # weder README noch Dockerfile noch `server.json` nennen `mcp dev/install/run`. # Gemessen mit `pip install --dry-run --ignore-installed`: mit Extra 36 # Pakete, ohne 28 — acht ueberzaehlige (typer, python-dotenv, rich, pygments, # markdown-it-py, mdurl, shellingham, annotated-doc, zusammen rund 15 MB). # Die traegt sonst jede Produktivinstallation mit, denn das Dockerfile macht # `pip install .` und README wie `server.json` starten per `uvx`. # Gegenprobe ohne die beiden: Import, alle sechs Gates, 161 Tests, der # Streamable-HTTP-Transport und der stdio-Start liefen unveraendert. # Positivkontrolle, damit das keine Vermutung ueber einen wirkungslosen # Schluessel ist: `mcp version` bricht dann mit «typer is required». # Wer den Befehl will, bekommt ihn ueber das `dev`-Extra unten. "mcp>=2.0.0,<3", "httpx>=0.27.0", "pydantic>=2.0.0", # Imported directly by the HTTP/SSE transport (MCP_TRANSPORT=sse|streamable-http). "starlette>=0.40.0,<2", "uvicorn>=0.30.0", # Tracing API only — no-op without a provider; SDK/exporter live in the [otel] extra. "opentelemetry-api>=1.20.0", # Structured JSON logging on stderr (OBS-003). "structlog>=24.1.0,<27", ] [project.optional-dependencies] # Enable OpenTelemetry export (OBS-006). Activate at runtime with MCP_OTEL_ENABLED=1. otel = [ "opentelemetry-sdk>=1.20.0", "opentelemetry-exporter-otlp-proto-http>=1.20.0", "opentelemetry-instrumentation-httpx>=0.40b0", ] dev = [ # Exakt gepinnt, nicht `>=`: ruff ist ein Gate, kein Hilfsmittel. Eine # neuere Version meldet Abweichungen an Code, den niemand angefasst hat. # Der Pin steht hier und nur hier — die CI installiert ihn ueber das # `dev`-Extra mit und hat keinen eigenen Pin-Schritt mehr. Beim Anheben: # Version aendern, `ruff format` einmal ueber die gelinteten Pfade laufen # lassen und das Ergebnis mit committen. "ruff==0.16.7", # Der `mcp`-Konsolenbefehl (`mcp dev` fuer den Inspector). Er steht hier und # nicht in `dependencies`: ein Entwicklungswerkzeug, das der ausgelieferte # Server nie aufruft — siehe die Messung im Kommentar dort. "mcp[cli]>=2.0.0,<3", "pytest>=8.0.0", "pytest-asyncio>=0.23.0", "respx>=0.21.0", "opentelemetry-sdk>=1.20.0", ] [project.scripts] swiss-ip-mcp = "swiss_ip_mcp.server:main" [project.urls] Homepage = "https://github.com/malkreide/swiss-ip-mcp" Repository = "https://github.com/malkreide/swiss-ip-mcp" "Bug Tracker" = "https://github.com/malkreide/swiss-ip-mcp/issues" [tool.hatch.build.targets.wheel] packages = ["src/swiss_ip_mcp"] [tool.ruff] line-length = 120 [tool.ruff.lint] select = ["E", "F", "I", "B"] [tool.pytest.ini_options] markers = [ "live: marks tests as live integration tests (deselect with '-m \"not live\"')", ]