Python language server (ty) for Claude Code, providing static type checking and code intelligence.
.py, .pyi
- uv must be installed
The LSP is automatically installed via uvx ty@latest server on first use - no manual installation required.
For monorepos with multiple Python projects, start Claude Code from within the specific project directory:
# Instead of:
cd ~/Code/monorepo && claude
# Do this:
cd ~/Code/monorepo/my-python-project && claudeThis ensures ty uses the correct project's .venv and pyproject.toml.
After installing, restart Claude Code. Create a file with type errors:
# test.py
x: int = "not an int"
def add(a: int, b: int) -> int:
return a + b
result: str = add(1, 2)Verify the LSP is running:
ps aux | grep "ty server"Edit or read the file - diagnostics should appear in system reminders:
test.py:
✘ [Line 2:10] Object of type `Literal["not an int"]` is not assignable to `int` [invalid-assignment] (ty)
✘ [Line 7:15] Object of type `int` is not assignable to `str` [invalid-assignment] (ty)