mcp-server

v1.24.0
@cobwds/mcp-server Checked 2 days ago Published 14 days ago

MCP server for the City of Boston Web Design System.

MCP (Model Context Protocol) server for the City of Boston Web Design System. Exposes COBWDS components, design tokens, and documentation to AI assistants. No installation is required. The MCP server runs on-demand via npx — your AI assistant downloads and starts it automatically when you add the configuration below. You just need Node.js (v18 or later) installed on your machine. Jump to the configuration for your assistant:

Summary extracted from the README.

@cobwds/mcp-server

MCP (Model Context Protocol) server for the City of Boston Web Design System. Exposes COBWDS components, design tokens, and documentation to AI assistants.

[!WARNING] This MCP server is a work-in-progress and the current tool results are being refined. The server is functional, but the quality of the output depends on the robustness of the underlying documentation, and we're enhancing component JSDoc with patterns, accessibility guidance, and usage rules based on guidance from "Effective Writing for AI" by Benny Powers.

Getting Started

No installation is required. The MCP server runs on-demand via npx — your AI assistant downloads and starts it automatically when you add the configuration below. You just need Node.js (v18 or later) installed on your machine.

Jump to the configuration for your assistant:

Optional: Local Installation

If you prefer to install the server locally — for example, to use the MCP Inspector or to pin a specific version — you can install it globally:

npm install -g @cobwds/mcp-server
cobwds-mcp

Or run it directly without installing:

npx -y @cobwds/mcp-server

Local Development

If you're working on the COBWDS repo itself and want your changes reflected in the MCP server:

  1. Build — run npm run build:link (or npm run build:all for a full production build) from the repo root. This rebuilds the custom-elements.json manifest and the MCP server bundle that your AI assistant reads.
  2. Restart your AI assistant — the MCP server process is loaded at startup, so changes won't take effect until you restart (e.g. quit and relaunch Claude Desktop, or run /mcp → restart in Claude Code).
# Fastest rebuild loop during MCP development
npm run build:link

# Then restart your AI assistant to pick up the changes

Connecting to Your AI Assistant

Each assistant has its own configuration format, but they all follow the same pattern: tell the assistant how to start the server (via npx), and it handles the rest.

GitHub Copilot

MCP support in GitHub Copilot is available in VS Code. Add to your VS Code settings or workspace .vscode/mcp.json:

{
  "servers": {
    "cobwds": {
      "command": "npx",
      "args": ["-y", "@cobwds/mcp-server"]
    }
  }
}

See the Copilot MCP documentation for the latest setup instructions.

Claude Desktop

Add to your Claude Desktop configuration:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "cobwds": {
      "command": "npx",
      "args": ["-y", "@cobwds/mcp-server"]
    }
  }
}

Claude Code

Add to your project's .mcp.json:

{
  "mcpServers": {
    "cobwds": {
      "command": "npx",
      "args": ["-y", "@cobwds/mcp-server"]
    }
  }
}

Or configure globally in ~/.claude/settings.json.

Cursor

Add to your Cursor MCP settings (.cursor/mcp.json):

{
  "mcpServers": {
    "cobwds": {
      "command": "npx",
      "args": ["-y", "@cobwds/mcp-server"]
    }
  }
}

Gemini CLI

Add to your Gemini CLI settings file (~/.gemini/settings.json) or your project's .gemini/settings.json:

{
  "mcpServers": {
    "cobwds": {
      "command": "npx",
      "args": ["-y", "@cobwds/mcp-server"]
    }
  }
}

See the Gemini CLI documentation for the latest setup instructions.

Available Tools

Components

Tool Description
find_components Search for components by name/description, or list all (omit query)
get_component Full documentation for a specific component. Use includeExamples: true for code examples (each carries html, react, and angular snippets). Pass framework: "react" or "angular" for that framework's import line, event-prop naming, and forms guidance.
validate_component_api Validate that attributes/properties are valid for a component

Design Tokens

Tool Description
find_tokens Search or browse tokens. Filter by category. include is recommended (default), primitive, or all.
get_token One token: CSS variable, raw value, resolved value, layer, and alternatives. Accepts --cob-color-text or color-text.
get_token_graph Token dependency graph showing references and usage

Styles & Guides

Tool Description
get_utility_classes Grid, flexbox, spacing, display, and typography utility classes
get_guide Guides for installation, form validation, styles, fonts, page structure, themes, or framework setup (angular, react, vue, dotnet, drupal, vanilla). The angular, react, and vue guides are the @cobwds/angular, @cobwds/react, and @cobwds/vue package READMEs.

Available Resources

URI Description
cobwds://components Component overview list
cobwds://component/{tag} Individual component docs
cobwds://tokens All design tokens with CSS variables and descriptions
cobwds://tokens/css Raw tokens.css file content
cobwds://tokens/graph Token dependency graph with stats
cobwds://tokens/color Color tokens only
cobwds://tokens/font Typography tokens
cobwds://tokens/space Spacing tokens
cobwds://tokens/size Size tokens
cobwds://installation Installation guide
cobwds://frameworks Index of framework packages (@cobwds/react, @cobwds/vue, @cobwds/angular) with version and guide URI
cobwds://frameworks/react @cobwds/react install, usage, forms, SSR, and troubleshooting guide
cobwds://frameworks/vue @cobwds/vue install, usage, v-model forms, SSR, and troubleshooting guide
cobwds://frameworks/angular @cobwds/angular install, usage, forms, SSR, and troubleshooting guide

Prompts

Prompt Description
cobwds_mode Activates COBWDS-aware coding assistance

Example Prompts

Once configured, you can ask your AI assistant to help you build real applications with the web design system.

Building applications from requirements:

Read the PDF from this folder and create a PRD for a multi-step front end application. Use the City of Boston Web Design System. Build with Vite and TypeScript. Break up the tasks into a step-by-step list. Before you start, ask any clarifying questions to do this task well.

Build out a newsletter signup form using the City of Boston Web Design System. Use existing WDS components where possible. Where not, build new components using the same approach as existing components, and style with appropriate COBWDS design tokens and utility classes. Afterward, perform a gap analysis that documents everything not in the web design system that was created.

Scaffolding and setup:

Set up a new Vite project with TypeScript and install the City of Boston Web Design System. Configure it with the correct fonts, tokens, and page structure. Show me a working hello world page that follows the COBWDS page layout guide.

I have an existing .NET Razor Pages app. Walk me through integrating COBWDS components into it step by step.

Building pages and features:

Build a search results page with a text input, filters using checkboxes and selects, and a results list. Use COBWDS components for all form elements and follow the grid system for layout.

Create an accessible multi-step wizard form for a permit application with validation on each step. Use COBWDS form components and show error states using the web design system's error patterns.

Working with design tokens and theming:

I'm building a page for the Department of Health. Show me how to apply their agency theme using COBWDS tokens, and build a dashboard header that uses the correct brand colors.

Show me all the spacing tokens available and explain the scale. Then refactor this layout to use COBWDS spacing tokens instead of hardcoded values.

Code review and validation:

Review this HTML page and identify everywhere I'm using COBWDS components incorrectly — wrong attributes, missing required properties, or deprecated patterns.

Check if I'm using the right token layers. I want to make sure my component-level styles reference the correct semantic tokens instead of raw values.

Exploring the system:

What COBWDS components are available for forms? Show me the documentation for each one with code examples.

Show me the token dependency graph for the primary color. I want to understand how the base, semantic, and component layers connect.