Skip to main content
Glama
nrwl

Nx MCP Server

Official
by nrwl
create-ide-client.ts1.03 kB
import { IIdeJsonRpcClient } from '@nx-console/shared-types'; import { Logger } from '@nx-console/shared-utils'; import { IdeJsonRpcClient } from './json-rpc-client'; import { testIdeConnection } from '@nx-console/shared-socket-utils'; export async function createIdeClient( workspacePath: string, logger?: Logger, ): Promise<{ client: IIdeJsonRpcClient | undefined; available: boolean }> { try { const ideListening = await testIdeConnection(workspacePath); if (!ideListening) { return { client: undefined, available: false }; } const client = new IdeJsonRpcClient(workspacePath, logger); await client.connect(); // Verify connection is actually working const status = client.getStatus(); if (status !== 'connected') { client.disconnect(); return { client: undefined, available: false }; } return { client, available: true }; } catch (error) { logger?.log('Failed to create IDE client:', error); return { client: undefined, available: false }; } }

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