Large Codebases
Context strategies for repos too big to fit in a window — the prerequisite skill for any monorepo. See Working with Large Codebases.
A security advisory drops for your auth library. It lives in @company/core, and 23 services across a 47-package monorepo import it. You need to know exactly which packages break, in what order they rebuild, and which teams to ping. Open the wrong file first and you spend the afternoon chasing transitive imports that a project graph could have answered in seconds.
Out of the box, AI assistants treat your monorepo as a pile of files. They have no idea that web-app depends on @company/ui, which depends on @company/core. The fix is a project-graph MCP server (Nx Console is the most mature) that hands the model your dependency graph, generator schemas, and task cache as structured context. Once that’s wired up, “what breaks if I change this?” becomes a query, not a manual audit.
nx.json/turbo.json task graphs into concrete parallelization winsuvx missing, the MCP server failing to startThe Nx MCP server (nx-mcp) is the most capable monorepo integration today. It exposes your project graph, generator schemas, and Nx docs as tools the model can call. Setup is nearly identical across all three tools — the only real difference is the command you run.
Install the Nx Console extension. In an Nx workspace, Cursor (0.46+) auto-detects it and shows a notification offering to enable the Nx MCP server. Accept it, and Nx Console writes a .cursor/mcp.json entry for you.
To wire it up manually, run nx.configureMcpServer from the command palette (Cmd/Ctrl+Shift+P), or add the entry yourself:
{ "mcpServers": { "nx": { "command": "npx", "args": ["-y", "nx-mcp"] } }}Confirm it under Cursor Settings → MCP — you should see nx listed with a green dot.
Add it as a stdio server from the repo root. Use --scope project so the config is written to a shared .mcp.json rather than the default local scope (which lives in ~/.claude.json under your project path and is private to you). The --scope flag must come before the server name and the --:
claude mcp add nx --scope project -- npx -y nx-mcpVerify it registered and is reachable:
claude mcp listWith --scope project, the config lands in .mcp.json. Commit that file so the whole team gets the same graph-aware setup.
Register the same stdio server. Codex stores it in ~/.codex/config.toml:
codex mcp add nx -- npx -y nx-mcpcodex mcp listFor larger workspaces, give the server more startup headroom in ~/.codex/config.toml:
[mcp_servers.nx]command = "npx"args = ["-y", "nx-mcp"]startup_timeout_sec = 30Two more servers round out a monorepo setup. Note the launchers differ: the official filesystem server is a Node package run via npx, while the git server is Python-only and runs via uvx (install uv first). There is no @modelcontextprotocol/server-git on npm — that package does not exist.
{ "mcpServers": { "git": { "command": "uvx", "args": ["mcp-server-git", "--repository", "/path/to/monorepo"] }, "fs": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/monorepo"] } }}claude mcp add git -- uvx mcp-server-git --repository /path/to/monorepoclaude mcp add fs -- npx -y @modelcontextprotocol/server-filesystem /path/to/monorepocodex mcp add git -- uvx mcp-server-git --repository /path/to/monorepocodex mcp add fs -- npx -y @modelcontextprotocol/server-filesystem /path/to/monorepoScoping the filesystem server to the monorepo root keeps bulk operations inside your workspace and out of the rest of your disk.
The single highest-value monorepo move is asking the model what breaks before editing. With the Nx MCP active, the model calls nx_workspace and nx_project_details instead of guessing from import statements.
With real graph context, you get back something you can act on rather than a guess:
Useris imported by 8 packages. Addingstatusas optional is non-breaking at the type level. The packages that render user data and should be updated to show status:UserCard(web-app),UserProfile(mobile-app),UserList(admin-dashboard). Rebuild order:@company/core→@company/ui→ web-app, mobile-app, admin-dashboard.
That checklist is the difference between a controlled change and an afternoon of grep. The model read your actual graph, so the rebuild order and the “optional means non-breaking” call are grounded, not invented.
Once you trust impact analysis, the same graph awareness drives coordinated edits. The workflow is the same across all three tools — the model proposes the plan, you approve it, then it executes package by package — so the difference is only in how you drive each tool. Cursor’s agent mode applies edits inline with checkpoints; Claude Code runs in the terminal and can chain into hooks or CI; Codex can fan the work out to background worktrees or the cloud.
Get the plan first. Run the impact prompt above so you have the affected-package checklist in dependency order.
Refactor in graph order. Ask the model to work bottom-up so each package compiles before its dependents change:
Verify with the build graph. Run only what changed — npx nx affected -t build test lint — and feed any failures back to the model with the package name and error.
Slow CI is usually a task-graph problem, not a hardware problem. The Nx MCP lets the model read your actual nx.json and project configs instead of giving generic advice.
A graph-aware model gives you specifics you can paste into a PR:
Your
web-app:builddeclares a dependency onmobile-app:build, but nothing in web-app imports mobile-app. Removing that edge lets the two apps build in parallel — roughly 40% off the critical path. Separately, yourtesttarget’sinputsinclude**/*.md, so doc edits bust the test cache. Narrow it to["default", "^default"].
For Turborepo, the same pattern applies to turbo.json — ask the model to audit inputs, outputs, and dependsOn — but you’ll feed it the file contents directly rather than through an MCP tool until an official server ships.
Multi-package releases are where dependency order bites hardest: ship @company/payments before the @company/core it depends on and you publish a broken version. Pair the git MCP (commit history) with the Nx MCP (dependency order) for this.
Graph-aware tooling fails in a handful of predictable ways. Recognize them fast:
claude mcp list (or codex mcp list) — a server stuck in “failed” usually means the launcher binary is missing. For nx-mcp and the filesystem server you need Node/npx on PATH; for the git server you need uv/uvx. Install uv if uvx is “command not found”.@modelcontextprotocol/server-git and got a 404. That package isn’t on npm — the git server is Python-only. Use uvx mcp-server-git --repository /path instead.nx.json lives. If the model says “no Nx workspace detected”, restart it from the repo root.npx nx reset to clear the Nx cache, then ask the model to re-read the graph before trusting a new impact report.nx affected --base=main), and bump startup_timeout_sec for the server if it’s timing out on first call.Monorepo migrations are slow and parallelizable, which makes them a fit for Codex’s multi-surface model. Codex runs background tasks in dedicated git worktrees so a long refactor doesn’t tie up your working tree. Kick off a cloud task per package group, then pull the results locally:
# Browse or run cloud tasks from the terminalcodex cloud
# Apply a completed cloud task's diff to your local treecodex applyThis lets you fan a “migrate package group A to the new API” task out to the cloud while you keep editing locally, then review each diff with codex apply before it lands.
Large Codebases
Context strategies for repos too big to fit in a window — the prerequisite skill for any monorepo. See Working with Large Codebases.
Microservices
Coordinate changes across service boundaries with the same graph-first mindset. See Microservices Workflows.
Code Quality at Scale
Keep linting, types, and tests consistent across every package. See Code Quality Workflows.
MCP Ecosystem
Go deeper on configuring and combining MCP servers across all three tools. See the MCP Ecosystem guides.