design-system-mcp-server
v2.10.2Centralized MCP server for ONEM/RVA Design System with stdio and HTTP transport support
MCP server for the ONEM/RVA Design System. It supports local IDE integrations over stdio and hosted deployments over HTTP, and can run from live source or synced mcp-data JSON. On the corporate network, point your AI client at the hosted server. Replace with the repo you are working in — it is required, and it is what the usage KPIs are grouped by. Clients that can send headers can use X-Project: on the plain /mcp URL instead. Test environment: swap prod for test.
Summary extracted from the README.
Design System MCP Server
MCP server for the ONEM/RVA Design System. It supports local IDE integrations over stdio and hosted deployments over HTTP, and can run from live source or synced mcp-data JSON.
For teammates: one URL, nothing to install
On the corporate network, point your AI client at the hosted server. Replace
<your-repo> with the repo you are working in — it is required, and it is what
the usage KPIs are grouped by.
https://dsx-mcp-server.prod.paas.onemrva.priv/mcp?project=<your-repo>
Clients that can send headers can use X-Project: <your-repo> on the plain
/mcp URL instead. Test environment: swap prod for test.
VS Code (MCP: Open User Configuration), Claude Code
(claude mcp add --transport http design-system-mcp <url>), JetBrains and
Cursor all take this URL directly.
Claude Desktop, Cowork and claude.ai cannot: a connector URL is dialled from
Anthropic's cloud, which does not reach a .priv host. There, add a local
MCP server that bridges to the same URL from your own machine, which does
reach it. clients/claude-desktop.json is the
ready-made config. Processes Claude starts don't inherit HTTPS_PROXY, so the
config hands npm the proxy through npm_config_proxy; without it npx times
out on the registry and Claude gives up after 60s. Add its mcpServers key to
claude_desktop_config.json (Settings → Developer → Edit Config) at the top
level, next to preferences, not inside it. Then quit Claude from the tray and
reopen it.
- Windows (Store install):
%LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude_desktop_config.json - Windows (installer):
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Needs Node.js 22.15+ locally. NODE_USE_SYSTEM_CA=1 makes Node trust the RVA
CA from the Windows store; without it the bridge fails with
unable to get local issuer certificate. Calls still land on the hosted
server, so they count in the KPIs, tagged <client> (via mcp-remote <version>).
claude.ai on the web (and so Claude Design) has no local servers, so it stays out of reach until the server gets a public, authenticated route.
Prefer this URL over the npx setup when you have the choice: stdio runs on
your machine and its usage never reaches the hosted metrics.
MCP concept (quick overview)
MCP stands for Model Context Protocol. It is a standard way for an AI client (for example Copilot in an IDE) to call external capabilities safely.
At a high level:
- The AI client connects to an MCP server.
- The server exposes typed tools (name, description, JSON schema input).
- The AI chooses a tool and sends arguments.
- The server executes logic and returns structured output.
In this project, the MCP server is the bridge between AI and ONEM/RVA design-system knowledge (Angular APIs, synced Figma metadata, theme utilities, migration helpers).
What this server does
- Lists Angular design-system components
- Shows APIs (inputs, outputs, methods, slots, host listeners)
- Generates usage examples
- Provides accessibility notes
- Exposes synced Figma data (components, tokens, styles, icons) when available
- Helps migration from legacy Material/custom patterns to DS components
How this MCP server works
Runtime flow:
src/index.tsstarts stdio, HTTP, or both transports.- The server selects a data mode (
auto,mcp-data, orlive). - Tool metadata is registered through
getTools(). - Incoming MCP calls are routed to
handleToolCall()insrc/tools.ts. - Tool handlers read from live scanner data and/or synced JSON under
mcp-data. - Results are returned as MCP tool responses for the AI to use in follow-up reasoning.
For migration workflows, the typical loop is:
- Run
analyze_repo_migrationon a target repo. - Review migration findings and DS usage issues.
- Use the generated Copilot fix-pack prompts file by file.
- Re-run
analyze_repo_migrationuntil findings reach zero.
This is the core mechanism that lets Copilot move from diagnosis to concrete remediation.
Local demo mode (use this now)
For a local demonstration, run only stdio transport and skip hosted HTTP setup.
- Build and verify locally:
cd tools/mcp-server
npm install
npm run build
npm run test
- In your MCP client config, use stdio with either:
- published package via
npx -y @onemrvapublic/design-system-mcp-server - local build path via
node .../tools/mcp-server/dist/index.js --transport=stdio
- If you want fresh synced data before the demo, run from repo root:
npm run sync:mcp
-
During the demo, do not run
start:httpand do not setMCP_TRANSPORT=http. -
Optional: use the inspector for a direct local walkthrough:
cd tools/mcp-server
npm run inspector
Hosting can be enabled later by following the hosted sections in this file.
Fast IDE setup (recommended)
If you just want this working quickly, run one command from the repository root:
npm run mcp:setup
This command builds the MCP server, detects your IDE, and writes the MCP config automatically. It supports both VS Code and JetBrains IDEs.
If you are actively developing design-system components and want automatic detection, use the dev profile:
npm run mcp:setup:dev
The dev profile config starts MCP with --data-source=live --watch.
If you want one command that both configures and starts live watch mode:
npm run mcp:dev
If you want to force one target, run the setup script directly from the MCP
server package (there is no root mcp:setup:vscode/mcp:setup:jetbrains alias):
npm --prefix tools/mcp-server run setup:vscode
npm --prefix tools/mcp-server run setup:jetbrains
After running setup, restart your IDE (or reload the VS Code window).
On JetBrains the setup writes the global ~/.ai/mcp/mcp.json (the path AI
Assistant's settings dialog points to) plus the project's .idea/mcp.json when
present. It also prints the JSON to paste into Settings → Tools → AI Assistant →
Model Context Protocol (MCP), as a fallback.
Pass --ide=jetbrains explicitly: auto-detection only sees JetBrains from the
IDE's own terminal, and falls back to VS Code otherwise.
Best practices for invoking MCP from AI chat
The MCP server works best when prompts are explicit about scope, desired outcome, and safety constraints.
Use this structure for reliable results:
- Target: file, folder, or component name.
- Task: analyze, migrate, fix, or explain.
- Constraints: what must not change (behavior, public API, styling, etc.).
- Validation: run tests/lint/build and summarize diff.
Prompt template:
Use the design-system MCP server on <target>.
Task: <analyze|migrate|fix|explain>.
Constraints: <keep behavior|no public API changes|minimal diff>.
Validation: <run tests/build/lint if available>.
Output: <apply patch + summary of what changed and why>.
Recommended prompts developers can copy:
Use the design-system MCP server to audit this component and fix invalid DS inputs/outputs/imports. Keep behavior unchanged and apply the patch.
Run migration analysis on this folder, fix only high-confidence findings first, and re-run analysis until no high-confidence issues remain.
Migrate Angular Material usage in this template to DS equivalents where safe, and leave TODO notes for risky cases.
Validate this component against DS accessibility guidance and patch missing aria labels/roles/focus handling without changing UI behavior.
Explain which MCP tools you used, what each found, and show the final diff summary.
Tips:
- Ask for "high-confidence fixes first" to reduce regressions.
- Ask for "minimal diff" for easier reviews.
- Ask for "show skipped/risky items" so manual follow-up is clear.
- Provide concrete targets (exact file paths) instead of broad repo-wide requests when starting.
Manual setup (if you want full control)
VS Code
- Press
F1and runMCP: Open User Configuration. - Add:
{
"servers": {
"design-system-mcp": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@onemrvapublic/design-system-mcp-server"]
}
}
}
- Reload VS Code (
F1->Developer: Reload Window).
Claude Desktop
Edit your config file:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"design-system-mcp": {
"command": "npx",
"args": ["-y", "@onemrvapublic/design-system-mcp-server"]
}
}
}
JetBrains
In ~/.ai/mcp/mcp.json and <project>/.idea/mcp.json (what the setup writes):
{
"mcpServers": {
"design-system-mcp": {
"command": "npx",
"args": ["-y", "@onemrvapublic/design-system-mcp-server"]
}
}
}
Same JSON in Settings -> Tools -> AI Assistant -> Model Context Protocol (MCP) ->
+ -> Command -> As JSON if the file is not picked up.
Hosted mode uses ?project=<repo> on the URL instead of an X-Project header,
which AI Assistant drops. On a corporate machine the JVM also has to be told to
trust our internal certificate.
JetBrains has enough gotchas that they get their own step-by-step guide, with a
troubleshooting table: see the JetBrains section of SETUP.md.
Runtime modes
stdio(default): local IDE clientshttp: hosted MCP endpointboth: stdio + HTTP in one process
Examples (the start:* scripts live in the MCP server package, so run them from
tools/mcp-server or with --prefix):
npx -y @onemrvapublic/design-system-mcp-server --transport=stdio
npm --prefix tools/mcp-server run start:http
npm --prefix tools/mcp-server run start:both
Data source behavior
By default, the server uses synced mcp-data/codebase.json as the source of truth when it is available. This keeps answers consistent even when the MCP server is used from other repositories.
You can control this with MCP_DATA_SOURCE:
auto(default): use syncedmcp-datawhen available, otherwise use live scanmcp-data: force synced data only (fails fast ifcodebase.jsonis missing)live: force live scan fromDESIGN_SYSTEM_PATH
Example:
MCP_DATA_SOURCE=mcp-data node dist/index.js --transport=stdio
In synced-data mode, rescan_components is intentionally disabled.
For Design System developers who want automatic detection while editing components, use live watch mode:
npm run mcp:start:live:watch
Run this command from the repository root. It watches design-system source folders and triggers automatic rescan on file changes, so developers do not need to run sync:mcp after each edit.
Hosted mode hardening (current defaults)
- HTTP startup fails closed unless
MCP_API_KEYis set, orMCP_ALLOW_UNAUTHENTICATED_HTTP=trueis explicitly set for trusted local networks. GET /healthis protected by API key checks in hosted mode.- Rate limiting and HTTP session caps are enabled.
- Legacy SSE routes are disabled by default and only enabled with
MCP_ENABLE_LEGACY_SSE=true.
Environment variables:
MCP_API_KEYMCP_ALLOW_UNAUTHENTICATED_HTTP=trueMCP_ENABLE_LEGACY_SSE=trueMCP_MAX_HTTP_SESSIONS(default100)MCP_RATE_LIMIT_WINDOW_MS(default60000)MCP_RATE_LIMIT_MAX_REQUESTS(default300)MCP_TRANSPORT=stdio|http|bothPORT(default3001)
Endpoints and what is exposed
When HTTP transport is enabled:
ALL /mcpfor Streamable HTTP MCP transportGET /healthfor runtime healthGET /sseandPOST /messagesonly if legacy SSE is explicitly enabled
Important: this server does not expose README.md, SETUP.md, or arbitrary files as MCP resources/endpoints. Documentation files stay in the repository only.
Sync workflow (sync:mcp)
Run from the repository root:
npm run sync:mcp
The sync pipeline runs codebase sync then Figma sync, and writes to tools/mcp-server/mcp-data.
.env loading is supported from:
- repository root
.env tools/mcp-server/.env
Key env vars for Figma sync:
FIGMA_TOKEN(required)FIGMA_FILE_KEY(optional, falls back to default)- proxy vars such as
HTTPS_PROXYif needed
Figma scopes:
- To read file/component/style content, the token needs file content read access.
- To read Variables (
tokens.json), the token also needs Variables read access. If Variables access is missing, component/style sync can still succeed and Variables calls can return 403.
Figma sync exclusions live in tools/mcp-server/mcp-data/mapping.json under figma_sync_exclusions.
filesskips an entire Figma file key before the sync starts.pagesskips named pages before page/node fetches happen.componentsskips named components before component/node fetches happen.componentSetsskips named component sets before node fetches happen.
Page mapping still supports figma_page_mapping values of _ignore and _docs, which are treated as non-sync pages.
For token extraction, figma_sync_options.tokenPages limits the expensive deep page analysis to the pages that matter most. The default config keeps Foundations in that list, and tokenPageHints adds a name-based fallback for other token-heavy pages.
Available MCP tools
The server registers 27 tools (see getTools() in src/tool-registry.ts).
Discovery:
help_friend
Core design-system tools:
list_componentsget_componentsearch_componentsgenerate_component_usageget_component_propsget_accessibility_infolist_jsonforms_renderersget_jsonforms_rendererlist_theme_utilitiesget_theme_utilitysuggest_componentaudit_componentcompare_componentsget_color_palette
Synced-data and Figma-aware tools:
list_iconsget_sync_statuslist_figma_componentsget_figma_componentlist_design_tokensget_design_tokenexplain_token_difflist_figma_styles
Migration and remediation tools:
migrate_to_dsmigrate_fileanalyze_repo_migration
Admin tools:
rescan_components
Verify locally
cd tools/mcp-server
npm install
npm run build
npm run test
npm run inspector
For hosted mode smoke checks (still from tools/mcp-server):
- Run
npm run start:httpwithoutMCP_API_KEYand verify startup fails. - Set
MCP_API_KEY, restart, and verifyGET /healthrequires auth. - Verify
/mcpcalls succeed with valid API key.
Architecture
src/index.ts: transport bootstrap (stdio/http), auth guards, rate/session limits, health and rescan routessrc/tool-registry.ts:getTools()tool metadata registry andTOOL_NAMESsrc/component-scanner.ts: component/jsonforms/theme scanning and rescansrc/component-parser.ts: parser for decorators/JSDoc/API extractionsrc/tools.ts: MCP tool handlers and synced-data fallback logicscripts/codebase-sync.ts: codebase metadata syncscripts/figma-sync.ts: 3-pass Figma sync (components/layers/tokens+styles)
The server prefers live scan when source is mounted. If source is unavailable but mcp-data exists, it starts in synced-data-only mode.
Known parser gaps
src/component-parser.ts is regex-based, not a full TypeScript AST. A few
component patterns are not extracted today. Authors relying on these fields
should be aware they can come back empty:
- Public methods declared without the
publickeyword (implicitly-public methods are skipped; onlypublic-prefixed methods populatemethods[]). - Query decorators that use a quoted template-reference selector, e.g.
@ViewChild('ref')/@ViewChildren('items')— these are not added toqueryChildren[](type-selector queries like@ViewChild(ChildComp)and@ContentChild(...)are extracted). - Function-typed
@Inputtypes such as(event: Event) => Promise<void>are not preserved as-is.
Related: hasEffects tracks Angular signal effect() calls, not lifecycle-hook
implementations (OnInit, OnDestroy, ...). These gaps are captured by the ten
skipped cases in src/component-parser.comprehensive.test.ts.
Notes for component authors
The detailed component authoring guide (JSDoc tags, input/output docs, accessibility annotation examples) remains in SETUP.md.