Skip to content
Conduit

mcp server

Contexta

Contexta turns codebases into curated context packs for debugging, reviews, onboarding, refactors, and AI handoffs. It analyzes project structure, detects technologies, surfaces risks and hotspots, an

pablokaua03/Contextacommunitylistedunreviewed

Set up

Runs on your computer. Pick your agent and operating system.

Before you start

  • uv (`curl -LsSf https://astral.sh/uv/install.sh | sh`)
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "contexta": {
      "command": "uvx",
      "args": [
        "contexta-ai"
      ]
    }
  }
}

same format Cursor, GitHub Copilot CLI, Junie, JetBrains AI Assistant, Augment (Auggie CLI), Factory Droid, Kiro, Devin CLI +12

Values in angle brackets are placeholders. Restart Claude Desktop after editing its config.Claude Desktop docs

README

synced Oct 21, 2026

Contexta

AI-native codebase context engine. Serves intelligent project context to Claude Code, Cursor, Windsurf, and any MCP-compatible tool — or generates curated context packs for manual use.

Python License: MIT Platform Version MCP

     

Install via pip, download the portable executable, or run from source.


What is Contexta

Contexta analyzes codebases and serves intelligent, curated context to AI tools. Instead of dumping files blindly, it understands project structure, detects frameworks, ranks files by importance, and delivers exactly what an AI needs.

Three ways to use it:

ModeCommandWhat it does
MCP Servercontexta serveRuns as a tool server — Claude Code, Cursor, Windsurf call it automatically
CLIcontexta ./project --pack onboardingGenerates a context pack Markdown file
GUIcontextaDesktop app with visual controls

MCP Server (recommended)

The MCP server is the primary way to use Contexta. AI coding assistants call it as a tool to understand your project — no copy-paste needed.

Setup

Add to your MCP configuration (Claude Code, Cursor, Windsurf, etc.):

{
  "mcpServers": {
    "contexta": {
      "command": "contexta",
      "args": ["serve"]
    }
  }
}

Or if running from source:

{
  "mcpServers": {
    "contexta": {
      "command": "python",
      "args": ["/path/to/contexta_mcp.py"]
    }
  }
}

Available tools

ToolWhat it does
scan_projectQuick fingerprint — type, language, frameworks, deps, entry points
get_architectureModule relationships, folder structure, risks, key patterns
generate_contextFull AI-optimized context pack with all preset options
find_filesSearch files by name, extension, or keyword
read_filesRead specific file contents
list_packsList available pack presets
cache_statusShow cache hit/miss statistics
refresh_cacheForce-refresh cached analysis

Smart cache

Results are cached in memory with automatic invalidation. First call analyzes the project (~700ms), subsequent calls return in ~2ms until files change on disk. The cache monitors file mtimes and manifest files — when you edit code, the next call recomputes automatically.


Install

Option A: pip (recommended)

pip install contexta-ai

Optional AI API integrations:

pip install contexta-ai[claude]    # Claude API
pip install contexta-ai[gemini]    # Gemini API
pip install contexta-ai[openai]    # OpenAI API
pip install contexta-ai[all-ai]    # All three

Option B: Portable executables

  • Windows: download contexta.exe

    Windows 11: right-click the downloaded .exe → Properties → check Unblock → OK before running.

  • Linux: download contexta-linux.tar.gz

Option C: From source

git clone https://github.com/pablokaua03/Contexta.git
cd Contexta
pip install -r requirements.txt
python contexta.py

CLI usage

# Generate context packs
contexta ./project                                          # default pack
contexta ./project --pack onboarding                        # understand a new codebase
contexta ./project --pack raw_files                         # clean path + content dump
contexta ./project --pack pr_review --diff --copy           # review changes
contexta ./project --mode debug --focus "auth flow"         # debug a specific area

# AI API integration — send context + question directly to an AI
contexta ./project --ask "what are the main security risks?"
contexta ./project --ask "explain the architecture" --provider claude

# Configure AI API keys
contexta --configure-ai

CLI flags

FlagDescription
--packPreset: custom, chatgpt, onboarding, pr_review, risk_review, debug, backend, frontend, changes_related, raw_files
--modeContext mode: full, debug, feature, diff, onboarding, refactor
--compressionfull, balanced, focused, signatures, lean
--aiTarget AI profile: generic, chatgpt, claude, gemini, copilot
--taskTask profile: general, ai_handoff, bug_report, code_review, explain_project, risk_analysis, refactor_request, pr_summary, write_tests, find_dead_code
--focusBias scoring around a topic (e.g. "auth flow", "database")
--diff / --stagedUse git changes as context
--askSend context pack + prompt to an AI API
--providerAI provider: claude, gemini, openai
--api-keyAPI key (also reads ANTHROPIC_API_KEY, GOOGLE_API_KEY, OPENAI_API_KEY)
--configure-aiInteractive AI API setup
-c / --copyCopy output to clipboard
-o / --outputCustom output path

Context packs

PackBest for
onboardingUnderstanding a new codebase fast
pr_reviewCode review with change context
risk_reviewRegression hotspots, missing coverage, broad-impact modules
debugBug hunting with changed/suspicious files prioritized
backend / frontendBias toward one side of the app
changes_relatedGit changes + nearby relevant files
raw_filesClean dump of important files — path + full content, no analysis
chatgptGeneral-purpose ChatGPT preset
customFull manual control

What Contexta exports

Depending on pack, mode, and task, the output can include:

  • Project summary with detected technologies, entry points, purpose, and central modules
  • Read-this-first path through the repository
  • Main execution flow narrative
  • Core files, supporting files, related tests, and changed-file context
  • Relationship maps and risk notes
  • Score breakdown explaining why each file was selected
  • Curated Markdown payload ready for any AI tool

Main features

FeatureDetail
MCP Servercontexta serve — AI tools call it as a tool server with smart caching
AI API integration--ask sends context directly to Claude, Gemini, or OpenAI
Smart cache~2ms cached responses with automatic mtime-based invalidation
Raw files packClean path + content dump for simple AI workflows
GUI + CLIDesktop app for visual use, CLI for scripting and automation
Project fingerprintingDetects stack, frameworks, domain, and project type automatically
Syntax-aware analysistree-sitter + heuristic fallback for symbol extraction
Multi-languagePython, JS/TS, Go, Rust, PHP, Java, C#, Kotlin, Swift, C++ and more
Token guidancetiktoken-backed estimates for pack sizing
Inline blob protectionCollapses base64/binary literals automatically
PyPI packagepip install contexta-ai with optional AI extras

Build from source

# Windows (requires Visual Studio C++ Build Tools)
.\build.bat

# Linux / macOS
chmod +x build.sh && ./build.sh

Build outputs: dist/contexta.exe (Windows), dist/contexta (Linux/macOS), dist/contexta-linux.tar.gz (Linux bundle).


Run tests

python -m pytest tests/ -k "not test_relation_score"

Security and behavior

  • Read-only: Contexta does not modify the scanned project
  • No runtime telemetry or network requirement (except optional --ask AI calls)
  • Scan limits prevent runaway exports
  • Embedded binary/blob payloads are suppressed automatically
  • AI API keys are stored locally in ~/.contexta/ai_config.json when using --configure-ai

Contributing

See CONTRIBUTING.md

Changelog

See CHANGELOG.md

License

MIT © pablokaua03

↑↓ navigate openesc close