Integrations · Cursor · Good tier
Cursor MCP server for full codebase context.
Install repowise, index the repository and run repowise agents add --target=cursor. Cursor gets a project MCP server in .cursor/mcp.json with 10 tools over the code graph, git history, decisions and health, an always-on rule in .cursor/rules/repowise.mdc, and a preToolUse hook that compresses noisy shell output. No API key is needed.
uv tool install repowise
repowise init --yes --no-prose
repowise agents add --target=cursorHow do I give Cursor full context of a large codebase?
Cursor indexes the folders you have open for semantic search, and its agent reads rules and the files you mention. That finds code that looks like your question. It does not tell the agent what imports a file, how often the file broke, who owns it, or which decision explains it.
repowise computes those once, locally and without a model, and serves them over MCP. In Cursor's agent, get_risk on a file returns its dependents, co-change partners, bug-fix history and the tests that reach it; get_context returns a triage card instead of the whole file; get_why returns the decision behind a pattern. The rule repowise writes is always applied, so the agent hears about the tools in every chat.
Is there a Cursor MCP server for codebase context?
Yes. repowise writes this entry to .cursor/mcp.json: type "stdio" (Cursor requires the field), command repowise, args mcp, the absolute repository path and --transport stdio. The path is absolute because Cursor starts MCP servers outside the workspace folder. It serves the 10 repowise MCP tools.
An existing remote entry named repowise, such as the hosted URL, is left untouched.
Setup
Set up repowise for Cursor
Python 3.11 or later and git. repowise init also wires Cursor on its own when it finds .cursor/ in the repository or ~/.cursor on the machine; the explicit command below works either way.
- 01
Install the repowise CLI
With uv, pipx or pip.
uv tool install repowise - 02
Index the repository
From the repository root, with no API key and no model calls.
repowise init --yes --no-prose - 03
Wire Cursor
Writes the project MCP entry and rule, and the user-level hook. Add --scope project to keep everything inside the repository.
repowise agents add --target=cursor - 04
Reload Cursor and check the server
Open Cursor's MCP settings, check that repowise is listed and enabled, then ask the agent for a tour of the codebase. It should call get_overview.
What it writes
The files repowise writes
Project files can be committed so the whole team gets them; the MCP entry uses the bare repowise command for that reason. repowise agents remove --target=cursor removes everything listed here.
| File | Scope | What goes in it |
|---|---|---|
.cursor/mcp.json | Project | mcpServers.repowise with type stdio, command repowise and args mcp <repo path> --transport stdio. |
.cursor/rules/repowise.mdc | Project | A rule with alwaysApply: true. Its managed block tells the agent to run noisy commands through repowise distill, to use repowise expand instead of re-running, and to ask get_context for a large file's skeleton. |
~/.cursor/hooks.json | User | A preToolUse hook on Shell that runs repowise-rewrite --agent cursor with a 5-second timeout. Command families you set to allow are rewritten to repowise distill <cmd>; others pass through. |
~/.cursor/hooks.json (afterFileEdit) | User | Opt-in, only when attribution.capture is on: records which edits Cursor's agent made. |
AGENTS.md | Project | Written by repowise init: architecture, key modules, entry points, the files that need care and the tool routing. Cursor reads AGENTS.md alongside its rules. |
MCP tools
The 10 MCP tools, and when the agent calls each
Cursor's agent picks MCP tools from their descriptions, the rule and AGENTS.md. The tools are available in agent chats once the server is enabled.
| Tool | What it returns | When the agent calls it |
|---|---|---|
get_answer | One-call cited Q&A over the documentation, with a calibrated confidence score. | A how, where or why question, answered once with citations instead of a chain of greps. |
get_context | A triage card for files, modules, or symbols: summary, signatures, hotspot bit, governing decisions. | Before opening a file, or with include=["references"] before a rename, to get every caller. |
get_symbol | Raw source bytes for one indexed symbol with exact, verified line bounds. | When it needs one function's exact lines instead of the whole file. |
search_codebase | Hybrid full-text and semantic search over the documentation, routed by query shape. | To find a concept, a path or an identifier when it does not know the file name. |
get_why | Architectural decision archaeology: why the code is shaped this way, with lineage. | Before changing an established pattern: the decision behind it, or git archaeology when none is recorded. |
get_risk | Hotspot score, dependents, co-change partners, and PR-mode break/test directives. | Before editing a file: what depends on it, how often it broke, which tests reach it. |
get_change_risk | Pre-merge defect-risk score for a commit or diff range, computed from its shape alone. | Before finishing a multi-file change, on base..HEAD or uncommitted work. |
get_health | Per-file code-health scores across three pillars, plus ranked refactoring targets. | On the files it touched, or to pick refactoring targets from the fix-first queue. |
get_dead_code | Unreachable files, unused exports, and zombie packages, tiered by confidence. | On a cleanup task: unreachable files, unused exports and zombie packages, by confidence tier. |
get_overview | Architecture map, module list, entry points, and tool recipes. First call on any repo. | First call on a repository it has not seen: modules, entry points, layers and the riskiest files. |
Comparison
What Cursor already does, and what repowise adds
Cursor's own context features are good at the open workspace. repowise adds what lives outside the files.
What it does well
- Codebase indexing
- Cursor embeds the open folders for semantic search. It finds similar code fast, and repowise adds history and ownership next to it.
- Rules and AGENTS.md
- Project rules in .cursor/rules and AGENTS.md carry conventions. repowise writes one always-applied rule and a managed AGENTS.md section.
- @-mentions
- You can point the agent at files and folders by hand. repowise lets it find the right ones from the graph.
- Bugbot
- Cursor's pull request reviewer reads the diff. repowise's bot and get_change_risk add the repository's history to the same question.
What repowise adds
- The graph
- Imports and calls resolved per language, so the agent sees every caller of what it edits.
- History
- Hotspots, bug magnets, co-change partners and owners from git, without a model.
- Decisions
- get_why returns the record behind a pattern, or git archaeology when none exists.
- Health and dead code
- Per-file scores from 59 deterministic detectors, and unreachable code by confidence tier.
- Distill in the agent's shell
- Cursor runs a repowise hook: noisy commands are compressed before the agent reads them.
Multi-repo
Context across several repositories
For several repositories, run repowise init . in the parent folder. It finds the git repos up to three levels down, indexes each one, links them through HTTP, gRPC, topic and OpenAPI contracts and cross-repo co-change history, and registers one MCP server that answers for all of them. The workspace server adds list_repos to the 10 MCP tools, and every tool takes a repo argument, or a target written as alias:path. --tools +name adds get_blast_radius, get_architecture and get_conformance for cross-repo impact.
Cursor's index covers the folders you have open. A repowise workspace also links repositories you do not have open, through contracts and co-change history.
On hosted repowise, one URL answers across a workspace: https://api.repowise.dev/mcp/w/{workspace_id}, with the same API key as the per-repo URL. That shape needs Pro, Teams or Admin.
Tokens
Token use on a large repository
The distill hook compresses noisy shell output before Cursor's agent reads it. repowise distill, measured with the CLI one command at a time: 89% fewer tokens on git log -50 and 61% on a pytest run with 11 failures, with all 11 failure lines kept. Anything cut is restored with repowise expand.
The MCP tools save reads: a triage card instead of a whole file, one symbol's lines instead of the module. In the paired agent-loop benchmark on Codex and Claude Code, the same tools cut output tokens and tool calls.
Code review
Review a change, then fix what the bot finds
Before you commit, ask Cursor's agent to run get_change_risk on the uncommitted work. It scores the change against the repository's commit history and lists the files that usually change with these but are missing, and the tests that reach the diff.
The repowise PR bot is a GitHub App. On a pull request it stays silent unless a signal fires: files that usually change together but are missing from the diff, tests that import the changed files, a health drop. Its verdict is the Repowise review check run. The optional AI review on Pro attaches a prompt for your agent to each finding, and the pull request page on repowise.dev has a Copy fix prompt for your agent button. On GitLab, Azure DevOps and Bitbucket there is no bot; indexing and the CI gates (patch coverage, doc drift, new secrets, change risk) still work.
To fix a finding, copy its prompt and paste it into Cursor's agent. The prompt names the files and the finding.
Hosted
The remote MCP endpoint
Hosted repowise serves the same tools over Streamable HTTP at https://api.repowise.dev/mcp/{owner}/{repo}, with an API key from Settings, Coding agents (MCP). The per-repo URL works on every plan, Free included (10 answers a month on Free). Claude on the web and desktop connects with a custom connector and sign-in, and ChatGPT takes the same MCP address. For Cursor, paste the entry below into ~/.cursor/mcp.json or the project's .cursor/mcp.json and restart Cursor.
.cursor/mcp.json (hosted)
{
"mcpServers": {
"repowise": {
"url": "https://api.repowise.dev/mcp/OWNER/REPO",
"headers": { "Authorization": "Bearer YOUR_API_KEY" }
}
}
}Enterprise
Consistent agent context across an organization
The same context in every repository
A workspace indexes many repositories into one MCP server, so every engineer's agent gets the same graph, history and decisions, whichever agent they use.
Self-hosted
The CLI, the MCP server and the dashboard run on your machines. The analysis makes no model calls and needs no account.
Your own model keys
Prose and answers use the provider you configure: Anthropic, OpenAI, Gemini, OpenRouter, DeepSeek, Kimi, Eden AI, any LiteLLM route, or Ollama. Agent CLIs (Claude Code, Codex, OpenCode, Copilot CLI) can be the writer instead.
Air-gapped
repowise init --yes --no-prose needs no API key. Ollama covers prose and embeddings offline, and repowise grammars fetch stages the COBOL and Apex grammars before the network is cut.
Governance
The commercial license adds SSO, RBAC, audit, on-prem and air-gapped support with an SLA, on top of the AGPL-3.0 core.
Questions
What people ask before they try it.
Why does the repowise entry in .cursor/mcp.json have an absolute path?
Cursor launches MCP servers with a working directory outside the workspace, so the server could not find the repository from its cwd. The absolute path in args points it at the right index.
Does the hook rewrite every shell command?
No. It only rewrites command families whose permission is set to allow, such as test runs, builds and git log or diff. Others run unchanged, and the exit code is always preserved.
Do I still need Cursor's codebase indexing?
Keep it. Semantic search over the open files and repowise's graph and history answer different questions, and the agent uses whichever fits.
Does it work with Cursor's agent in background or cloud mode?
The local stdio server needs the repository and the .repowise index on the same machine. For remote agents, use the hosted URL with an API key.
Does repowise send my code anywhere?
Not for the analysis. The graph, history, health and dead code are computed locally with no model call. Prose and get_answer use a model only if you configure one, under your own key.
How do I remove it?
repowise agents remove --target=cursor removes the MCP entry, the rule and the hooks. repowise uninstall removes every agent at once.
Last reviewed: November 2026
Get started
Give your agent the repository.
Index a repository locally in one command, or index a public one free on repowise.dev and connect over a URL.