Thruline + Cursor
Cursor is one of the most widely adopted AI editors, and its agent is one of the most prolific code generators on most teams. Thruline plugs into Cursor through Model Context Protocol so the agent stops guessing your codebase from filenames and starts writing code that fits.
What you get
- Architecture-aware suggestions. Cursor's agent consults Thruline for the domain a file belongs to, the conventions in that domain, and which other files historically change with it.
- Pre-commit changeset checks. Ask Cursor to run
thruline_review_changeseton your changed files before you push. Missing co-changes get caught locally instead of in PR review. - Lower token usage. Cursor's agent stops grepping aimlessly through your repo to find context. One Thruline call returns a structured answer.
- No platform lock-in. The same Thruline that powers Cursor also powers Claude Code, Windsurf, VS Code, and Zed — switch editors without losing the codebase intelligence layer.
Setup
1. Add the MCP server
Open Cursor Settings › MCP and add a new server with this configuration:
{
"mcpServers": {
"thruline": {
"url": "https://mcp.thrulinecontext.com/mcp"
}
}
}
Alternatively, drop the same JSON in .cursor/mcp.json at your project root if you want the config to travel with the repo.
2. Authenticate
The first time Cursor connects to Thruline, it'll prompt you to authenticate via GitHub OAuth. Sign in with the GitHub account you used for Thruline.
3. Index your repository
Ask Cursor's agent to index your repo:
"Index this repo with Thruline — it's owner/repo-name."
Indexing takes 1–3 minutes. After that, indexing is incremental and stays current as commits land.
4. Use it naturally
Cursor's agent reads Thruline's MCP tool descriptions and decides when to call them. You don't have to prompt it specially — though if you want to nudge it, you can:
- "Use thruline_review on this file before making changes."
- "Run thruline_review_changeset on my changed files."
- "What domains does Thruline see in this codebase?"
Tools available to Cursor
| Tool | Purpose |
|---|---|
thruline_index | Index a repository for the first time, or re-index after major changes |
thruline_review | Get domain, conventions, connected files, and git history for a specific file |
thruline_review_changeset | Check changed files for missing co-changes and convention violations |
thruline_get_domains | List all architectural domains discovered in the repository |
thruline_get_segments | List code segments with their conventions and file summaries |
thruline_get_network | Get the domain connection graph showing how areas of the codebase relate |
thruline_get_findings | Retrieve commit and domain activity for a repository |
thruline_report_findings | Report findings so Thruline can refine its connection weights |
Tips for Cursor users
Keep .cursor/mcp.json in source control.
If you check the file into your repo, every developer who clones it gets Thruline wired up automatically. They authenticate once and they're done.
Combine Thruline with Cursor's repo indexing.
Cursor's own context engine handles file-level retrieval, while Thruline handles domain-level architecture. They cover different layers and don't conflict.
Train the network as you go.
When you ask Cursor to review code, ask it to call thruline_report_findings with what it found. Each call strengthens or weakens connection weights, so the system gets sharper for your repo over time.
Troubleshooting
- MCP server not showing up — restart Cursor after adding the config. Cursor reads MCP servers on startup.
- Authentication loop — clear the OAuth session in Thruline's dashboard and reconnect from Cursor.
- Repository not indexed — ask Cursor to call
thruline_indexwith your repo name inowner/repoformat.