
Trail-Code MCP Server: Setup for Claude Code, Cursor and Other Apps
Gives Claude Code, Cursor, Codex and other coding agents a map of your codebase, so they find the right files without searching blind.
Trail-Code builds an index of your code on your own machine: every function and what calls it. Its MCP server lets your assistant search that index instead of opening file after file. The project was called graft before, and the old tool names still work. The MCP server is one part of a larger command line tool that also saves team learnings, so you can use the six tools without the rest.
Good for
- Developers who work in large or unfamiliar repos
- Claude Code, Cursor and Codex users who want fewer wasted file reads
- Teams that want to see what a change might break before the pull request
Works in
12 should work
Tap an app to see how to set it up and any known problems.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Client does not support this transport.
Client does not support this transport.
Install Trail-Code MCP
Claude Code
- 1
Copy this prompt.
Add the Trail-Code MCP server to Claude Code. Run this command: claude mcp add trail -- npx -y @trailhq/trail-code mcp Then check that it loaded and tell me if I need to sign in or restart.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js 22.3+.
This registers only the MCP server, using the same command the README shows for hand registration. The README recommends installing the full tool and running its init command in your repo, which sets up several agents at once. Trail needs Node 22.3 or newer. Restart your app after adding it.
Built from the package data we hold. Not yet tested by us.
Tools
Finds the code that answers a question about your project
Takes a question in plain words and returns the best-matching functions with file and line numbers and the source included. The README says it is usually the full answer, with no follow-up read needed.
Try: “Where do we handle failed payment retries?”
Files ·
trail_find_codeLists every function in a file without the code inside
Returns the signatures in one file with no function bodies, so the assistant sees what a file offers using about a tenth of the tokens.
Try: “Show me what src/billing/invoice.ts exposes.”
Files ·
trail_file_apiShows what calls a function, or what it calls
Follows the call graph from a symbol, up to a number of levels deep, to show what a change could break. You can also trace what a function depends on.
Try: “What breaks if I change calculateTax?”
Files ·
trail_trace_callsFinds every match for a pattern, grouped by function
Searches the code for a regular expression and groups every hit by the function around it, ranked by how connected that function is.
Try: “Find every place that reads process.env.STRIPE_KEY.”
Files ·
trail_find_allGives a first overview of an unfamiliar repo
Returns the main folders, the most connected files and the busiest areas of a repo, so the assistant can orient itself.
Try: “Give me a map of this repo before we start.”
Files ·
trail_repo_mapChecks whether the code map is out of date
Reports whether the local map has drifted from the current code.
Try: “Is the code map up to date?”
Files ·
trail_check_freshness
Read from the source code
Permissions
low risk · 4 things to watch
Low risk
The six tools only read your code and a local index of it, and the index is built on your machine with no model or API key. The wider Trail-Code command line tool can also edit agent settings and send anonymous usage stats, so run only the MCP server if you want the narrow setup.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
The full CLI changes more than the MCP server
The init command writes hooks, a statusline and instruction files for your agents. Register only the MCP server by hand if you want just the six tools. github.com
It sends anonymous usage stats unless you opt out
The README says the ping carries buckets and fixed labels only, never code, paths or queries. Set DO_NOT_TRACK=1 to turn it off, along with the daily version check. github.com
Optional deep summaries use a model provider
The optional deep build sends summaries to the model provider you choose, under your own key. The six MCP tools do not need it. github.com
Queries refresh a local code map on disk
Before it answers, the server re-checks the project and rebuilds its local code map if files changed, which writes to the project's graph folder. The README says this refresh is structural and never calls a model. github.com
Security advisories
No published security advisories as of Nov 1, 2026.
Technical details
| Turning on read-only | Not needed for the six MCP tools, which only read. The separate init command writes files to your repo and agent settings. |
|---|---|
| Talks to | Anonymous usage stats and a daily version check, which DO_NOT_TRACK=1 turns off |
| Sign-in and keys | No account or API key is needed for the MCP server. |
Questions
Do I have to run the full Trail-Code setup?
No. The README gives a one-line config that runs only the MCP server. The full init command also wires hooks and instruction files into your agents, which is optional.
Does it need an API key or an account?
No. The code map is built on your machine with no model and no key. A Trail workspace is optional, and nothing is shared with Trail until you connect one.
Does my code leave my machine?
The README says the code map is built locally with no model and no network. Only the optional deep summaries go to a model provider you choose, and anonymous usage stats are sent unless you opt out.
What happened to graft?
Graft is now Trail-Code. The README says every graft command still works, and the MCP server still answers the old graft tool names.
Which apps does it work with?
The README covers Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and others, with the deepest setup for Claude Code. Use the install box above.
Is it free?
Yes. The package is MIT licensed and the MCP server needs no account or key. Connecting a Trail workspace is optional.
Is it official?
It is the Trail team's own MCP server, shipped inside the trailhq/trail-code package. It is not made by Anthropic, Cursor or OpenAI.
Information
updated Nov 2, 2026
- Publisher
- Community
- Package
@trailhq/trail-code- Registry
- npm
- Transport
- stdio
- Auth
- None
- Version
- 0.28.1
- License
- MIT
- Last commit
- Oct 31, 2026
- Open issues
- 140
Sources
Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.
Show all 2Hide
- github.com · github.com
- github.com · github.com