Conversation
- pyproject.toml: add mypy to dev deps, [tool.mypy] with strict = true, override to relax tests - ci.yml: add 'Type check' step running mypy src/ on all 3 Python versions - server.py: tighten dict annotations to dict[str, object] to pass strict mode Locally: mypy src/ → 'Success: no issues found in 5 source files'. pytest + ruff still green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds static type checking to the Python starter — closes the 2026-04-23 audit finding that type hints were present but never verified.
pyproject.toml:mypyin[project.optional-dependencies].dev,[tool.mypy]withstrict = true,warn_unused_ignores,warn_redundant_casts,warn_unreachable,show_error_codes. Tests exempted fromdisallow_untyped_defs..github/workflows/ci.yml: newType checkstep runsmypy src/across Python 3.11 / 3.12 / 3.13.src/my_mcp_server/server.py: tightendict→dict[str, object]onok()/err()helpers (strict mode requires generic parameters).Test plan
mypy src/→Success: no issues found in 5 source filespytest→ 2 passed;ruff check .→ all passed