Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

mypy

$ mypy Foundation Low Risk
mypy · Code & DevOps · MIT · macos / linux / windows

The 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.

FCRS-1.0 Score
88 /100
Good
Medium Confidence
Zero-Friction Install
brew install mypy
CLI vs MCP Decision CLI Only

Runs local Python type inference in the project's virtualenv; no MCP server needed.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 21 / 25

Supports --output json (newline-delimited JSON in mypy >= 1.11), --no-color-output, --no-error-summary, and deterministic exit codes.

  • --output json emits NDJSON diagnostics
  • --no-color-output keeps stdout clean
Trust & Safety 24 / 25

Read-only static analysis that never executes checked Python code (only writes local .mypy_cache).

  • Zero target code execution; read-only source inspection
Setup & Portability 13 / 15

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
Utility & Efficiency 13 / 15

Deep PEP compliance and plugin ecosystem (Pydantic, Django, SQLAlchemy), though cold runs are slower than pyright or ty.

  • Broad Python typing plugin ecosystem and --strict checks
Maintenance & Lineage 9 / 10

Maintained under the python GitHub organization (python/mypy) with MIT license.

  • Hosted at python/mypy
Docs & Verifiability 8 / 10

Comprehensive ReadTheDocs CLI and error-code reference.

  • Official docs at mypy.readthedocs.io

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

Offline local static type checker; creates .mypy_cache locally with no credentials.

Side Effects
Read-Only
Cost & Quotas

MIT open-source Python package; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Run mypy with JSON line diagnostics
mypy --output json --no-color-output src/

Emits newline-delimited JSON error records with file, line, column, severity, and error code.

Run strict type check on target file
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 json NDJSON records and --no-color-output on modern versions.

Caveats & Pitfalls

  • ! Cold cache scans on large codebases can take several seconds.
  • ! Running via isolated uvx mypy without --python-executable misses project-installed library stubs.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI