Skip to main content

version

codenav-mcp

Give AI agents Python code navigation and refactoring through the Model Context Protocol. codenav-mcp uses ty's language server to resolve definitions, references and call sites, and checks proposed edits for type diagnostics before writing them.

Infographic showing an MCP client requesting navigation or an edit, ty resolving code, and edits being checked before preview or application.

An MCP client sends a request to codenav-mcp. Navigation uses ty to resolve code; edits are simulated and checked before they are previewed or applied. Applied edits can be undone while the server retains its edit journal, if the files have not changed since.

Quick start

Install uv, then register the server with your MCP host from the project root. The host starts it when needed.

Claude Code:

claude mcp add codenav -- uvx codenav-mcp

Codex (user configuration):

codex mcp add codenav -- uvx codenav-mcp

OpenCode (project configuration):

opencode mcp add codenav -- uvx codenav-mcp

See configuration for Claude Code and Cursor configuration, workspace selection and environment variables.

Requirements and limits

  • Python 3.11 or later; the package installs ty and its other dependencies.
  • Navigation and edits target Python (.py and .pyi). Positions are 1-indexed; columns use UTF-16 offsets.
  • Edit tools normally check type diagnostics and allow no new errors by default. Use apply=false to preview; apply_edit can explicitly apply a preview despite its diagnostic limit. Read-only mode disables writes. Checks are not a substitute for tests.
  • Batch calls run in order and are not atomic. Tool results are capped at 30,000 characters by default (CODENAV_MCP_MAX_OUTPUT_CHARS). See the tool reference for safety rules, output limits and known limits.

Environment

See configuration for environment variables.

Tests

From a checkout, run uv sync --group dev and uv run pytest. See development for lint and package smoke-test commands. No evaluation score is reported here.

Documentation

Related: webnav-mcp provides navigation for JS/TS/HTML/CSS. Design notes cover Protocol conformance, positioning and output formats.

License

MIT.

Metadata

Release files for codenav-mcp 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codenav-mcp 1.0.0
File Size Uploaded Provenance Actions
codenav_mcp-1.0.0.tar.gz 108.2 kB Without provenance Details for codenav_mcp-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for codenav-mcp 1.0.0
File Interpreter ABI Platform Actions
codenav_mcp-1.0.0-py3-none-any.whl Python 3 none any Details for codenav_mcp-1.0.0-py3-none-any.whl

Total release size: 228.2 kB

Release files / codenav_mcp-1.0.0.tar.gz

Download URL codenav_mcp-1.0.0.tar.gz
Size 108.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ac457eba8374703bb641570e7065d3d62e00a12efa60aabf2f7d65430329bda4
BLAKE2b-256 checksum
How to use checksums
e1122df84b498598960c28ac03fce8d72b385645ce4d73342dd7b7849b86259a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / codenav_mcp-1.0.0-py3-none-any.whl

Download URL codenav_mcp-1.0.0-py3-none-any.whl
Size 119.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a6a73df714cbc3372914cb138f0534ee38264b50a2a6792e974b41e2df3a037
BLAKE2b-256 checksum
How to use checksums
59e7d42e339f7e49b35017f1d63451d1da794e0d59a0f56bc5fb7a70a51ed419
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for codenav-mcp 1.0.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page