Python code navigation and type-checked refactoring through MCP, powered by ty.
Maintain this server? Claim it
This server only runs locally, from a package. Install it with the instructions on this page to try it.
Pick your client. Values in capitals, like YOUR_TOKEN, are yours to fill in.
Run in a terminal
claude mcp add codenav-mcp \ -- uvx codenav-mcp==2.0.1
Environment
CODENAV_MCP_WORKSPACE (optional, not in the config above): Project root the server serves (never overridden); default follows the client's MCP roots, CLAUDE_PROJECT_DIR or the working directoryCODENAV_MCP_SOURCE_ROOT (optional, not in the config above): Directory scanned for lookup implementations candidates and used to derive dotted import paths (e.g. src); default is the whole workspaceCODENAV_MCP_READ_ONLY (optional, not in the config above): Set to 1/true/yes/on to make write tools refuse to write (previews and checks still work)CODENAV_MCP_EXTRA_SOURCE_ROOTS (optional, not in the config above): Comma-separated extra directories for Protocol implementation lookup. Unset scans top-level test/ and tests/ outside the source root. Set to none to scan only the source root.CODENAV_MCP_MAX_OUTPUT_CHARS (optional, not in the config above): Maximum characters of one tool result (default 30000); longer results end with an omission noteCODENAV_MCP_ALLOW_READONLY_FILES (optional, not in the config above): Set to 1/true/yes/on to let write tools overwrite read-only (0444) Python files and keep their modeCODENAV_MCP_EXCLUDE_DIRS (optional, not in the config above): Comma-separated directory names added to the built-in list of directories that are never scanned or writtenCODENAV_MCP_INCLUDE_DIRS (optional, not in the config above): Comma-separated directory names removed from that list, for example build to treat a first-party build/ package as sourceCODENAV_MCP_MAX_FILES (optional, not in the config above): Maximum number of Python files (.py/.pyi) a workspace may hold (default 250000); a larger tree is refused before the language server startsCODENAV_MCP_STATE_DIR (optional, not in the config above): Directory where previews and the applied-edit history are kept across restarts, one subdirectory per workspace (default $XDG_STATE_HOME/codenav-mcp or ~/.local/state/codenav-mcp)We don't run packages, so we can't list this server's tools.