# trace-mcp — Project Tracing MCP for Agents > Index a project once, then reuse maps and task context via an MCP server. Includes a CLI to init and register projects for Claude Code, Cursor, and more. ## Install Merge the JSON below into your `.mcp.json`: ## Quick Use 1. Install / run: ```bash npm install -g trace-mcp ``` 2. Start / smoke test: ```bash trace-mcp init && trace-mcp add ``` 3. Verify: - Connect from your MCP client and ask for detected frameworks/project map, then request context for a small task. ## Intro Index a project once, then reuse maps and task context via an MCP server. Includes a CLI to init and register projects for Claude Code, Cursor, and more. - **Best for:** Teams who want fewer repeated “scan the repo again” passes and more deterministic context reuse across tasks - **Works with:** Node.js CLI + MCP clients; codebases and markdown vaults (per repo docs) - **Setup time:** 12 minutes ## How to Use It Well - Setup time ~12 minutes (npm install + init + add a project) - GitHub stars + forks (verified): see Source & Thanks - CLI flow is 2 core commands (`init`, `add`) for first-time wiring Treat it like a cache for agent reasoning: run the CLI once to index and register a project, then pull project maps, change impact, and task context through MCP tools instead of repeatedly loading the same files into the prompt. ### FAQ **Q: What’s the big win?** A: You stop re-deriving the same repo map for every task. The agent can pull structured project context when needed. **Q: Do I have to keep files in my repo?** A: The project describes keeping state under a home directory and keeping the repo clean unless you opt in. **Q: Is it only for code?** A: No. The docs describe indexing markdown vaults (notes, headings, links) as well. ## Source & Thanks > Source: https://github.com/nikolai-vysotskyi/trace-mcp > License: MIT > GitHub stars: 69 · forks: 7 --- ## 快速使用 1. 安装 / 运行: ```bash npm install -g trace-mcp ``` 2. 启动 / 冒烟测试: ```bash trace-mcp init && trace-mcp add ``` 3. 验证: - Connect from your MCP client and ask for detected frameworks/project map, then request context for a small task. ## 简介 将代码库/知识库索引为可复用的项目地图与任务上下文,通过 MCP 按需提供给 AI agent;提供 CLI 初始化并注册到 Claude Code、Cursor 等客户端,更适合长期复用。 - **适合谁:** 希望减少反复扫描仓库、让上下文可复用且更确定的团队 - **可搭配:** Node.js CLI + MCP 客户端;代码库与 Markdown 知识库(以仓库文档为准) - **准备时间:** 12 分钟 ## 实战建议 - 跑通约 12 分钟(npm 安装 + init + add 项目) - GitHub stars + forks(已核验):见「来源与感谢」 - 首次接入核心就两条命令(`init`、`add`) 把它当作 agent 推理的“结构化缓存”:先用 CLI 索引并注册项目,然后通过 MCP 工具按需拉取项目地图、变更影响与任务上下文,而不是每次都把同一批文件塞进 prompt。 ### FAQ **最大收益是什么?** A: 把“仓库地图/上下文”一次性结构化,后续任务按需取用,减少反复扫描与 token 浪费。 **会往仓库里写很多东西吗?** A: 仓库文档描述状态主要放在用户目录下;除非你选择启用忽略文件等可选配置。 **只适用于代码吗?** A: 不止。文档还描述了对 Markdown 知识库的索引与引用(标题、链接、标签等)。 ## 来源与感谢 > Source: https://github.com/nikolai-vysotskyi/trace-mcp > License: MIT > GitHub stars: 69 · forks: 7 --- Source: https://tokrepo.com/en/workflows/trace-mcp-project-tracing-mcp-for-agents Author: MCP Hub