mypy
$ mypy Foundation Low RiskThe foundational static type checker for Python supporting PEP 484 annotations, plugin ecosystems (Pydantic, SQLAlchemy, Django), and --strict enforcement. Modern releases include --output json and --no-color-output for clean machine parsing.
brew install mypy Runs local Python type inference in the project's virtualenv; no MCP server needed.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --output json (newline-delimited JSON in mypy >= 1.11), --no-color-output, --no-error-summary, and deterministic exit codes.
--output jsonemits NDJSON diagnostics--no-color-outputkeeps stdout clean
Read-only static analysis that never executes checked Python code (only writes local .mypy_cache).
- Zero target code execution; read-only source inspection
Easy via PyPI/Homebrew/uvx, though accurate stub resolution depends on matching the project's Python environment.
- Requires matching project virtualenv dependencies for third-party stubs
Deep PEP compliance and plugin ecosystem (Pydantic, Django, SQLAlchemy), though cold runs are slower than pyright or ty.
- Broad Python typing plugin ecosystem and
--strictchecks
Maintained under the python GitHub organization (python/mypy) with MIT license.
- Hosted at
python/mypy
Comprehensive ReadTheDocs CLI and error-code reference.
- Official docs at mypy.readthedocs.io
Security, Auth & Guardrails
Offline local static type checker; creates .mypy_cache locally with no credentials.
MIT open-source Python package; completely free.
# mypy Agent Rules - Run `mypy` inside the project's virtualenv (or pass `--python-executable`) so third-party type stubs resolve accurately. - Use `--output json --no-color-output` (mypy >= 1.11) when parsing errors programmatically.
Agent-Ready Command Recipes
Safe Read-Only Queries
mypy --output json --no-color-output src/
Emits newline-delimited JSON error records with file, line, column, severity, and error code.
mypy --strict --show-error-codes src/service.py
Enforces full strict annotations and displays [error-code] identifiers.
Strengths for Agents
- + Industry standard for Python typing with mature Pydantic/Django/SQLAlchemy plugin support.
- + Supports
--output jsonNDJSON records and--no-color-outputon modern versions.
Caveats & Pitfalls
- ! Cold cache scans on large codebases can take several seconds.
- ! Running via isolated
uvx mypywithout--python-executablemisses project-installed library stubs.