Skip to main content
Glama
nrwl

Nx MCP Server

Official
by nrwl
nx-cloud-auth-headers.ts956 B
import { getNxCloudId, getNxAccessToken, getNxCloudUrl } from './cloud-ids'; import { getNxCloudConfigIni } from './nx-cloud-config-ini'; type NxCloudHeaders = Partial< Record< 'Nx-Cloud-Id' | 'Nx-Cloud-Personal-Access-Token' | 'Authorization', string > >; export async function nxCloudAuthHeaders( workspacePath: string, ): Promise<NxCloudHeaders> { const nxCloudUrl = await getNxCloudUrl(workspacePath); const nxCloudId = await getNxCloudId(workspacePath); const nxCloudConfigIni = getNxCloudConfigIni(); const accessToken = await getNxAccessToken(workspacePath); const personalAccessToken = nxCloudConfigIni?.[nxCloudUrl]?.personalAccessToken; const headers = {}; if (nxCloudId) { headers['Nx-Cloud-Id'] = nxCloudId; } if (personalAccessToken) { headers['Nx-Cloud-Personal-Access-Token'] = personalAccessToken; } if (accessToken) { headers['Authorization'] = accessToken; } return headers; }

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