Monorepos provide an ideal foundation for AI-powered development, enabling cross-project reasoning and code generation. However, without proper context, LLMs struggle to understand your workspace architecture, seeing only individual files rather than the complete picture.
Nx's transforms your AI assistant by providing rich workspace metadata that enables it to:
- Understand your workspace architecture and project relationships
- Identify project owners and team responsibilities
- Access Nx documentation for accurate guidance
- Leverage code generators for consistent scaffolding
- Connect to your CI pipeline to help fix failures
The goal is to transform your AI assistant from a generic code helper into an architecturally-aware collaborator that understands your specific workspace structure and can make intelligent, context-aware decisions.
How Nx MCP Enhances Your LLM
Section titled “How Nx MCP Enhances Your LLM”The Model Context Protocol (MCP) is an open standard that enables AI models to interact with your development environment through a standardized interface. Nx implements an MCP server via the Nx Console that exposes workspace metadata to compatible AI assistants like GitHub Copilot, Claude, and others.
With the Nx MCP server, your AI assistant gains a "map" of your entire system being able to go from just reasoning at the file level to seeing the more high level picture. This allows the LLM to move between different abstraction levels - from high-level architecture down to specific implementation details:
These are some of the available tools which the Nx MCP server exposes:
nx_workspace
: Provides a comprehensive view of your Nx configuration and project graphnx_project_details
: Returns detailed configuration for specific projectsnx_docs
: Retrieves relevant documentation based on queriesnx_generators
: Lists available code generators in your workspacenx_generator_schema
: Provides detailed schema information for generatorsnx_visualize_graph
: Opens interactive project or task graph visualizationsnx_cloud_cipe_details
: Returns information about CI pipelines from Nx Cloudnx_cloud_fix_cipe_failure
: Provides detailed information about CI failures to help fix issues
Setting Up Nx MCP
Section titled “Setting Up Nx MCP”The Nx MCP server is part of Nx Console and can be easily configured in supported editors:
VS Code Setup
Section titled “VS Code Setup”For VS Code users, the MCP is configured completely automatically via the Nx Console extension:
- Install Nx Console from the marketplace
- The MCP server is automatically configured - no additional setup needed!
Cursor / JetBrains Setup
Section titled “Cursor / JetBrains Setup”For Cursor and JetBrains IDE users:
- Install Nx Console from the marketplace
- You'll receive a notification to "Improve Copilot/AI agent with Nx-specific context"
- Click "Yes" to configure the MCP server
If you miss the notification, run the nx.configureMcpServer
(Nx: Setup MCP Server
in JetBrains) command from the command palette (Cursor: Ctrl/Cmd + Shift + P
, JetBrains IDEs: Ctrl/Cmd + Shift + A
).
Other MCP-Compatible Clients
Section titled “Other MCP-Compatible Clients”For other MCP-compatible clients (that do not have Nx Console available) like Claude Desktop you can use the Nx MCP by configuring it manually as follows:
{ "servers": { "nx-mcp": { "command": "npx", "args": ["nx-mcp@latest"] } }}
For Claude Code:
claude mcp add nx-mcp npx nx-mcp@latest
Powerful Use Cases
Section titled “Powerful Use Cases”Understanding Your Workspace Architecture
Section titled “Understanding Your Workspace Architecture”Ask your AI assistant about your workspace structure and get detailed, accurate responses about projects, their types, and relationships:
What is the structure of this workspace?How are the projects organized?
With Nx MCP, your AI assistant can:
- Identify applications and libraries in your workspace
- Understand project categorization through tags
- Recognize technology types (feature, UI, data-access)
- Determine project ownership and team responsibilities
You can also get informed suggestions about where to implement new functionality:
Where should I implement a feature for adding products to cart?
Learn more about workspace architecture understanding in our blog post Nx Just Made Your LLM Way Smarter.
Instant CI Failure Resolution
Section titled “Instant CI Failure Resolution”When a CI build fails, Nx Console can notify you directly in your editor:
Your AI assistant can then:
- Access detailed information from Nx Cloud about the failed build
- Analyze your git history to understand what changed in your PR
- Understand the error context and affected files
- Help implement the fix right in your editor
This integration dramatically improves the development velocity because you get immediately notified when an error occurs, you don't even have to leave your editor to understand what broke, and the LLM can help you implement or suggest a possible fix.
Learn more about CI integration in our blog post Save Time: Connecting Your Editor, CI and LLMs.
Smart Code Generation with AI-Enhanced Generators
Section titled “Smart Code Generation with AI-Enhanced Generators”Nx generators provide predictable code scaffolding, while AI adds intelligence and contextual understanding. Instead of having the AI generate everything from scratch, you get the best of both worlds:
Create a new React library into the packages/orders/feat-cancel-orders folderand call the library with the same name of the folder structure. Afterwards,also connect it to the main shop application.
Your AI assistant will:
- Identify the appropriate generator and its parameters
- Open the Nx Console Generate UI with preset values
- Let you review and customize the options
- Execute the generator and help integrate the new code with your existing projects
This approach ensures consistent code that follows your organization's best practices while still being tailored to your specific needs. Learn more about AI-enhanced generators in our blog post Enhancing Nx Generators with AI.
Documentation-Aware Configuration
Section titled “Documentation-Aware Configuration”Get accurate guidance on Nx configuration without worrying about hallucinations or outdated information:
Can you configure Nx release for the packages of this workspace?Update nx.json with the necessary configuration using conventional commitsas the versioning strategy.
The AI assistant will:
- Query the Nx docs for the latest information on release configuration
- Understand your workspace structure to identify packages
- Generate the correct configuration based on your specific needs
- Apply the changes to your nx.json file
Learn more about documentation-aware configuration in our blog post Making Cursor Smarter with an MCP Server For Nx Monorepos.
Cross-Project Dependency Analysis
Section titled “Cross-Project Dependency Analysis”Understand the impact of changes across your monorepo with questions like:
If I change the public API of feat-product-detail, which other projectsmight be affected by that change?
Your AI assistant can:
- Analyze the project graph to identify direct and indirect dependencies
- Visualize affected projects using the
nx_visualize_graph
tool - Suggest strategies for refactoring that minimize impact
- Identify which teams would need to be consulted for major changes
This architectural awareness is particularly powerful in larger monorepos where understanding project relationships is crucial for making informed development decisions.
Learn more about dependency analysis in our blog post Nx MCP Now Available for VS Code Copilot.