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.1

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.1
File Size Uploaded Provenance Actions
codenav_mcp-1.0.1.tar.gz 109.6 kB Without provenance Details for codenav_mcp-1.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 231.4 kB

Release files / codenav_mcp-1.0.1.tar.gz

Download URL codenav_mcp-1.0.1.tar.gz
Size 109.6 kB
Tags Source
SHA-256 checksum
How to use checksums
24f8b65802562bd51dd363fe7631741682cc9027f456f04f87e8950c53f8bb93
BLAKE2b-256 checksum
How to use checksums
577e2bfee0d1cc632f4b8892bb6048b9e55a99dab054ee1de33e58ab6fc470d2
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.1-py3-none-any.whl

Download URL codenav_mcp-1.0.1-py3-none-any.whl
Size 121.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7097d9f101913e06542cf6efa9fc742329ce4b0595b64fe78c30b44f58c260f3
BLAKE2b-256 checksum
How to use checksums
27c5622ca083f81a54d4f6cc5046447a75f04df257fceadb74275c898093c7e7
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.1

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