Skip to main content
Glama
nrwl

Nx MCP Server

Official
by nrwl
vscode-nx-conversion.ts1.8 kB
import { WorkspaceConfigurationStore } from '@nx-console/vscode-configuration'; import { commands, ExtensionContext, window } from 'vscode'; let run = false; export async function initNxConversion( context: ExtensionContext, isAngularWorkspace: boolean, isNxWorkspace: boolean, ) { let workspaceType: 'nx' | 'angular' | 'angularWithNx' = 'nx'; if (isNxWorkspace && isAngularWorkspace) { workspaceType = 'angularWithNx'; } else if (isNxWorkspace && !isAngularWorkspace) { workspaceType = 'nx'; } else if (!isNxWorkspace && isAngularWorkspace) { workspaceType = 'angular'; } if (workspaceType !== 'angular') { return; } if (run) { return; } run = true; const now = new Date(); const lastConversionNotficationTime = WorkspaceConfigurationStore.instance.get('nxConversionDate', 0); const command = commands.registerCommand( 'nxConsole.migrateAngularCliToNx', () => { commands.executeCommand('nx.init', true); }, ); context.subscriptions.push(command); if (now.getDay() === new Date(lastConversionNotficationTime).getDay()) { return; } WorkspaceConfigurationStore.instance.set('nxConversionDate', now.getTime()); const answer = await window.showInformationMessage( `Want to migrate? Migrate your Angular workspace to Nx and get features like remote caching, distributed builds, and atomized tests out of the box.`, 'Migrate Now', 'Learn More', ); if (answer === 'Migrate Now') { commands.executeCommand('nxConsole.migrateAngularCliToNx'); return; } if (answer === 'Learn More') { commands.executeCommand( 'vscode.open', 'https://nx.dev/technologies/angular/migration/angular#migrating-an-angular-cli-project-to-nx?utm_source=nx-console', ); return; } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nrwl/nx-console'

If you have feedback or need assistance with the MCP directory API, please join our Discord server