Skip to main content

MCP server for AI agents — structured code analysis that cuts token usage by 87%

Project description

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%
get_symbol_summaries AI semantic descriptions per symbol reading implementation ~85%

Search & Navigation

Tool Returns Replaces Savings
analyze_project language breakdown, file counts, tree find + wc ~98%
code_search regex matches with context lines grep + cat ~90%
semantic_search natural language query over indexed codebase reading everything ~96%
dir_summary directory listing with sizes ls -la ~80%
find_files files matching name, extension, path find ~80%

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_metrics_report · get_metrics_events · get_metrics_daily_trend · get_metrics_slowest · 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%
Semantic query across codebase ~8,000 tokens ~300 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

PRs welcome. Open issues.


License

MIT — free for any use.

Project details


Download files

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

Source Distribution

cctx_mcp-0.1.0.tar.gz (59.5 kB view details)

Uploaded Source

Built Distribution

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

cctx_mcp-0.1.0-py3-none-any.whl (57.9 kB view details)

Uploaded Python 3

File details

Details for the file cctx_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: cctx_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 59.5 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for cctx_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6c3e3e6c15ec34c10c56eddcc286a7dc3bfcff482cf633d327f85bf3c118beb1
MD5 27a442bbf2c580e1ef2a5a534c56b1fd
BLAKE2b-256 273f082d4f7fcaddf9689805a6dbe86d1ae953c790e8a390a9f8a7236e9ab291

See more details on using hashes here.

File details

Details for the file cctx_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cctx_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 57.9 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for cctx_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca07daea08523ed44c4e2943381fcb0734f6d5afadc7616c7adba94e0fa22a05
MD5 defd0a6c7be4a3c7093260d6c59d2f74
BLAKE2b-256 d87a945bfc40c4b1a4226f73515fb2bc6e7bc39a18f5903f3a87e787195940d4

See more details on using hashes here.

Supported by

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