Run the local MCP package

Give your AI editor offline tools that map your codebase, with the @rectify-so/mcp package, and optionally read-only Rectify data.

5 min readUpdated 24 days ago
Before you start. You need Node.js 18 or newer, and an AI editor or CLI that runs local MCP servers, such as Cursor, Claude Code, VS Code or Claude Desktop. The repository tools work without a Rectify account. Adding Rectify data needs an MCP key, which needs the Build plan or higher.
The local package, @rectify-so/mcp, runs on your computer next to your editor. It indexes your repository so your AI assistant can see how files and functions connect, what a change would affect and which tests cover it. Your code stays on your machine and is never sent to Rectify.
It's separate from the hosted server. For everything Rectify can do, connect the hosted server as well, as Connect an AI app to Rectify over MCP shows.
Add it to your editor
The MCP Server page shows these steps too. Open Project settings, MCP server, select your app, and look for Add the local package.
Add the local package and Index once, in the Cursor panel on the MCP Server page.
Add the local package and Index once, in the Cursor panel on the MCP Server page.
Cursor
Paste this into .cursor/mcp.json inside your repository:
JSON
{
  "mcpServers": {
    "rectify-repo": {
      "command": "npx",
      "args": ["-y", "@rectify-so/mcp"]
    }
  }
}
Claude Code
Run this from the repository you want indexed:
Bash
claude mcp add rectify-repo -- npx -y @rectify-so/mcp
VS Code
Paste this into .vscode/mcp.json inside your repository:
JSON
{
  "servers": {
    "rectify-repo": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@rectify-so/mcp"]
    }
  }
}
Claude Desktop, Windsurf and other editors
These don't start inside your repository, so tell the package where it is with --repo and an absolute path:
JSON
{
  "mcpServers": {
    "rectify-repo": {
      "command": "npx",
      "args": ["-y", "@rectify-so/mcp", "--repo", "/absolute/path/to/your/repo"]
    }
  }
}
For Claude Desktop, the file is ~/Library/Application Support/Claude/claude_desktop_config.json on a Mac, or %APPDATA%\Claude\claude_desktop_config.json on Windows. Restart Claude Desktop after you save it. For Windsurf, it's ~/.codeium/windsurf/mcp_config.json.
Index your repository
1.
Add .rectify/ to your .gitignore. The index lives there.
2.
Ask your assistant to run update_memory.
3.
Run it again after big changes. It only reads files that changed since last time.
The index is a file at .rectify/repo-graph.json in your repository.
The tools
ToolWhat it does
update_memoryBuilds or refreshes the index. Takes an optional list of paths.
repository_overviewCounts files and symbols, lists languages, the main modules and the most connected files.
architectural_summaryModules by folder, their key files and how they import each other.
trace_dependenciesWhat a file or symbol depends on, what depends on it, or both.
find_related_filesFiles linked to a file or symbol through imports and calls.
analyze_impactWhat a change to a file or symbol would affect, including tests.
search_memoryFinds files and symbols by name.
Only update_memory writes anything, and only to the index file.
What gets indexed
•
Languages: TypeScript and JavaScript (.ts, .tsx, .js, .jsx, .mjs, .cjs, .mts, .cts) and Python (.py, .pyi).
•
Skipped folders: .git, node_modules, dist, build, out, coverage, .next, .turbo, .cache, .venv, venv, __pycache__ and .rectify.
•
Skipped files: minified and bundled files, .d.ts files, files over 1.5 MB, and symbolic links.
•
Anything in the .gitignore at the root of your repository.
•
Anything in a .rectifyignore file at the root, written the same way as .gitignore.
In JavaScript and TypeScript, imports that start with ./ or ../ are linked. Path aliases and package imports aren't.
Options
OptionWhat it does
--repo <path>The repository to index. The default is the folder the editor starts the package in.
--token <key>Your MCP key. Adds read-only Rectify data, below.
Add Rectify data
With a key, the package also reads your project's feedback, code scans and monitoring. It can't change anything in Rectify.
1.
Create a key on the MCP Server page, as Manage MCP keys and connected apps shows.
2.
Add --token and the key, exactly as you copied it, to the arguments.
JSON
{
  "mcpServers": {
    "rectify": {
      "command": "npx",
      "args": ["-y", "@rectify-so/mcp", "--token", "mcp_xxx:your_user_id"]
    }
  }
}
The key must be in the form mcp_xxx:your_user_id, which is how Copy your key gives it to you. This config file now holds your key, so keep it out of git.
With a key, your assistant gets one more tool, rectify-feedback-session-url-analyze, which analyses the recorded session of a feedback report. It can also read:
•
Feedback: the list, an overview, and a report's session analysis.
•
Code Scan: the latest scan, issues, issues by file, metrics and history.
•
Monitoring: an overview, monitors and their stats, incidents, and incident, slowest-monitor and lowest-uptime reports.
Your code and privacy
•
The package never sends your code to Rectify. It only contacts Rectify when you pass a key, to read your Rectify data.
•
Tool results go to your AI assistant, like any file it reads. They include file paths, names of functions and classes, and the first line of each.
•
The index file holds the same details, which is why it belongs in .gitignore.
Check it worked
Ask your assistant to run repository_overview. After indexing, it lists your languages and main modules. To check the tools, list them from your editor: you'll see 7 tools, or 8 with a key.
Troubleshooting
The tools return "Repository not indexed yet"
Ask the assistant to run update_memory first. Check that --repo points at the right folder, or that your editor starts the package inside the repository.
"Invalid token format. Expected format: mcp_xxx:userId"
Copy the key again from Copy your key, including the colon and your user ID after it. If you lost it, create a new key.
The key doesn't work, but the repository tools do
The package keeps running with only the repository tools when it can't use your key. Check the key is Active on the MCP Server page, that it's yours, and that your computer can reach api.rectify.so.
My editor doesn't connect
Restart the editor after changing its MCP settings. Check that node --version shows 18 or newer.

Was this helpful?

Your feedback shapes what we write next.

Related articles