Skip to main content

CCTX-MCP

Cut AI agent token usage by 87%.
Structure-aware code analysis via the Model Context Protocol — returns symbol trees, dependencies, and docs instead of raw file contents.

PyPI Python Stars CI License Beta


Overview

CCTX-MCP — Code ConTeXt via Model Context Protocol. An MCP server that gives AI agents a structured view of source code without reading entire files.

Built for Claude, Cursor, OpenCode, and any MCP-compatible AI coding tool.

uvx cctx-mcp  ·  Tools  ·  Savings  ·  Install


Quick Start

uvx cctx-mcp

Add to your MCP client config:

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

Tools

Code Analysis

Tool Returns Replaces Savings
smart_read symbol hierarchy, deps, docs, line counts cat + manual parsing ~87%
find_symbols symbol locations by name or type grep -r + file reads ~99%
get_dependencies all imports of a file in one shot grep ^import ~96%
trace_calls every call site with file + line grep across repo ~90%
analyze_project language breakdown, file counts, tree find + wc ~98%
get_symbol_summaries AI semantic descriptions per symbol reading implementation ~85%

Git & Commits

Tool Returns Replaces Savings
compact_change_intelligence structured git diff with intent cues git diff + git status ~75%
draft_commit AI-generated conventional commit message writing from scratch ~90%
approve_commit_draft executes the commit after review git add + git commit —

Observability

get_config · get_health · get_version


Token Savings

Operation Native With CCTX-MCP Savings
Read 500-line file ~1,500 tokens ~200 tokens 87%
Find function across project ~5,000 tokens ~50 tokens 99%
Understand imports ~800 tokens ~30 tokens 96%
Analyze project structure ~10,000 tokens ~150 tokens 98%
Git change summary ~3,000 tokens ~750 tokens 75%

Typical session: 80%+ aggregate savings.


Supported Languages

Swift Python TypeScript JavaScript Rust Go Dart

Powered by tree-sitter AST — each language has a dedicated parser.


Install

uvx (recommended)

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

pip

pip install cctx-mcp
{
  "mcpServers": {
    "cctx-mcp": {
      "command": "python",
      "args": ["-m", "code_context.server"]
    }
  }
}

source

git clone https://github.com/nikondrat/cctx-mcp.git
cd cctx-mcp
uv sync
uv run python -m code_context.server --skip-index

Configuration

Variable Default Description
CC_OLLAMA_URL http://localhost:11434 Ollama server address
CC_OPENROUTER_API_KEY — Remote inference key
CC_LLM_ROUTER local-first local-first, local-only, remote-first, remote-only
CC_COMMIT_MODEL gemma4:latest Local model for commit drafting
CC_EMBED_MODEL nomic-embed-text Local model for embeddings
CC_SEMANTIC_SUMMARIES 1 Enable AI symbol summaries

Development

uv sync
uv run pytest tests/ -v

Debug Logging

Tool calls are logged to ~/.code-context-cache/debug.jsonl with args, result preview, latency, and status:

tail -f ~/.code-context-cache/debug.jsonl

Set CC_DEBUG_LOG env var to change the log path.

PRs welcome. Open issues.


License

MIT — free for any use.

Metadata

Release files for cctx-mcp 0.5.4

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

Source distribution (sdist)

Source distribution for cctx-mcp 0.5.4
File Size Uploaded
cctx_mcp-0.5.4.tar.gz 62.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cctx-mcp 0.5.4
File Interpreter ABI Platform
cctx_mcp-0.5.4-py3-none-any.whl Python 3 none any Details

Total release size: 122.6 kB

Release files / cctx_mcp-0.5.4.tar.gz

Download URL cctx_mcp-0.5.4.tar.gz
Size 62.3 kB
Tags Source
SHA-256 checksum
How to use checksums
358e8f48b441115bda11983dff5da8f2c26086fc5ca891f9b2e621f62112cdfc
BLAKE2b-256 checksum
How to use checksums
dbbc2e68b326e4e0d3798929608a0b3dd0693cdbc88753de61187d8d1936a3b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cctx_mcp-0.5.4-py3-none-any.whl

Download URL cctx_mcp-0.5.4-py3-none-any.whl
Size 60.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc921735e034a5929e4796aba1d25ba13cb8f4319ebc2c872aae484245b48806
BLAKE2b-256 checksum
How to use checksums
9d18c0c6bfa3217112c09638cc0b363235560021fd0d7f152c618ff4d3a52211
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.5.4 This release

2 release files

0.5.3

2 release files

0.1.0

2 release files

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