MCP Catalogs
HomeCTX screenshot

CTX

by Alegau03·122·Score 47

CTX is a context runtime engine that optimizes AI coding workflows by reducing token waste through graph memory, compact task packs, and caching.

developer-toolsai-llmproductivity
9
Forks
2
Open issues
this month
Last commit
2d ago
Indexed

Overview

CTX is a Rust-based local runtime layer that serves as the context engine for OpenCode and AI coding agents. It indexes repositories, stores reusable guidance as graph memory, exposes local MCP tools, and maintains telemetry about token savings. CTX addresses token waste by implementing strategies like graph memory for reusable rules, read-cache compression for file rereads, command pruning for logs, and compact context packs. Unlike agent launchers, CTX integrates directly into the OpenCode workflow as a context layer.

Try asking AI

After installing, here are 5 things you can ask your AI assistant:

you:Optimizing OpenCode workflows by reducing token usage through context compression
you:Managing reusable code rules and patterns in graph memory for better retrieval
you:Creating compact task-specific context packs to minimize unnecessary information sent to AI models
you:What makes CTX different from other AI coding tools?
you:How does CTX reduce token usage in AI coding workflows?

When to choose this

Choose CTX if you're using OpenCode and need significant token reduction through intelligent context management, especially with complex rule sets or repeated file reads.

When NOT to choose this

Don't choose CTX if you're not using OpenCode, or if you prefer traditional markdown-based instruction files over graph-based memory systems.

Tools this server exposes

12 tools extracted from the README
  • query

    Query repository knowledge with hybrid graph, snippets, FTS, symbols, and semantic ranking

  • read_file

    Read files with compressed modes: full, outline, or digest

  • pack

    Build compact task packs with graph, memory, failure, diff, and attachment signals

  • plan

    Create implementation plans by combining retrieval, graph, memory, and pack signals

  • run_command

    Execute shell commands with root cause extraction and log storage

  • learn

    Store reusable project lessons in graph memory

  • toolbook_import

    Import toolbooks into CTX for large CLI manuals

  • toolbook_search

    Search imported toolbooks for specific information

  • toolbook_pack

    Pack relevant toolbook sections for specific tasks

  • prune_logs

    Prune logs and shell output to extract root cause signals

  • get_stats

    Retrieve token savings and performance metrics

  • dashboard

    Display live CTX dashboard with local runtime metrics

Note: Tool names inferred from slash commands documented in the OpenCode usage section. The documentation mentions MCP functionality but doesn't explicitly list the MCP tool names or signatures.

Comparable tools

code-mcpfs-mcpshell-mcp

Installation

Install CTX using one of these methods:

# Via Cargo
cargo install ctx-cli

# One-line installer
curl -fsSL https://raw.githubusercontent.com/Alegau03/CTX/main/scripts/install.sh | sh

# Via npm
npm i -g @alegau/ctx-bin

# Via Homebrew
brew tap Alegau03/ctx && brew install ctx

To integrate with OpenCode:

cd /path/to/your/project
ctx init
ctx index
ctx opencode install
opencode

For Claude Desktop integration, add to claude_desktop_config.json:

{
  "mcpServers": {
    "ctx": {
      "command": "ctx",
      "args": ["mcp"]
    }
  }
}

FAQ

What makes CTX different from other AI coding tools?
CTX is not another agent launcher but a context runtime layer that optimizes how information is passed to AI models through compression, caching, and graph memory, reducing token waste while preserving the original AI model and workflow.
How does CTX reduce token usage in AI coding workflows?
CTX implements several strategies including graph memory for reusable rules, read-cache compression for file rereads, command pruning for logs, delta-aware indexing, and compact context packs that contain only task-relevant information.

Compare CTX with

GitHub →

Last updated · Auto-generated from public README + GitHub signals.