diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8b933cdffb..378683c122 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -157,7 +157,11 @@ repos: - spacy - tokenizers>=0.21,<0.23 - posthog==7.12.0 - - mcp>=1.0.0 + # Ceiling matches requirements/base.txt's runtime pin. mcp>=1.0.0 + # (no ceiling) let this hook resolve mcp 2.x, whose SDK renamed + # fields/methods that opencontractserver/mcp/server.py (1.x API) + # doesn't have -- turning main red with no commit touching mcp. + - mcp>=1.28.1,<2 - argon2-cffi==25.1.0 - cryptography==46.0.7 - pyjwt==2.12.1 diff --git a/changelog.d/pin-mcp-precommit-mypy-hook.fixed.md b/changelog.d/pin-mcp-precommit-mypy-hook.fixed.md new file mode 100644 index 0000000000..84a5f80b76 --- /dev/null +++ b/changelog.d/pin-mcp-precommit-mypy-hook.fixed.md @@ -0,0 +1 @@ +- Pinned the `mcp` `additional_dependencies` entry in the mypy pre-commit hook (`.pre-commit-config.yaml`) to `>=1.28.1,<2`, matching the runtime pin in `requirements/base.txt`. The previous unbounded `mcp>=1.0.0` let the hook resolve `mcp` 2.x, whose SDK renamed/removed fields and methods (`Server.list_resources`, `uriTemplate`→`uri_template`, `inputSchema`→`input_schema`) that `opencontractserver/mcp/server.py` (written against the 1.x API) still uses — producing 48 unrelated mypy errors on every PR's `linter`/`backend-ci-gate` checks regardless of what the PR actually changed.