Skip to main content

CodeCanvas MCP

Evidence-backed code intelligence for Python coding agents.

CodeCanvas is a local static-analysis Model Context Protocol server. It answers questions about call paths, control flow, and change impact without forcing an agent to grep through an entire repository and infer the architecture from partial text matches.

On a blinded three-task Google ADK holdout, the logic_flow-only profile used 52.58% fewer server-reported input + output tokens than a built-in-tools baseline, with mean rubric scores of 99.5/100 versus 100/100. Uncached input + output fell 14.39%; the repository documents the full methodology and the simple task that regressed.

Quick start

Python 3.10 or newer is required.

claude mcp add codecanvas -- uvx codecanvas-mcp

For another MCP client, use the equivalent stdio configuration:

{
  "mcpServers": {
    "codecanvas": {
      "command": "uvx",
      "args": ["codecanvas-mcp"]
    }
  }
}

Pass an absolute project_path on the first tool call. CodeCanvas remembers the last explicitly selected project for the rest of the server session.

Tools

Tool Answers
project_status Which Python project is active, and is its analysis cached or ambiguous?
list_entrypoints What FastAPI routes, scripts, function entrypoints, and public library exports exist?
find_symbols Where is a function, method, or class by name or meaning?
logic_flow What is this function's compact branch, outcome, downstream-call, and effect story?
who_calls Who calls this function, directly or transitively?
call_tree What project code does this function reach, and where are the effects?
what_does What are this function's signature, calls, effects, exceptions, and direct risk?
function_flow How does this function branch?
reaching_conditions Which guards lead to each return or raise?
verify_claim Does a qualified source reaches target claim hold under the observed paths and guards?
analyze_impact Which entrypoints or public surfaces can an inline diff or git ref affect?
validate_state_schema Do a function's state reads, writes, and returns agree with a supplied schema?
simulate_state_transition What happens for focused state cases, invariants, and dependency overrides?

Evidence-first responses

Static analysis is not runtime truth, so CodeCanvas exposes uncertainty instead of hiding it. Successful responses identify the selected analysis_root and report evidence strength, inferred or ambiguous edges, truncation, and whether the result is safe to summarize as an unconditional claim.

verify_claim returns true, false, or uncertain. Unsupported qualifiers and inferred-only paths cannot silently become a definite true.

Scope and safety

  • CodeCanvas analyzes Python source with AST-based call-graph and control-flow analysis.
  • FastAPI routes and Depends() chains, scripts, and distributed package exports are recognized as entrypoints.
  • Compatible analysis is cached locally under <project>/.codecanvas/.
  • Dynamic imports, reflection, monkey patching, and runtime-only values may remain unresolved and are reported as qualifications where possible.
  • simulate_state_transition imports and executes trusted project code in a separate process. It is not a security sandbox; the imported code may access the filesystem, network, or subprocesses and may have import-time effects.

The complete guide, agent instruction snippet, benchmark command, and development setup are available in the GitHub repository.

License

CodeCanvas MCP is open-source software licensed under the MIT License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codecanvas_mcp-0.1.15.tar.gz (269.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codecanvas_mcp-0.1.15-py3-none-any.whl (199.8 kB view details)

Uploaded Python 3

File details

Details for the file codecanvas_mcp-0.1.15.tar.gz.

File metadata

  • Download URL: codecanvas_mcp-0.1.15.tar.gz
  • Upload date:
  • Size: 269.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for codecanvas_mcp-0.1.15.tar.gz
Algorithm Hash digest
SHA256 dea769620e1960c7c12b988e53b11c56c6b8e70cdd1d39890769bb7e8b6c6e36
MD5 be89fca2dbb317345498273f6cf6e596
BLAKE2b-256 59377c189240fde5d388289f96111bf6dd772efa8b1d3a9a35a3b1f6d5ae8d1f

See more details on using hashes here.

File details

Details for the file codecanvas_mcp-0.1.15-py3-none-any.whl.

File metadata

  • Download URL: codecanvas_mcp-0.1.15-py3-none-any.whl
  • Upload date:
  • Size: 199.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for codecanvas_mcp-0.1.15-py3-none-any.whl
Algorithm Hash digest
SHA256 1ddf8aa4b034863572149863a6296eba4290d1d1b6084977a6d7a107ddf4a3bf
MD5 b09b3fa318deb1f6d22b8960cd4219d7
BLAKE2b-256 2b38a3298f747c740c747b8d88c1edf80f252438d99795a36393eb8791f9592e

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.17

2 files

This release

0.1.15 This release

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page