@workday/canvas-kit-mcp
v15.0.7
Published
MCP package for Canvas Kit
Readme
Canvas Kit MCP
Our MCP server provides resources and tools to help you work with Canvas Kit components.
Installation
Cursor Quick Install
Other IDEs (Windsurf, VS Code, etc.)
Add to your MCP servers configuration file:
{
"mcpServers": {
"canvas-kit-mcp": {
"command": "npx",
"args": ["-y", "@workday/canvas-kit-mcp"]
}
}
}Claude Code CLI
claude mcp add --scope project --transport stdio canvas-kit -- npx -y @workday/canvas-kit-mcpTools
get-canvas-kit-upgrade-guides
Returns Canvas Kit upgrade guide documentation (v9 through v14) as resource links.
get-canvas-kit-tokens
Returns Canvas Kit design token documentation for migrating to @workday/canvas-tokens-web.
fetch-component-documentation-example
Renders an interactive Canvas Kit component story inline for the user. Accepts a story parameter
with an enum of all available component slugs (e.g. buttons, text-input, modal, tabs, etc.).
The tool returns:
- The Storybook documentation URL
- A
resource_linktodocs://examples/{story}with documentation and code examples - Story HTML via
_metafor inline MCP App rendering
LLMs should read the docs://examples/{story} resource first for documentation and code
examples. Only call fetch-component-documentation-example to show the user a live interactive
preview.
Resources
docs://upgrade-guides/*
Markdown upgrade guides for Canvas Kit major versions (v9-v14).
docs://tokens/*
Design token migration guides, color palette, roles, contrast, and scale documentation.
docs://examples/{slug}
Markdown documentation and inline code examples for each component. These are extracted from the MDX
story files at build time, with ExampleCodeBlock references replaced by the actual source code of
each example.
ui://story/{slug}
Interactive HTML previews of Canvas Kit components, served as MCP App resources
(text/html;profile=mcp-app). These are compiled from each component's Storybook MDX documentation
and include live, styled component examples.
Contributing
Canvas Kit MCP has two exports:
dist/cli.js-- a Node server that can be invoked via npx for local stdiodist/index.js-- module exports for extending the server or hosting with other transports
Build Pipeline
The build runs in stages via npm run build:
build:discover-- scansmodules/reactandmodules/preview-reactfor story files, extracts metadata (title, slug, Storybook URL, MDX path, prose with inlined code examples), and writeslib/stories-config.jsonbuild:apps-- compiles each MDX story into a self-contained single-file HTML app using Vite, bundling React, Emotion, Canvas Tokens CSS, and lightweight Storybook stubsbuild:copy-- copies static resources (upgrade guides, token docs) intodist/libbuild:types-- generates TypeScript declarationsbuild:mcp-- bundleslib/index.tsandlib/cli.tswith esbuild
Key build files
build/vite-plugins.ts-- shared Vite plugins (canvasKitSourceResolver) andCANVAS_KIT_PACKAGE_MAPfor monorepo package resolutionbuild/discover-stories.ts-- story discovery andstories-config.jsongenerationbuild/build-story-apps.ts-- MDX-to-HTML compilation with Vitebuild/harness.html-- HTML template for MCP App stories (MCP bridge, base typography, font loading)build/storybook-stubs/-- lightweight replacements for Storybook components (Meta,ExampleCodeBlock,SymbolDoc, etc.) used in MDX files
To test locally
MCP Inspector
The inspector requires Node >= 22 so you will need to temporarily switch:
nvm use 22
yarn build
npx @modelcontextprotocol/inspector node dist/cli.jsLocal IDE Testing
Add an entry to your MCP servers configuration pointing to your local build:
{
"mcpServers": {
"canvas-kit-mcp-local": {
"command": "node",
"args": ["/absolute/path/to/canvas-kit/modules/mcp/dist/cli.js"]
}
}
}In Cursor, put the JSON in ~/.cursor/mcp.json (all projects) or .cursor/mcp.json at the repo root (this project only). Restart Cursor or reload MCP after edits.
Rebuild the server after changes:
yarn build