{"_id":"@anchor-ui/mcp-server","name":"@anchor-ui/mcp-server","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@anchor-ui/mcp-server","version":"1.0.0","description":"MCP server for Anchor UI component discovery and validation","type":"module","main":"dist/server.js","bin":{"anchor-ui-mcp":"dist/server.js"},"keywords":["mcp","model-context-protocol","anchor-ui","ai","cursor","vscode","ai-ide"],"author":{"name":"Anchor UI"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/anchorui/ui.git","directory":"packages/mcp-server"},"bugs":{"url":"https://github.com/anchorui/ui/issues"},"homepage":"https://anchorui.com","dependencies":{"@modelcontextprotocol/sdk":"^0.5.0"},"devDependencies":{"@types/node":"^25.0.3","tsx":"^4.19.2","typescript":"^5.9.3"},"engines":{"node":">=18.0.0"},"scripts":{"build":"tsc","start":"node dist/server.js","dev":"tsx src/server.ts"},"_id":"@anchor-ui/mcp-server@1.0.0","types":"./dist/server.d.ts","_integrity":"sha512-84V+6kODOxPewHCUL9j9Aqg8tM6NoimvJVCLyJdd8g8EN4Z8XvYPoBmKxiu+uSh0tl1HihEWpRFlrs3fSt94cw==","_resolved":"/private/var/folders/h4/pgqy06_j4yz_kcn8_79cpj7c0000gp/T/425b9becab2c78954b6cf69a0a4dab7b/anchor-ui-mcp-server-1.0.0.tgz","_from":"file:anchor-ui-mcp-server-1.0.0.tgz","_nodeVersion":"24.4.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-84V+6kODOxPewHCUL9j9Aqg8tM6NoimvJVCLyJdd8g8EN4Z8XvYPoBmKxiu+uSh0tl1HihEWpRFlrs3fSt94cw==","shasum":"a7058c0d3ebf183a254e0d7c936f9b5fc565397b","tarball":"https://registry.npmjs.org/@anchor-ui/mcp-server/-/mcp-server-1.0.0.tgz","fileCount":19,"unpackedSize":83533,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDWV1dSdg1qdl3Fd/yRChI98njwd/rXRacSy0oM7ZwVtAiBHk+YqglvsBN/tSmkrECATr3BPR887bHa/4Cg6WqQcjw=="}]},"_npmUser":{"name":"ipushpendra","email":"pushp.shakya@gmail.com"},"directories":{},"maintainers":[{"name":"ipushpendra","email":"pushp.shakya@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-server_1.0.0_1767633674213_0.5294396699083737"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-05T17:21:14.060Z","1.0.0":"2026-01-05T17:21:14.392Z","modified":"2026-01-05T17:21:14.734Z"},"maintainers":[{"name":"ipushpendra","email":"pushp.shakya@gmail.com"}],"description":"MCP server for Anchor UI component discovery and validation","homepage":"https://anchorui.com","keywords":["mcp","model-context-protocol","anchor-ui","ai","cursor","vscode","ai-ide"],"repository":{"type":"git","url":"git+https://github.com/anchorui/ui.git","directory":"packages/mcp-server"},"author":{"name":"Anchor UI"},"bugs":{"url":"https://github.com/anchorui/ui/issues"},"license":"MIT","readme":"# Anchor UI MCP Server\n\nModel Context Protocol (MCP) server for Anchor UI component discovery and validation. This server enables AI IDEs like Cursor and VS Code to understand Anchor UI components, their props, usage patterns, and guardrails.\n\n## Features\n\n- **Component Discovery**: List all available Anchor UI components by category\n- **Props Understanding**: Get detailed information about component props, types, and descriptions\n- **Usage Examples**: Retrieve code examples for basic, controlled, and custom usage\n- **Guardrails**: Validate code against Anchor UI best practices and prevent common mistakes\n- **Accessibility**: Understand ARIA attributes and keyboard navigation requirements\n- **Composition Rules**: Learn required and optional component parts\n\n## Installation\n\nInstall from npm:\n\n```bash\nnpm install @anchor-ui/mcp-server\n```\n\nOr install globally:\n\n```bash\nnpm install -g @anchor-ui/mcp-server\n```\n\n## Usage\n\n### As MCP Server\n\nThe server communicates via stdio using the MCP protocol. Configure it in your IDE:\n\n**Cursor Configuration** (`~/.cursor/mcp.json`):\n```json\n{\n  \"mcpServers\": {\n    \"anchor-ui\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@anchor-ui/mcp-server\"]\n    }\n  }\n}\n```\n\nOr if installed globally:\n```json\n{\n  \"mcpServers\": {\n    \"anchor-ui\": {\n      \"command\": \"anchor-ui-mcp\"\n    }\n  }\n}\n```\n\n**VS Code Configuration** (via MCP extension):\n```json\n{\n  \"mcp.servers\": {\n    \"anchor-ui\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@anchor-ui/mcp-server\"]\n    }\n  }\n}\n```\n\n### Development\n\n```bash\n# Build\npnpm build\n\n# Run in development mode\npnpm dev\n\n# Start server\npnpm start\n```\n\n## Available Tools\n\n### `list_components`\nList all available Anchor UI components, optionally filtered by category.\n\n**Parameters:**\n- `category` (optional): Filter by category (`layout`, `form`, `overlay`, `navigation`, `feedback`, `utility`, or `all`)\n\n**Example:**\n```json\n{\n  \"category\": \"form\"\n}\n```\n\n### `get_component`\nGet detailed information about a specific component.\n\n**Parameters:**\n- `componentName` (required): Name of the component (e.g., \"Dialog\", \"Accordion\")\n\n**Example:**\n```json\n{\n  \"componentName\": \"Dialog\"\n}\n```\n\n### `get_component_part`\nGet information about a specific part of a component.\n\n**Parameters:**\n- `componentName` (required): Name of the component\n- `partName` (required): Name of the part (e.g., \"Root\", \"Trigger\", \"Panel\")\n\n**Example:**\n```json\n{\n  \"componentName\": \"Dialog\",\n  \"partName\": \"Trigger\"\n}\n```\n\n### `get_usage_examples`\nGet usage examples for a component.\n\n**Parameters:**\n- `componentName` (required): Name of the component\n- `variant` (optional): Type of example (`basic`, `controlled`, `custom`, `composition`)\n\n**Example:**\n```json\n{\n  \"componentName\": \"Dialog\",\n  \"variant\": \"controlled\"\n}\n```\n\n### `validate_code`\nValidate code against Anchor UI guardrails.\n\n**Parameters:**\n- `code` (required): Code to validate\n- `componentName` (optional): Component name for context-specific validation\n\n**Example:**\n```json\n{\n  \"code\": \"<Dialog.Root><Dialog.Trigger>Open</Dialog.Trigger></Dialog.Root>\",\n  \"componentName\": \"Dialog\"\n}\n```\n\n### `get_guardrails`\nGet all guardrail rules for Anchor UI.\n\n**Parameters:** None\n\n## Guardrails\n\nThe MCP server enforces the following guardrails:\n\n### Errors (Must Fix)\n- ❌ No inline styles - use className or CSS\n- ❌ Do not override ARIA attributes unnecessarily\n- ❌ Do not break component composition\n- ❌ Do not manipulate DOM directly\n- ❌ Do not prevent default keyboard behavior\n- ❌ Include all required component parts\n\n### Warnings (Should Fix)\n- ⚠️ Consider using controlled state instead of useState\n- ⚠️ Avoid CSS-in-JS libraries (use plain CSS/Tailwind)\n\n### Suggestions (Best Practices)\n- 💡 Use render prop function for type safety\n- 💡 Use className as function to access component state\n- 💡 Use data attributes provided by Anchor UI\n\n## Architecture\n\nThe MCP server is a **read-only consumer** of Anchor UI's existing architecture:\n\n- **Reads** from `docs/reference/generated/*.json` (component metadata)\n- **Reads** from `docs/src/app/(public)/(content)/react/components/` (usage examples)\n- **Parses** component structure from source files (read-only)\n- **Provides** MCP API for AI tools\n\nNo modifications to:\n- Component implementations\n- Build system\n- Documentation structure\n- Published APIs\n\n## Component Categories\n\n- **Layout**: Accordion, Collapsible, Tabs\n- **Form**: Checkbox, Radio, Switch, Input, NumberField, Slider, Field, Fieldset, Form, Toggle, ToggleGroup\n- **Overlay**: Dialog, AlertDialog, Menu, Popover, Select, Tooltip, PreviewCard\n- **Navigation**: Tabs\n- **Feedback**: Progress\n- **Utility**: Separator, ScrollArea, DirectionProvider\n\n## License\n\nMIT\n\n## Related\n\n- [Anchor UI Documentation](https://anchorui.com)\n- [Model Context Protocol](https://modelcontextprotocol.io)\n\n","readmeFilename":"README.md","_rev":"1-9fe5fa01f3955bab3965c47095ed2926"}