@gostudent/shared-ui-library-mcp

v2.2.0

Published

MCP server for @gostudent/shared-ui-library — exposes components, icons, and tokens to Claude

Readme

@gostudent/shared-ui-library-mcp

MCP server for @gostudent/shared-ui-library. Gives Claude accurate, always-up-to-date knowledge of the component library — props, variants, usage examples, icons, and design tokens — without needing to read source files.


What it exposes

| Tool | Input | Returns | |---|---|---| | list_components | — | All components with descriptions | | get_component | name: string | Props, variants, and usage examples for one component | | list_icons | — | All icon names and supported sizes | | get_tokens | category?: string, brand?: "base" \| "gs" \| "sk" | Design tokens, optionally filtered by category | | search_components | query: string | Components matching a name, description, or prop keyword |


How to connect locally

Add to your project's .mcp.json:

{
  "mcpServers": {
    "library": {
      "command": "node",
      "args": ["/absolute/path/to/shared-ui-library/src/mcp/server.mjs"]
    }
  }
}

Or, once published, use the npm package directly:

{
  "mcpServers": {
    "library": {
      "command": "npx",
      "args": ["@gostudent/shared-ui-library-mcp@latest"]
    }
  }
}

Restart Claude Code after editing .mcp.json. Run /mcp to confirm the library server is connected.


How the manifest is generated

The server reads library-manifest.json at startup. This file is a build artifact — it is regenerated on every npm run build by scripts/generate-library-manifest.mjs.

The generator:

  • Walks src/components/ and parses each component's Storybook stories file — extracting the description, argTypes (props + allowed values), and the first 3 story args as JSX usage examples
  • Walks src/icons/ to collect icon names and size values from types.ts
  • Reads src/tokens/output/{base,gs,sk}/tokens.js and groups tokens by category prefix

Because the manifest is regenerated from source on every build, it is always in sync with the actual library — no manual maintenance needed.


Publishing

The MCP package is published separately from the library via two manual CI jobs:

  • dt_prerelease_mcp — feature branches (DT-*); publishes with --tag next
  • release_mcp — master only; publishes as latest

The package version is synced to the library version at publish time by reading ../../package.json.