Set Up Forge with Cursor
import { Aside, Tabs, TabItem } from ‘@astrojs/starlight/components’;
Cursor supports MCP servers in its AI features. Forge connects as a local MCP server, giving Cursor’s AI access to the same 21 code intelligence tools available in Claude Code. The config format is nearly identical — only the file location differs.
Prerequisites
Section titled “Prerequisites”- Forge installed and on your PATH (
forge --versionreturns a version string) - At least one repo indexed (
forge index /path/to/repo) - Cursor installed (version 0.40 or later — MCP support was added in 0.40)
If you haven’t installed Forge yet, see Install Forge.
Add Forge to .cursor/mcp.json
Section titled “Add Forge to .cursor/mcp.json”Cursor looks for MCP server configuration in .cursor/mcp.json in the project root.
Create .cursor/mcp.json in your project root:
{ "mcpServers": { "forge": { "command": "forge", "args": ["serve", ".", "--watch"], "env": {} } }}Cursor resolves . relative to the project root where .cursor/mcp.json lives. Commit this file alongside your code so every developer on the team gets Forge automatically.
Cursor also supports a user-level MCP config at ~/.cursor/mcp.json:
{ "mcpServers": { "forge": { "command": "forge", "args": ["serve", "/absolute/path/to/your/repo", "--watch"], "env": {} } }}Use an absolute path for user-global config. This makes Forge available in every Cursor project, always pointing at the same repo. For per-project configuration, prefer the project-local approach above.
Restart Cursor
Section titled “Restart Cursor”After creating or editing .cursor/mcp.json, reload the Cursor window (Ctrl+Shift+P → “Developer: Reload Window” or restart Cursor). MCP server configs are loaded at startup.
Verify the connection
Section titled “Verify the connection”Open Cursor’s AI chat and ask:
What MCP tools do you have access to?
Expected response includes:
I have access to Forge MCP tools, including:- forge_prepare- forge_validate- forge_understand- forge_search- forge_pattern_search- forge_search_symbols- forge_trace_imports- forge_trace_dependents- forge_check_wiring- forge_find_cycles- forge_dependency_graph... (21 tools total)Then test with a real question:
Use forge_trace_dependents on src/index.ts and tell me what depends on it.
If Forge is connected, Cursor’s AI calls the tool and returns a structured list of files that import src/index.ts.
Enable MCP in Cursor settings
Section titled “Enable MCP in Cursor settings”Some Cursor versions require explicitly enabling MCP in settings. If tools don’t appear after reloading:
- Open Cursor Settings (Ctrl+,)
- Search for “MCP”
- Enable “Model Context Protocol (MCP) servers”
- Reload the window
Common pitfalls
Section titled “Common pitfalls”.cursor/mcp.json not found
Cursor only looks for this file in the workspace root. If you opened a sub-folder as the workspace root rather than the repo root, create .cursor/mcp.json in the folder you opened.
MCP tools visible but Forge returns errors
Run forge index . in the repo root to ensure an index exists for the path you passed to forge serve. If you used an absolute path in the config, verify the index was built for that same path.
Cursor’s AI doesn’t call Forge tools automatically Unlike Claude Code, Cursor doesn’t receive Forge’s behavioral system prompt injection in all configurations. You may need to explicitly ask Cursor to use Forge tools: “Use forge_prepare on this file before we edit it.”
PATH issues on macOS
If Cursor was launched from the dock (not a terminal), it may not inherit your shell’s PATH. Use the absolute path to the forge binary in the config:
{ "mcpServers": { "forge": { "command": "/usr/local/bin/forge", "args": ["serve", ".", "--watch"], "env": {} } }}Run which forge in your terminal to find the absolute path.