Skip to main content
Glama
nrwl

Nx MCP Server

Official
by nrwl
get-nx-workspace.ts773 B
import { NxWorkspaceRequest } from '@nx-console/language-server-types'; import { NxWorkspace } from '@nx-console/shared-types'; import { getNxlsClient } from '@nx-console/vscode-lsp-client'; import type { ProjectGraphProjectNode } from 'nx/src/devkit-exports'; export function getNxWorkspace( reset?: boolean, ): Promise<NxWorkspace | undefined> { return getNxlsClient().sendRequest(NxWorkspaceRequest, { reset }); } // shortcuts to reduce repeated destructuring all over the codebase export async function getNxWorkspaceProjects( reset?: boolean, ): Promise<Record<string, ProjectGraphProjectNode>> { const nxWorkspace = await getNxWorkspace(reset); if (!nxWorkspace) { return {}; } const { projectGraph } = nxWorkspace; return projectGraph.nodes; }

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