Skip to content

MCP server

Model Context Protocol server — component catalog & tokens for agents.

Model Context Protocol

list_components

Every @xngui/components/* entry with category and flat import path.

get_component_info

README and public exports for a single component entry.

list_design_tokens

Semantic roles, spacing, radius, motion, and z-index summary.

Build locally

terminal
pnpm install
pnpm --filter @xngui/mcp build

Wire into Cursor

mcp.json
{
"mcpServers": {
"xngui": {
"command": "node",
"args": ["tools/mcp-server/dist/index.js"],
"env": {
"XNGUI_ROOT": "/absolute/path/to/xngui"
}
}
}
}

Set XNGUI_ROOT to your monorepo root so list_components scans libs/components live.

Publish to npm

  1. Bump version in tools/mcp-server/package.json
  2. pnpm --filter @xngui/mcp build
  3. npm login · cd tools/mcp-server && npm publish --access public
consumer mcp.json
{
"mcpServers": {
"xngui": {
"command": "npx",
"args": ["-y", "@xngui/mcp"]
}
}
}