Skip to main content
Glama
nrwl

Nx MCP Server

Official
by nrwl
cache-dir.ts1.03 kB
import { join } from 'path'; import { importWorkspaceDependency, workspaceDependencyPath, } from '../workspace-dependencies'; export async function getCacheDir(workspacePath: string): Promise<string> { const nxPath = await workspaceDependencyPath(workspacePath, 'nx'); if (!nxPath) { throw 'local nx dependency not found'; } const importPath = join(nxPath, 'src/utils/cache-directory'); const { cacheDir } = await importWorkspaceDependency< typeof import('nx/src/utils/cache-directory') >(importPath); return cacheDir; } export async function getWorkspaceDataDirectory( workspacePath: string, ): Promise<string> { const nxPath = await workspaceDependencyPath(workspacePath, 'nx'); if (!nxPath) { throw 'local nx dependency not found'; } const importPath = join(nxPath, 'src/utils/cache-directory'); const { workspaceDataDirectory } = await importWorkspaceDependency< typeof import('nx/src/utils/cache-directory') >(importPath); return workspaceDataDirectory; }

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