feat(design-system): add DS MCP server + AI knowledge base [AR-58799]#401
Open
aroba-dn wants to merge 9 commits intodrivenets:mainfrom
Open
feat(design-system): add DS MCP server + AI knowledge base [AR-58799]#401aroba-dn wants to merge 9 commits intodrivenets:mainfrom
aroba-dn wants to merge 9 commits intodrivenets:mainfrom
Conversation
The lockfile specifiers were out of sync with the Storybook 10.3 upgrade. Also adds the required changeset entry and removes unintended changes to .husky/pre-commit and root package.json. Made-with: Cursor
- Exclude tools/ from root tsconfig, eslint, and knip (standalone project) - Add srvx, Streamable, EPIPE to cspell local dictionary - Run oxfmt to fix formatting across all changed files - Add --no-warn-ignored to lint-staged eslint to handle excluded files Made-with: Cursor
Regenerated lockfile from scratch to eliminate esbuild version duplication introduced by the Storybook 10.3 upgrade. Made-with: Cursor
| - All component names are prefixed with `Ds` (e.g., `DsButton`, `DsTable`) | ||
| - Components use CSS custom properties for theming (e.g., `--dn-color-primary`) | ||
| - Props follow controlled/uncontrolled patterns (React standard) | ||
| - `design: 'v1.2'` prop on some components enables newer design variants |
Collaborator
There was a problem hiding this comment.
It will not exist soon, better remove this.
- Dockerfile: node:20 → node:24 to match .nvmrc, fix lockfile ref - Remove TEST_EVIDENCE.md (content already in PR description) - Slim MCP_TOOLS.md to workflow-only (tool schemas auto-discovered via MCP) - Add test-manifests/README.md clarifying these are fixtures, not maintained data Made-with: Cursor
Collaborator
There was a problem hiding this comment.
I think the whole description will need to change once we migrate to new tokens and remove old ones.
Comment on lines
+39
to
+57
| ### Versioned Components | ||
|
|
||
| Components undergoing a design revision have a `versions/` directory: | ||
|
|
||
| ``` | ||
| src/components/ds-button/ | ||
| index.ts # Exports based on design prop | ||
| ds-button.types.ts # Union type switching between versions | ||
| versions/ | ||
| ds-button-new/ # v1.2 design | ||
| ds-button-new.tsx | ||
| ds-button-new.types.ts | ||
| ds-button-new.module.scss | ||
| ds-button-new.stories.tsx | ||
| ds-button-legacy/ # Original design | ||
| ... | ||
| ``` | ||
|
|
||
| The top-level component switches between versions based on a `design: 'v1.2'` prop. |
Collaborator
There was a problem hiding this comment.
It is no longer the case. We will not follow this approach starting from v1 which is in the branch next. I suggest to remove this section.
iromanchuk-dn
previously approved these changes
Apr 22, 2026
Collaborator
iromanchuk-dn
left a comment
There was a problem hiding this comment.
Great job!
Docs in .ai folder are usefull even for a human.
iromanchuk-dn
previously approved these changes
Apr 24, 2026
Merge upstream main (AR-58802 JSDoc, AR-58803 onBlur, AR-55986 tokens sync) into the MCP branch. Only conflict was the cspell word list — merged all entries from both sides. Made-with: Cursor
iromanchuk-dn
approved these changes
Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an AI-accessible component knowledge base to the DriveNets Design System via the Storybook MCP addon and a standalone MCP server.
This enables AI coding agents (Cursor, Claude, etc.) to programmatically query DS component documentation, props, stories, and usage examples — instead of re-scanning the DS codebase on every interaction.
How it works
Nobody manually maintains the manifest files. They are a build artifact generated from the source code — TypeScript prop types, JSDoc comments, story files, and MDX docs.
What's included
Storybook upgrade & addon
@storybook/addon-mcpto.storybook/main.tsaddonsmanifests/automaticallyMCP server (
tools/mcp-server/)A standalone TypeScript MCP server using
@storybook/mcp+srvx:src/server.ts— serves component knowledge via 3 MCP tools:list-all-documentation— discover all components and docs entriesget-documentation— get full props, stories, code snippets for a componentget-documentation-for-story— get a specific story variantMANIFESTS_DIRenv var)Dockerfile— multi-stage build (compile TS → slim runtime image onnode:24-alpine)docker-compose.yml— ready for container deploymentARCHITECTURE.md— maintainer documentation covering manifest generation, server design, and deploymenttest-manifests/— sample data mirroring real DS components for local testingAI knowledge base (
.ai/)OVERVIEW.md— DS architecture, conventions, and agent instructionsMCP_TOOLS.md— recommended MCP workflow (tool schemas are auto-discovered at runtime)ARCHITECTURE.md,IMPLEMENTATION.md,CONTRIBUTING.md— repo structure and patternsfeatures/— detailed docs on styling, Ark UI integration, component patternsoperations.md,testing.md— build pipeline, testing, and CI detailsDeployment
Phase A (now): Developers run the MCP server locally:
Then add to
.cursor/mcp.json:{ "mcpServers": { "ds-storybook-mcp": { "url": "http://localhost:9200/mcp" } } }Phase B (planned): Deployed as a Docker container behind a centralized MCP gateway. Developers update one URL. No code changes needed.
Test evidence
All 3 MCP tools tested end-to-end (initialize → tools/list → tools/call):
GET /health{"status":"healthy","server":"ds-storybook-mcp"}initializetools/listlist-all-documentationget-documentationAn independent AI sub-agent successfully connected, discovered components, retrieved docs, and generated correct JSX using only MCP-provided props.
Jira
Epic: AR-58799
Notes