fastapi-lsp
Language server for FastAPI and Starlette — routes, Depends() graph, url_for, Jinja templates, env/settings. One Rust binary, any LSP-capable editor. Static analysis only.
Features
| Diagnostics | param mismatches, shadowed routes, unincluded routers, Depends(fn()), dep cycles, broken url_for, missing templates, undefined env keys |
| Navigation | test call → handler, Depends() chains both ways, template files, .env lines |
| Hover | route card: resolved path, router chain, response model, deps, middleware |
| Completions | route paths, url_for names, template paths, env keys |
| Symbols | GET /api/books/{book_id} in the symbol picker |
| Code lenses | test count, dep usage, override count per handler |
check CLI |
same diagnostics as a linter — fastapi-lsp check . |
Installation
uv tool install fastapi-lsp
Or with pip:
pip install fastapi-lsp
Or download a pre-built binary from the releases page.
Editor setup
Neovim
vim.lsp.config('fastapi_lsp', {
cmd = { 'fastapi-lsp', '--stdio' },
filetypes = { 'python', 'html', 'htmldjango' },
root_markers = { 'pyproject.toml', '.git' },
})
vim.lsp.enable('fastapi_lsp')
Helix
# ~/.config/helix/languages.toml
[language-server.fastapi-lsp]
command = "fastapi-lsp"
args = ["--stdio"]
[[language]]
name = "python"
language-servers = ["pyright", "fastapi-lsp"]
[[language]]
name = "html"
language-servers = ["vscode-html-language-server", "fastapi-lsp"]
[[language]]
name = "jinja"
language-servers = ["fastapi-lsp"]
Zed
Install from the Zed extensions panel (Cmd+Shift+X) — search for fastapi-lsp and click Install. It activates automatically for Python, HTML, and Jinja2 files.
To control server order alongside other language servers or pass initialization options, add to ~/.config/zed/settings.json:
{
"languages": { "Python": { "language_servers": ["fastapi-lsp", "..."] } },
"lsp": { "fastapi-lsp": { "initialization_options": { "templates": ["app/templates"] } } }
}
Configuration
Zero config for standard projects. Priority: InitializationOptions › fastapi-lsp.toml › [tool.fastapi-lsp] in pyproject.toml.
| Option | Default | |
|---|---|---|
entrypoint |
(auto-detected) | main app file |
templates |
[] |
Jinja template directories |
source_roots |
[] |
extra import resolution roots |
env_files |
[".env", ".env.example"] |
env key definitions |
settings_env_files |
[".env", ".env.example", ".env.unittest"] |
env files checked for BaseSettings coverage |
process_env |
false |
include server process env |
process_env_show_values |
false |
show process-env values in hover |
client_fixtures |
["client", "async_client"] |
pytest HTTP client fixture names |
env.ignore |
[] |
env keys to suppress from diagnostics |
scan.ignore |
[".beads", ".claude", ".codegraph", ".git", ".mypy_cache", ".playwright-mcp", ".pytest_cache", ".ruff_cache", ".venv", "__pycache__", "node_modules", "target"] |
directory names excluded from workspace scans (replaces, not extends, the default) |
Feature toggles — all true by default except test_unknown_paths:
| Toggle | Default |
|---|---|
diagnostics |
true |
completion |
true |
hover |
true |
navigation |
true |
code_actions |
true |
code_lens |
true |
symbols |
true |
inlay_hints |
true |
document_links |
true |
test_unknown_paths |
false |
# fastapi-lsp.toml
entrypoint = "app/main.py"
templates = ["app/templates"]
[features]
code_lens = false
[check]
only = []
ignore = ["env/undefined-key"]
[scan]
ignore = [".beads", ".claude", ".codegraph", ".git", ".mypy_cache", ".playwright-mcp", ".pytest_cache", ".ruff_cache", ".venv", "__pycache__", "node_modules", "target", ".worktrees"]
CLI
fastapi-lsp lsp [--stdio | --tcp --address 127.0.0.1 --port 9257]
fastapi-lsp check PATH [--only CODES] [--ignore CODES] [--format text|json] [--fix]
fastapi-lsp routes [PATH] [--format text|json]
Development
cargo build
cargo test
uv run --group dev pytest e2e/ -v
License
MIT
Metadata
Release files for fastapi-lsp 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| fastapi_lsp-0.1.9-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details for fastapi_lsp-0.1.9-py3-none-win_amd64.whl |
| fastapi_lsp-0.1.9-py3-none-manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.28+ x86-64 | Details for fastapi_lsp-0.1.9-py3-none-manylinux_2_28_x86_64.whl |
| fastapi_lsp-0.1.9-py3-none-manylinux_2_28_aarch64.whl | Python 3 | none | Linux glibc 2.28+ ARM64 | Details for fastapi_lsp-0.1.9-py3-none-manylinux_2_28_aarch64.whl |
| fastapi_lsp-0.1.9-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details for fastapi_lsp-0.1.9-py3-none-macosx_11_0_arm64.whl |
| fastapi_lsp-0.1.9-py3-none-macosx_10_12_x86_64.whl | Python 3 | none | macOS 10.12+ x86-64 | Details for fastapi_lsp-0.1.9-py3-none-macosx_10_12_x86_64.whl |
Total release size: 12.3 MB
Release files / fastapi_lsp-0.1.9-py3-none-win_amd64.whl
| Download URL | fastapi_lsp-0.1.9-py3-none-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
223feeb8a54f1992f33139c9a6fb222ec19108ba4a91862b410988cca817b9cf
|
|
BLAKE2b-256 checksum How to use checksums |
5bcd5d6c343b15bb1182e5e08346f951b1cc58498b427a3978e815c0d21b4c26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fastapi_lsp-0.1.9-py3-none-manylinux_2_28_x86_64.whl
| Download URL | fastapi_lsp-0.1.9-py3-none-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | Linux glibc 2.28+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
e2d9e7ff4dacb34f93d7402994d0e2e52cbc4001557ba1ba00597c6baff91ac3
|
|
BLAKE2b-256 checksum How to use checksums |
60c871ec50428bc7c98d97a7dd589d1ff6c4a071622d99e33c37b3d09fb59e86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fastapi_lsp-0.1.9-py3-none-manylinux_2_28_aarch64.whl
| Download URL | fastapi_lsp-0.1.9-py3-none-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | Linux glibc 2.28+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
33c3d31382e1d0ff85d42ac879c8981f9eb7d1a82eb4f31a32ecb38cc83919f7
|
|
BLAKE2b-256 checksum How to use checksums |
53f4fdd11a2840ca91bd5bd78fe8872b7b918e9773582f4304b590f61b046275
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fastapi_lsp-0.1.9-py3-none-macosx_11_0_arm64.whl
| Download URL | fastapi_lsp-0.1.9-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.3 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
af591459349a02d97017c680d04b9cf3f2c68f32b6069d162d0762f3931e3872
|
|
BLAKE2b-256 checksum How to use checksums |
447d2d27e451cf5d62f64c8545db710920bd71b4e7f3d81218400d9c9b71dd48
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / fastapi_lsp-0.1.9-py3-none-macosx_10_12_x86_64.whl
| Download URL | fastapi_lsp-0.1.9-py3-none-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | Python 3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
d106dc4a6f19864c2cb815245dc0847a1e89f06bb4ce5a80ab6c089d7e88d095
|
|
BLAKE2b-256 checksum How to use checksums |
f09e4ba86337929683fbcb6865c68e99a5867de0143fc128c4c0d0b2f6279d5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for fastapi-lsp 0.1.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.