Skip to main content
Glama
nrwl

Nx MCP Server

Official
by nrwl
get-available-nx-plugins.ts1.89 kB
import { gte, NxVersion } from '@nx-console/nx-version'; import { httpRequest, HttpError } from './http-client'; export type AvailableNxPlugin = { name: string; description: string; url?: string; }; export async function getAvailableNxPlugins( nxVersion: NxVersion | undefined, ): Promise<{ official: AvailableNxPlugin[]; community: AvailableNxPlugin[] }> { try { const officialResponse = await httpRequest({ url: 'https://raw.githubusercontent.com/nrwl/nx/master/docs/packages.json', followRedirects: 5, }); const communityResponse = await httpRequest({ url: 'https://raw.githubusercontent.com/nrwl/nx/master/community/approved-plugins.json', followRedirects: 5, }); const officialPlugins: AvailableNxPlugin[] = ( JSON.parse(officialResponse.responseText) as { name: string; description: string; }[] ) .filter( (pkg) => pkg.name !== 'add-nx-to-monorepo' && pkg.name !== 'cra-to-nx' && pkg.name !== 'create-nx-plugin' && pkg.name !== 'create-nx-workspace' && pkg.name !== 'make-angular-cli-faster' && pkg.name !== 'tao', ) .map((pkg) => { let prefix: string; if (!nxVersion) { prefix = '@nx'; } else if (gte(nxVersion, '16.0.0')) { prefix = '@nx'; } else { prefix = '@nrwl'; } return { name: `${prefix}/${pkg.name}`, description: pkg.description, }; }); const communityPlugins: AvailableNxPlugin[] = JSON.parse( communityResponse.responseText, ); return { official: officialPlugins, community: communityPlugins, }; } catch (error) { if (error instanceof HttpError) { return Promise.reject(error.responseText); } return Promise.reject(error); } }

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