Angular Storybook MCP Server

Angular Storybook MCP Server

An MCP server that brings an Angular design system built on Storybook into AI tools like Claude and Cursor, providing real-time access to component metadata, APIs, and documentation.

Category
访问服务器

README

Angular Storybook MCP Server

An MCP (Model Context Protocol) server that brings an Angular design system built on Storybook into Claude Code and Cursor, enabling AI-assisted development with real-time access to component metadata, APIs, and documentation.

This server only works against a design system whose Storybook build emits the manifests/components.json and manifests/docs.json files described below — it is not a generic Angular DS integration.

Overview

This MCP server exposes an Angular Storybook design system as a set of tools available to Claude. It fetches component metadata from a live Storybook instance and provides tools for:

  • Listing all components — get a complete inventory of the design system
  • Searching components — find components by name or keyword
  • Component imports — get correct import paths for any component
  • Component props — view all props, types, and defaults for a component
  • Type details — inspect complex TypeScript types used by components
  • Foundations — access design tokens (colors, typography, spacing, etc.)
  • Peer dependencies — pointer to where required package versions can be found (not yet in the manifests)

Before you start: two things are required

This project has two independent halves, and both must be set up — one without the other doesn't work:

  1. Install and configure this MCP server locally — see Setup below. This is the client-side piece that Claude Code or Cursor talks to.
  2. Make your Storybook emit manifests/components.json and manifests/docs.json — see Bringing up a new design system repo. This is a one-time change to the Storybook project itself (Compodoc + the manifest addon), and it must re-run on every Storybook rebuild so the manifests stay current. Without it, there's nothing for this MCP server to fetch, no matter how correctly step 1 is configured.

Setup

Both Claude Code and Cursor talk to this MCP server using the same mcpServers config shape — only the config file location differs. Pick your editor below.

Setup for Cursor

Once the Storybook owner deploys with the manifests/components.json and manifests/docs.json files included, configure Cursor to use the live URL.

Edit .cursor/mcp.json (project-level, in your repo root) or ~/.cursor/mcp.json (global, applies to all projects):

{
  "mcpServers": {
    "angular-ds": {
      "command": "node",
      "args": ["<path-to-angular-ds-mcp-server>/dist/server.js"],
      "env": {
        "STORYBOOK_URL": "https://your-storybook-host.example.com"
      }
    }
  }
}

Then reload Cursor (Command Palette → "Reload Window", or fully restart Cursor). Open Cursor Settings → MCP to confirm the angular-ds server shows as connected.

Setup for Claude Code

Once the Storybook owner deploys with the manifests/components.json and manifests/docs.json files included, configure Claude Code to use the live URL.

Edit ~/.claude/claude.json:

{
  "mcpServers": {
    "angular-ds": {
      "command": "node",
      "args": ["<path-to-angular-ds-mcp-server>/dist/server.js"],
      "env": {
        "STORYBOOK_URL": "https://your-storybook-host.example.com"
      }
    }
  }
}

Then restart Claude Code. The tools will be available in all sessions.

Testing

After configuring Claude Code or Cursor, start a new chat and ask:

List all components in the design system

The assistant should call list_components and return the full component list. If it works, the MCP server is properly configured.

Building

npm install
npm run build

The built server will be at dist/server.js.

Development

Run the server in dev mode (with hot reload via tsx):

npm run dev

Or start the built server directly:

npm start

Architecture

  • src/server.ts — Main MCP server entry point; registers all tools
  • src/fetcher.ts — Handles fetching and caching manifests/components.json and manifests/docs.json from Storybook
  • src/tools/ — Individual tool implementations:
    • list-components.ts — List all components
    • search-components.ts — Search by name/keyword
    • get-import.ts — Get import path
    • get-component-props.ts — Get component props
    • get-type-details.ts — Inspect TypeScript types
    • get-foundations.ts — Get design tokens
    • get-peer-dependencies.ts — Get version requirements

Environment Variables

  • STORYBOOK_URL — Base URL where the manifest files are served. Required; the server throws on startup if it is not set.

Troubleshooting

"Failed to fetch component metadata"

  • Check that STORYBOOK_URL points to a valid URL
  • Verify manifests/components.json and manifests/docs.json exist at {STORYBOOK_URL}/manifests/components.json and {STORYBOOK_URL}/manifests/docs.json
  • For local testing, ensure the http-server is running on the correct port

Tools not appearing in Claude Code / Cursor

  • Verify ~/.claude/claude.json (Claude Code) or .cursor/mcp.json / ~/.cursor/mcp.json (Cursor) is properly formatted JSON
  • Check that the dist/server.js file exists and is executable
  • Restart Claude Code, or reload/restart Cursor, after updating the config

Slow first query

  • The server caches metadata on startup. First query may take a few seconds while it fetches from Storybook.

Integration with your Design System

This server depends on your Angular Design System's Storybook build including two manifest files, manifests/components.json and manifests/docs.json. These are automatically generated as part of the Storybook build process and contain:

  • manifests/components.json — component names, selectors, import statements, story snippets, and prop definitions (types, required flags, defaults, descriptions)
  • manifests/docs.json — design tokens and other foundations documentation

Peer dependency information is not currently part of the manifests; the get_peer_dependencies tool points users to your design system package's own peerDependencies instead.

Bringing up a new design system repo (for Storybook owners)

None of this happens with a vanilla Storybook install — it requires two things wired into the target Angular repo:

1. Generate Angular metadata with Compodoc

Compodoc is a separate tool, not part of Storybook. Install it and add a script that runs it before Storybook starts/builds:

// package.json
"scripts": {
  "compodoc:lib": "compodoc -p <path-to-your-lib-tsconfig> -e json -d <output-dir> --silent",
  "prestorybook": "npm run compodoc:lib",
  "prebuild-storybook": "npm run compodoc:lib"
}

This produces a documentation.json file describing every component's inputs, outputs, and types.

2. Add the manifest addon + feature flag to .storybook/main.ts

addons: [
  'storybook-addon-angular-manifest', // must come BEFORE addon-docs
  '@storybook/addon-docs',
  // ...your other addons
  '@storybook/addon-mcp',
],
features: {
  componentsManifest: true, // Storybook 10.3+; use `experimentalComponentsManifest` on 10.2.x
},

Every story's meta must set component: (e.g. component: ButtonComponent) — without it, the addon can't resolve the Angular component name and the manifest entry comes out as an error.

3. Build and deploy Storybook as usual

npm run build-storybook now emits manifests/components.json and manifests/docs.json as static files alongside the rest of the Storybook site. Deploy that output wherever your Storybook is normally hosted (S3+CloudFront, a container behind nginx, etc.) — no special MCP-aware hosting is required, it's just two extra static JSON files.

4. Point this MCP server at it

Once the manifests are reachable at {your-storybook-url}/manifests/components.json and {your-storybook-url}/manifests/docs.json, set STORYBOOK_URL to that base URL (see Setup and Environment Variables above) — no changes to this server's code are needed.

Consumers on your team then just add this server to their own .cursor/mcp.json or ~/.claude/claude.json as shown in Setup, pointing STORYBOOK_URL at your deployed Storybook. Each person still builds/runs their own local copy of this server (it's a stdio server, not a hosted one) — only the Storybook + manifests need central deployment.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选