Server data from the Official MCP Registry
Python code navigation and type-checked refactoring through MCP, powered by ty.
About
Python code navigation and type-checked refactoring through MCP, powered by ty.
Security Report
Valid MCP server (2 strong, 1 medium validity signals). No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry.
3 files analyzed · 1 issue found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
Permissions Required
This plugin requests these system permissions. Most are normal for its category.
What You'll Need
Set these up before or after installing:
Environment variable: CODENAV_MCP_WORKSPACE
Environment variable: CODENAV_MCP_SOURCE_ROOT
Environment variable: CODENAV_MCP_READ_ONLY
Environment variable: CODENAV_MCP_EXTRA_SOURCE_ROOTS
Environment variable: CODENAV_MCP_MAX_OUTPUT_CHARS
Environment variable: CODENAV_MCP_ALLOW_READONLY_FILES
Environment variable: CODENAV_MCP_EXCLUDE_DIRS
Environment variable: CODENAV_MCP_INCLUDE_DIRS
Environment variable: CODENAV_MCP_MAX_FILES
Environment variable: CODENAV_MCP_STATE_DIR
How to Install
Add this to your MCP configuration file:
{
"mcpServers": {
"codenav-mcp": {
"command": "uvx",
"args": [
"codenav-mcp==2.0.1"
],
"env": {
"CODENAV_MCP_MAX_FILES": "your-codenav-mcp-max-files-here",
"CODENAV_MCP_READ_ONLY": "your-codenav-mcp-read-only-here",
"CODENAV_MCP_STATE_DIR": "your-codenav-mcp-state-dir-here",
"CODENAV_MCP_WORKSPACE": "your-codenav-mcp-workspace-here",
"CODENAV_MCP_SOURCE_ROOT": "your-codenav-mcp-source-root-here",
"CODENAV_MCP_EXCLUDE_DIRS": "your-codenav-mcp-exclude-dirs-here",
"CODENAV_MCP_INCLUDE_DIRS": "your-codenav-mcp-include-dirs-here",
"CODENAV_MCP_MAX_OUTPUT_CHARS": "your-codenav-mcp-max-output-chars-here",
"CODENAV_MCP_EXTRA_SOURCE_ROOTS": "your-codenav-mcp-extra-source-roots-here",
"CODENAV_MCP_ALLOW_READONLY_FILES": "your-codenav-mcp-allow-readonly-files-here"
}
}
}
}Some servers take additional arguments. See the repository for details.
Documentation
View on GitHubFrom the project's GitHub README.
codenav-mcp
Python code navigation and type-checked refactoring over MCP, powered by Astral's ty. Use it to follow typed calls through imports and dependency injection, find structural Protocol implementations, and preview refactors that touch several files. Use grep for exact-name text lookups and Read for a known file or excerpt.
An agent asks by name, and ty follows the types to answer. For an edit, codenav builds the change in memory, offers names it found in strings, docs and shell heredocs as optional sites, and writes only if ty reports no new type errors. Every change has a preview ID to apply and an undo ID.
What it can do
- Follow typed code: find callers and Protocol implementations across imports and dependency injection.
- Preview refactors: rename symbols, change signatures and move definitions with their linked usages.
- Catch overlooked sites: surface mentions in strings, docs and shell heredocs for review.
- Review and undo: inspect type-checked previews before applying them, then undo stored changes.
For agent workflows, exact calls and parameters, see the agent tool guide.
Quick start
Install uv and Node.js 22+, then run this from your project folder. mcps prompts you to choose agents and registers CodeNav locally:
npx @danielxir96/mcps add illescasDaniel/codenav-mcp
When installing for OpenCode, CodeNav requests codemode: false so its tools appear directly to the agent.
See the OpenCode setup for older installers and manual registration.
claude mcp add codenav -- uvx codenav-mcp
codex mcp add codenav -- uvx codenav-mcp
For OpenCode, use the configuration entry with codemode: false.
Some models need a prompt to pick up new tools (see What has been measured). Add this to
the project's AGENTS.md or CLAUDE.md.
For Python symbol navigation and refactors, start with Codenav’s `lookup` or `search`.
If those tools aren’t visible, use your harness’s MCP tool catalog or discovery mechanism to find and invoke them before falling back to grep, sed, or hand edits.
If Codenav is unavailable, briefly explain why and proceed.
Requirements and limits
- Python 3.11 or later. ty installs with codenav, and a workspace's own ty takes priority when present.
- Python navigation and writes cover
.pyand.pyifiles. Positions use 1-based lines and UTF-16 columns. - The write gate checks types only. Run the relevant tests and documentation checks after applying a change.
- Static analysis can't resolve every dynamic reference, mock, framework registration or library extension; review the optional sites a rename offers. Known limits
What has been measured
Small models (Claude Haiku 5.5, GPT-6 Luna) did real tasks on one project with and without codenav, and every run was graded against a hand-checked key. These are pilots with a few runs per task: read them as direction, not effect sizes.
- Completeness on a big rename: a 35-file rename where the tests can't see 4 of the files (an example, a doc page, two shell scripts). Luna with codenav updated all 4 in 4 of 5 runs, without it in 0 of 4.
- Effort: Haiku was usually complete either way, but with codenav it used 161k-359k input tokens against 368k-519k.
- Adoption: Haiku used codenav unprompted in 17 of 18 runs. Luna used it in 0 of 12 runs without the hint line above, and 12 of 13 with it.
- Where it didn't help: on tasks where names are distinct and the tests thorough, careful grep was just as correct, and codenav sometimes cost more tokens.
Findings, data and the harness to repeat the runs: Research.
How it is tested
A refactoring tool must not break code quietly, so codenav is tested in several ways:
- About 1,300 tests: unit tests, plus about 350 integration tests that run the tools against a real ty server.
- Property tests: about 190, with Hypothesis and generated Python (hypothesmith), including a state machine for preview, apply and undo, and CrossHair symbolic checks.
- A refactor fuzzer: random renames, moves and signature changes on real projects (srxy, click, tomlkit), each checked against the project's own tests and ty. 187 refactors so far, none silently broke code.
- Differential checks: references agree with jedi on 40 of 40 symbols, and renames with rope on 38 of 40; the 2 differences are call sites rope misses.
- Mutation testing (mutmut) of the modules where a wrong edit would go unnoticed, to find tests that don't check enough. The suite catches about 84% of the mutants there; the gaps that mattered got tests.
- Agent pilots: the small-model runs above, graded by hand.
The results and their data are in Research; how to run each check is in Hardening checks.
Documentation
- Tool reference
- Migrating from 1.x
- Host setup, workspace selection and environment variables
- Local setup and tests
- Research: measured results and data
- Documentation index
License
Reviews
No reviews yet
Be the first to review this server!
More Developer Tools MCP Servers
Rea
Freeby Morluto · Developer Tools
Reverse engineer anything from your terminal or agent with one CLI and MCP server.
Paperclip
Freeby Paperclipai · Developer Tools
Trending hip-hop artist momentum scores across four cultural dimensions.
Scrapling
Freeby D4Vinci · Developer Tools
Web scraping with stealth HTTP, real browsers, and Cloudflare bypass. CSS selectors supported.
Server Time
Freeby Modelcontextprotocol · Developer Tools
Current time lookup and conversion between IANA timezones
Toleno
Freeby Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
MCP Marketplace
Freeby mcp-marketplace · Developer Tools
Search and install MCP servers from inside your AI client.
