Trace 标志

Trace

社区
mrchatam

Local-first project knowledge graph + progressive planning for AI coding agents (CLI, MCP, optional GUI).

发布者mrchatam
代码仓库Trace
语言Go
复刻数
0
星标数
12
可用工具
0
传输类型stdio
分类
许可协议Apache-2.0
链接
  • 将工具接入 AI 工作流

    Trace 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 12 个 Star 和 0 个 Fork。

Trace

Local-first project knowledge graph and progressive planning for AI coding agents.

Trace sits beside Git and your coding agent. It records why work exists, what the project currently believes, and how discoveries should change the next plan — then serves that back as bounded context (CLI, MCP, optional local GUI).

Why Trace

Coding agents see files and diffs. They usually do not see:

  • which goal or decision caused a change;
  • what assumptions are still load-bearing;
  • what evidence supports a “done” claim;
  • how a discovery should replan affected work;
  • which skills/tools/MCP servers a task actually needs.

Trace is that missing layer: a versioned SQLite graph under .trace/, with Git remaining the source-of-truth for history and content.

Install

Requirements: Go matching go.mod (currently 1.26+), plus a C toolchain for the full CLI (CGO_ENABLED=1 — tree-sitter analyzers).

The module is not published to the Go module proxy yet, so go install …@latest fails until a version is tagged. Build from a checkout:

bash
git clone https://github.com/mrchatam/Trace.git
cd Trace
CGO_ENABLED=1 go build -o bin/trace ./cmd/trace
CGO_ENABLED=1 go build -o bin/trace-mcp ./cmd/trace-mcp
cp -f bin/trace bin/trace-mcp ~/.local/bin/   # or any dir on PATH
./bin/trace version
  • Both trace and trace-mcp need CGO_ENABLED=1 on tip (tree-sitter / analyzers). CGO_ENABLED=0 fails to link language bindings.
  • Some library packages that do not import analyzers remain usable with CGO_ENABLED=0.
  • No GitHub Releases yet — use the build above. See also docs/gui-quickstart.md for PATH notes.

trace install … configures agent/MCP/hook snippets; it does not put binaries on PATH.

60-second quickstart

From any project directory (Git optional but recommended):

bash
trace init
# → creates .trace/trace.db (never project-root trace.db)

trace add goal --title "Harden auth" --body "Close session gaps"
# → {"id":"<goal-id>","ok":true,"type":"goal"}

trace add task --title "Audit cookie flags" --goal-id <goal-id>
# → {"id":"<task-id>","ok":true,"type":"task"}

trace index
trace search cookie
trace context <task-id>
trace loop status --task <task-id>

Clone of a repo that commits trace/graph.json:

bash
trace init
trace seed import trace/graph.json
trace index
trace plan show
trace why goal <id>
trace context <task-id>

After seed import, tasks are PENDING (default export omits reviews, transitions, and task work_state).

Surfaces

SurfaceBinary / commandRole
CLItraceCanonical operator interface (init, add, index, search, context, loop, plan, …)
MCPtrace-mcp (stdio)Same graph for any MCP-capable coding agent — tools trace_why, trace_context, trace_search, trace_loop, trace_plan, trace_explore, … (17 tools; confirm with trace_version)
HTTP / GUItrace serve / trace guiOpt-in loopback API + embedded Explore SPA (default 127.0.0.1:7432; not a daemon)

Wire Trace into your coding agent (MCP)

Trace’s agent integration is stdio MCP, not a Cursor-only plugin. Any host that can launch an MCP server with a command + args can use trace-mcp the same way (Cursor, Claude Code, and other MCP clients).

Universal config shape (print adapters emit this):

json
{
  "mcpServers": {
    "trace": {
      "type": "stdio",
      "command": "/abs/path/to/trace-mcp",
      "args": ["-C", "${workspaceFolder}"]
    }
  }
}

Prefer an absolute path to trace-mcp. After install or rebuild, restart/reload the MCP connection in your agent so you are not talking to a stale stdio process. Then call trace_version and confirm the identity matches your build.

Shipped install adapters (helpers — same MCP server underneath):

bash
# Detect what Trace can configure in this environment / project
trace install detect

# Cursor — prints snippet; --write merges into ~/.cursor/mcp.json (or --mcp-json)
trace install cursor
trace install cursor --write --bin /abs/path/to/trace-mcp

# Claude Code — requires project marker (.claude/ or CLAUDE.md); --write → .claude/trace-mcp.json
trace install claude
trace install claude --write --bin /abs/path/to/trace-mcp

# Optional: git post-commit / Cursor hook helpers
trace install git-hook
trace install cursor-hook

Other MCP hosts: paste the JSON above into that product’s MCP settings (or generate it with trace install cursor / claude and adapt the path). The protocol and tool names do not change.

GUI (any project with .trace/ — agent-agnostic):

bash
cd your-project && trace gui
# headless twin: trace serve

Details: docs/gui-quickstart.md. See also trace install --help and trace install detect.

What it is / isn’t

Is

  • Local-first knowledge + planning substrate for one project root (-C / cwd; no parent walk-up).
  • Hybrid retrieval: exact lookup, lexical FTS, graph-label traversal, temporal/history — not embedding/vector semantic search (deferred — DR-NOSSEM; do not expect semantic_match).
  • Progressive planning: coarse → deep near execution → replan from discoveries.
  • Evidence and independent review before DONE; provenance on inferred vs verified facts.
  • Portable causal graph via committed trace/graph.json (.trace/ stays local/gitignored).

Isn’t

  • A Git replacement, IDE, or coding-agent runtime.
  • Cloud SaaS, multi-tenant hosting, or always-on network daemon (HTTP/GUI is opt-in loopback).
  • Embedding/RAG semantic search (not shipped).
  • A claim that Jev or other external integrations are productized here.

Design principles (condensed)

  • Progressive planning; discovery is normal and feeds the plan.
  • Evidence over assertions; implementation ≠ review identity.
  • Context minimization — smallest high-value packet first, expand on demand.
  • Hybrid FTS/graph/temporal retrieval (no embeddings yet — DR-NOSSEM).
  • Provenance everywhere; forward progression; human authority.
  • Capability-aware tasks; Git for history; incremental index updates.

Feature map (shipped vs deeper docs)

AreaShipped surface (examples)
Graph CRUDtrace add, link, transition, review, tasks
Retrievalsearch, why, context, explore / MCP trace_explore
Loop / gatesloop next|apply|status|gate, optional --enforce
Planningplan create-coarse|deep|show|bootstrap|…
Indexindex / index status / index watch (file-local incremental)
Portable graphseed import|export → trace/graph.json
Impact / capsimpact, capability, agents recommend
Install adaptersinstall detect|cursor|claude|cursor-hook|git-hook|agents (MCP helpers for multiple agents)
Local HTTP/GUIserve, gui (embedded SPA)

For command truth, prefer trace --help and MCP Instructions / trace_version over older blog-style docs.

Documentation map

DocWhat
docs/TODO.mdExecution board index (phase tables under docs/TODO/)
docs/gui-quickstart.mdOpt-in GUI / serve
docs/ARCHITECTURE.mdComponent boundaries
docs/SECURITY.mdTrust boundaries
docs/PROJECT_MODEL.mdEntities, relations, provenance
docs/RETRIEVAL_AND_CONTEXT.mdRetrieval strategy (incl. DR-NOSSEM)
docs/ROADMAP.mdRoadmap / milestone gates
PROJECT_DOCS_INDEX.mdFull doc index
CONTRIBUTING.mdDev rules, portable-graph export, dual-stack notes
AGENTS.mdAgent entrypoint / phase focus
LICENSEApache-2.0

Status

Active research/engineering codebase: foundational graph, CLI, MCP, and opt-in local GUI are in use and under rapid iteration (multi-phase boards; see AGENTS.md). The validation bar is not “orchestrate many agents,” but:

Can an agent understand an unfamiliar repo, plan a bounded task, adapt when implementation discovers something new, and decide better with the project graph than with raw files alone?

Expect sharp edges, evolving commands, and honest gaps. Read trace --help and the active phase board before assuming a feature exists.

License

Apache-2.0. Hosted/enterprise offerings may appear later without restricting the open-source core.

安装

TypingMind
{
  "mcpServers": {
    "trace": {
      "command": "trace-mcp",
      "args": [
        "-C",
        "{{config.WORKSPACE_FOLDER}}"
      ],
      "env": {
        "WORKSPACE_FOLDER": "<WORKSPACE_FOLDER>"
      }
    }
  }
}

将 Trace MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 Trace 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请保持终端窗口及其中的进程运行。
3

将 Trace 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 Trace MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "trace": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 Trace MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 Trace MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 Trace 帮我完成这项任务吗?
Trace
当然。我已阅读。
以下是我使用 Trace 得到的结果。

常见问题

Trace MCP 服务器有什么用途?

Trace 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 Trace MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您可以让 Claude、ChatGPT、Gemini 等不同 AI 模型,或您在 TypingMind 中配置的其他模型使用 Trace,而无需为每个模型单独配置 MCP 服务器。

为什么在 TypingMind 中使用 Trace MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是优秀的大语言模型聊天前端之一。连接 Trace 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 Trace MCP 连接到 TypingMind?

Trace 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

Trace MCP 在 TypingMind 中提供哪些工具?

Trace 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 Trace MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行掌控模型提供商、API 密钥、提示词和 MCP 配置。如果 Trace 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇