Skip to content

Commit 34c8ea2

Browse files
committed
Merge branch 'master' into release
2 parents a64c0ca + bffb4c2 commit 34c8ea2

File tree

17 files changed

+293
-235
lines changed

17 files changed

+293
-235
lines changed

CONTRIBUTING.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,25 @@ We are trying to keep GitHub issues for bug reports and feature requests. Stack
1818

1919
Alternatively, if you are using IntelliJ IDEA to develop Nx Console, it can take care of the java installation for you.
2020

21-
## Running the Extension locally
21+
## Development
2222

23-
### VSCode
23+
### Running the Extension locally
24+
25+
#### VSCode
2426

2527
In order to start Nx Console in development mode, the repo needs to be built. Running `yarn watch` via the terminal or using the command prompt to execute `Tasks: Run Task -> Build and watch Nx Console` will automatically generate build artifacts whenever the code changes. </br>
2628
Use the `F5` key or the debug menu option `Launch Client + Server` to start the Extension Development Host.
2729

2830
> :warning: Even though builds will be generated automatically, the Extension Development Host needs to be restarted in order to apply a new set of changes.
2931
30-
### IntelliJ
32+
#### IntelliJ
3133

3234
The `runIde` gradle task takes care of building Nx Console and starting a development instance of IntelliJ. Run the `nx-console [runIde]` gradle config in your IDE or use `nx run intellij:runIde` (which executes `./gradlew :apps:intellij:runIde` under the hood).
3335

3436
When debugging the JCEF-based generate UI, you can attach an instance of Chrome Devtools to the browser. To enable this, make sure to [set the corresponding registry key](https://plugins.jetbrains.com/docs/intellij/jcef.html#debugging).
3537

38+
### Building the extension for local testing
39+
3640
## Submitting a PR
3741

3842
Please follow the following guidelines:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Nx Console enhances your editors AI features by providing relevant context to th
5656

5757
In VSCode, access the enhancements via the `@nx` chat participant. Learn more [in our blog post](https://nx.dev/blog/nx-just-made-your-llm-smarter) or the [Nx docs](https://nx.dev/features/enhance-AI#vs-code-with-github-copilot)
5858

59-
In Cursor or anywhere else, use the Nx MCP server. Learn more [in our Cursor blog](https://nx.dev/blog/nx-made-cursor-smarter) post or [the Nx docs](https://nx.dev/features/enhance-AI#cursor)
59+
In Cursor or anywhere else, use the [Nx MCP server](./apps/nx-mcp/README.md). Learn more [in our Cursor blog](https://nx.dev/blog/nx-made-cursor-smarter) post or [the Nx docs](https://nx.dev/features/enhance-AI#cursor)
6060

6161
### Project Details View
6262

apps/generate-ui-v2/src/main.ts

+48-50
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,22 @@ export class Root extends LitElement {
1313
icc: IdeCommunicationController;
1414

1515
private formValuesService: FormValuesService;
16+
@state()
17+
private searchValue = '';
18+
private rootStyles = css`
19+
--border-width: 1;
20+
`;
1621

1722
constructor() {
1823
super();
1924
this.icc = new IdeCommunicationController(this);
2025
this.formValuesService = new FormValuesService(this);
2126

2227
window.addEventListener('keydown', (e) =>
23-
this.handleGlobalKeyboardShortcuts(e)
28+
this.handleGlobalKeyboardShortcuts(e),
2429
);
2530
}
2631

27-
@state()
28-
private searchValue = '';
29-
30-
private rootStyles = css`
31-
--border-width: 1;
32-
`;
33-
3432
render() {
3533
const options = this.icc.generatorSchema?.options;
3634
return html` <div
@@ -55,6 +53,20 @@ export class Root extends LitElement {
5553
</div>`;
5654
}
5755

56+
openNxDev(link: string) {
57+
const a = document.createElement('a');
58+
a.href = link;
59+
a.target = '_blank'; // Optional: Open in new tab
60+
a.style.display = 'none';
61+
document.body.appendChild(a);
62+
a.click();
63+
document.body.removeChild(a);
64+
}
65+
66+
protected createRenderRoot() {
67+
return this;
68+
}
69+
5870
private renderHeader() {
5971
const isNxGenerator =
6072
this.icc.generatorSchema?.collectionName?.includes('@nx') ||
@@ -90,17 +102,16 @@ export class Root extends LitElement {
90102
<div class="flex shrink-0">
91103
${when(
92104
isNxGenerator && this.icc.editor === 'vscode',
93-
() =>
94-
html`
95-
<button-element
96-
@click="${() => this.openNxDev(nxDevLink)}"
97-
title="Open generator documentation on nx.dev"
98-
appearance="icon"
99-
text="link-external"
100-
class="self-center py-2 pl-3"
101-
>
102-
</button-element>
103-
`
105+
() => html`
106+
<button-element
107+
@click="${() => this.openNxDev(nxDevLink)}"
108+
title="Open generator documentation on nx.dev"
109+
appearance="icon"
110+
text="link-external"
111+
class="self-center py-2 pl-3"
112+
>
113+
</button-element>
114+
`,
104115
)}
105116
<button-element
106117
class="self-center py-2 pl-3"
@@ -113,22 +124,23 @@ export class Root extends LitElement {
113124
</button-element>
114125
${when(
115126
!this.icc.configuration?.enableTaskExecutionDryRunOnChange,
116-
() =>
117-
html`<button-element
118-
class="self-center py-2 pl-3 sm:hidden"
119-
@click="${() => this.formValuesService.runGenerator(true)}"
120-
text="debug"
121-
appearance="icon"
122-
title="Dry Run"
123-
>
124-
</button-element>
125-
<button-element
126-
class="hidden py-2 pl-3 sm:block"
127-
@click="${() => this.formValuesService.runGenerator(true)}"
128-
text="Dry Run"
129-
appearance="secondary"
130-
>
131-
</button-element> `
127+
() => html`
128+
<button-element
129+
class="self-center py-2 pl-3 sm:hidden"
130+
@click="${() => this.formValuesService.runGenerator(true)}"
131+
text="debug"
132+
appearance="icon"
133+
title="Dry Run"
134+
>
135+
</button-element>
136+
<button-element
137+
class="hidden py-2 pl-3 sm:block"
138+
@click="${() => this.formValuesService.runGenerator(true)}"
139+
text="Dry Run"
140+
appearance="secondary"
141+
>
142+
</button-element>
143+
`,
132144
)}
133145
134146
<button-element
@@ -146,7 +158,7 @@ export class Root extends LitElement {
146158
html` <banner-element
147159
message="${this.icc.banner?.message}"
148160
type="${this.icc.banner?.type}"
149-
></banner-element>`
161+
></banner-element>`,
150162
)}
151163
<div class="mt-5">
152164
<search-bar
@@ -187,18 +199,4 @@ export class Root extends LitElement {
187199
}
188200
}
189201
}
190-
191-
openNxDev(link: string) {
192-
const a = document.createElement('a');
193-
a.href = link;
194-
a.target = '_blank'; // Optional: Open in new tab
195-
a.style.display = 'none';
196-
document.body.appendChild(a);
197-
a.click();
198-
document.body.removeChild(a);
199-
}
200-
201-
protected createRenderRoot() {
202-
return this;
203-
}
204202
}

apps/nx-mcp/README.md

+20-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ A [Model Context Protocol](https://modelcontextprotocol.io/introduction) server
66

77
## Overview
88

9-
The Nx MCP Server provides structured context about your Nx workspace to AI assistant models, enabling them to better understand and interact with your Nx projects. It serves as a bridge between AI models and your Nx workspace and documentation.
9+
The Nx MCP server gives LLMs deep access to your monorepo’s structure: project relationships, file mappings, runnable tasks, ownership info, tech stacks, Nx generators, and even Nx documentation. With this context, LLMs can generate code tailored to your stack, understand the impact of a change, and apply modifications across connected files with precision. This is possible because Nx already understands the higher-level architecture of your workspace, and monorepos bring all relevant projects into one place.
1010

11-
## Installation
11+
Read more in [our blog post](https://nx.dev/blog/nx-made-cursor-smarter) and [in our docs](https://nx.dev/features/enhance-AI).
12+
13+
## Installation and Usage
14+
15+
There are two ways to use this MCP server:
16+
17+
### a) Run it via the nx-mcp package
1218

1319
Simply invoke the MCP server via `npx` or your package manager's equivalent.
1420

@@ -22,6 +28,15 @@ If you want to host the server instead of communicating via `stdio`, you can use
2228

2329
Run `nx-mcp --help` to see what options are available.
2430

31+
### b) Use the Nx Console extension
32+
33+
If you're using Cursor you can directly install the Nx Console extension which automatically manages the MCP server for you.
34+
35+
More info:
36+
37+
- [Install Nx Console](https://nx.dev/getting-started/editor-setup)
38+
- [Configure Cursor to use the nx-mcp](https://nx.dev/features/enhance-AI#cursor)
39+
2540
## Available Tools
2641

2742
Currently, the Nx MCP server provides a set of tools. Resources, Roots and Prompts aren't supported yet.
@@ -31,6 +46,9 @@ Currently, the Nx MCP server provides a set of tools. Resources, Roots and Promp
3146
- **nx_docs**: Retrieves documentation sections relevant to user queries
3247
- **nx_generators**: Returns a list of available generators in the workspace
3348
- **nx_generator_schema**: Provides detailed schema information for a specific generator
49+
- **nx_available_plugins**: Returns a list of available Nx plugins from the npm registry with their descriptions
50+
51+
When no workspace path is specified, only the `nx_docs` and `nx_available_plugins` tools will be available.
3452

3553
## Contributing & Development
3654

apps/nx-mcp/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nx-mcp",
3-
"version": "0.0.7",
3+
"version": "0.0.8",
44
"main": "main.js",
55
"description": "A Model Context Protocol server implementation for Nx",
66
"author": {

0 commit comments

Comments
 (0)