MCP Catalogs
首页CTX screenshot

CTX

by Alegau03·122·综合分 47

CTX是一个上下文运行时引擎,通过图记忆、紧凑任务包和缓存机制优化AI编码工作流程,减少token浪费。

developer-toolsai-llmproductivity
9
Forks
2
活跃 Issue
本月
最近提交
2 天前
收录于

概述

CTX是一个基于Rust的本地运行时层,作为OpenCode和AI编码代理的上下文引擎。它索引存储库,将可重用指导存储为图记忆,暴露本地MCP工具,并维护token节省的遥测数据。CTX通过实现图记忆、读取缓存压缩、命令修剪和紧凑上下文包等策略来解决token浪费问题。与其他代理启动器不同,CTX作为上下文层直接集成到OpenCode工作流程中。

试试问 AI

装完之后,这里有 5 个你可以让 AI 做的事:

:通过上下文压缩优化OpenCode工作流程,减少token使用
:在图记忆中管理可重用的代码规则和模式,提高检索效率
:创建紧凑的任务特定上下文包,减少发送给AI模型的不必要信息
:CTX与其他AI编码工具有何不同?
:CTX如何减少AI编码工作流程中的token使用?

什么时候选它

如果你使用 OpenCode 并需要通过智能上下文管理显著减少令牌消耗,特别是有复杂规则集或重复文件读取的场景,应该选择 CTX。

什么时候不要选它

如果你不使用 OpenCode,或者更喜欢传统的基于 markdown 的指令文件而非基于图的记忆系统,则不应选择 CTX。

此 server 暴露的工具

从 README 抽取出 12 个工具
  • 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

说明: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.

可对比工具

code-mcpfs-mcpshell-mcp

安装

使用以下方法之一安装CTX:

# 通过Cargo安装
cargo install ctx-cli

# 一行安装器
curl -fsSL https://raw.githubusercontent.com/Alegau03/CTX/main/scripts/install.sh | sh

# 通过npm安装
npm i -g @alegau/ctx-bin

# 通过Homebrew安装
brew tap Alegau03/ctx && brew install ctx

要与OpenCode集成:

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

对于Claude Desktop集成,添加到claude_desktop_config.json

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

FAQ

CTX与其他AI编码工具有何不同?
CTX不是另一个代理启动器,而是一个上下文运行时层,通过压缩、缓存和图记忆优化信息传递给AI模型的方式,在保留原始AI模型和工作流程的同时减少token浪费。
CTX如何减少AI编码工作流程中的token使用?
CTX实现了多种策略,包括用于可重用规则的图记忆、用于文件重新读取的读取缓存压缩、用于日志的命令修剪、增量感知索引以及仅包含任务相关信息的紧凑上下文包。

CTX 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。