Skip to main content
Glama

Nx MCP Server

Official
by nrwl
tools.test.ts1.49 kB
import { cleanupNxWorkspace, createInvokeMCPInspectorCLI, defaultVersion, e2eCwd, newWorkspace, simpleReactWorkspaceOptions, uniq, } from '@nx-console/shared-e2e-utils'; import { rmSync } from 'node:fs'; import { platform } from 'node:os'; import { join } from 'node:path'; describe('tools', () => { let invokeMCPInspectorCLI: Awaited< ReturnType<typeof createInvokeMCPInspectorCLI> >; const workspaceName = uniq('nx-mcp-smoke-test'); const testWorkspacePath = join(e2eCwd, workspaceName); beforeAll(async () => { newWorkspace({ name: workspaceName, options: simpleReactWorkspaceOptions, }); invokeMCPInspectorCLI = await createInvokeMCPInspectorCLI( e2eCwd, workspaceName, ); }); afterAll(async () => { // Clean up Nx workspace processes before attempting to remove directory await cleanupNxWorkspace(testWorkspacePath, defaultVersion); rmSync(testWorkspacePath, { recursive: true, force: true }); }); it('should ensure that the server starts and lists the expected tools for an Nx workspace', () => { const result = invokeMCPInspectorCLI( testWorkspacePath, '--method tools/list', ); const toolNames = result.tools.map((tool: any) => tool.name); expect(toolNames).toEqual([ 'nx_docs', 'nx_available_plugins', 'nx_workspace', 'nx_workspace_path', 'nx_project_details', 'nx_generators', 'nx_generator_schema', ]); }); });

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