@cobwds/mcp-server 1.19.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +235 -0
  2. package/data/cem/custom-elements.json +15923 -0
  3. package/data/guides/.gitkeep +0 -0
  4. package/data/guides/fonts.md +56 -0
  5. package/data/guides/form-validation.md +169 -0
  6. package/data/guides/frameworks/angular.md +71 -0
  7. package/data/guides/frameworks/dotnet.md +42 -0
  8. package/data/guides/frameworks/drupal.md +39 -0
  9. package/data/guides/frameworks/react.md +115 -0
  10. package/data/guides/frameworks/vanilla.md +45 -0
  11. package/data/guides/installation.md +73 -0
  12. package/data/guides/page-structure.md +161 -0
  13. package/data/guides/styles.md +48 -0
  14. package/data/guides/themes.md +61 -0
  15. package/data/tokens/tokens.css +479 -0
  16. package/data/tokens/tokens.json +1553 -0
  17. package/dist/index.d.ts +9 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +16 -0
  20. package/dist/lib/cem-parser.d.ts +102 -0
  21. package/dist/lib/cem-parser.d.ts.map +1 -0
  22. package/dist/lib/cem-parser.js +92 -0
  23. package/dist/lib/search.d.ts +20 -0
  24. package/dist/lib/search.d.ts.map +1 -0
  25. package/dist/lib/search.js +87 -0
  26. package/dist/lib/token-parser.d.ts +128 -0
  27. package/dist/lib/token-parser.d.ts.map +1 -0
  28. package/dist/lib/token-parser.js +431 -0
  29. package/dist/prompts/cobwds-mode.d.ts +8 -0
  30. package/dist/prompts/cobwds-mode.d.ts.map +1 -0
  31. package/dist/prompts/cobwds-mode.js +60 -0
  32. package/dist/resources/components.d.ts +12 -0
  33. package/dist/resources/components.d.ts.map +1 -0
  34. package/dist/resources/components.js +62 -0
  35. package/dist/resources/guides.d.ts +11 -0
  36. package/dist/resources/guides.d.ts.map +1 -0
  37. package/dist/resources/guides.js +76 -0
  38. package/dist/resources/index.d.ts +8 -0
  39. package/dist/resources/index.d.ts.map +1 -0
  40. package/dist/resources/index.js +13 -0
  41. package/dist/resources/tokens.d.ts +17 -0
  42. package/dist/resources/tokens.d.ts.map +1 -0
  43. package/dist/resources/tokens.js +312 -0
  44. package/dist/server.d.ts +11 -0
  45. package/dist/server.d.ts.map +1 -0
  46. package/dist/server.js +30 -0
  47. package/dist/tools/component-tools.d.ts +12 -0
  48. package/dist/tools/component-tools.d.ts.map +1 -0
  49. package/dist/tools/component-tools.js +95 -0
  50. package/dist/tools/guide-tools.d.ts +9 -0
  51. package/dist/tools/guide-tools.d.ts.map +1 -0
  52. package/dist/tools/guide-tools.js +80 -0
  53. package/dist/tools/index.d.ts +8 -0
  54. package/dist/tools/index.d.ts.map +1 -0
  55. package/dist/tools/index.js +17 -0
  56. package/dist/tools/token-tools.d.ts +13 -0
  57. package/dist/tools/token-tools.d.ts.map +1 -0
  58. package/dist/tools/token-tools.js +207 -0
  59. package/dist/tools/utility-tools.d.ts +8 -0
  60. package/dist/tools/utility-tools.d.ts.map +1 -0
  61. package/dist/tools/utility-tools.js +293 -0
  62. package/dist/tools/validation-tools.d.ts +11 -0
  63. package/dist/tools/validation-tools.d.ts.map +1 -0
  64. package/dist/tools/validation-tools.js +60 -0
  65. package/package.json +54 -0
package/README.md ADDED
@@ -0,0 +1,235 @@
1
+ # @cobwds/mcp-server
2
+
3
+ MCP (Model Context Protocol) server for the City of Boston Web Design System. Exposes COBWDS components, design tokens, and documentation to AI assistants.
4
+
5
+ > [!WARNING]
6
+ > 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](https://bennypowers.dev/cem/docs/mcp/writing-descriptions/).
7
+
8
+ ## Getting Started
9
+
10
+ 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](https://nodejs.org/) (v18 or later) installed on your machine.
11
+
12
+ Jump to the configuration for your assistant:
13
+
14
+ - [GitHub Copilot](#github-copilot)
15
+ - [Claude Desktop](#claude-desktop)
16
+ - [Claude Code](#claude-code)
17
+ - [Cursor](#cursor)
18
+ - [Gemini CLI](#gemini-cli)
19
+
20
+ ### Using the Next Channel
21
+
22
+ To pull in the latest bleeding-edge changes before they hit the stable release, point to the `next` dist-tag by replacing `@cobwds/mcp-server` with `@cobwds/mcp-server@next` in any of the configurations below. For example:
23
+
24
+ ```json
25
+ "args": ["-y", "@cobwds/mcp-server@next"]
26
+ ```
27
+
28
+ To go back to stable, just remove `@next`.
29
+
30
+ > [!NOTE]
31
+ > Next releases may include breaking changes, incomplete features, or components not fully supported. They're useful for previewing upcoming work, but stick with the stable channel for production use.
32
+
33
+ ### Optional: Local Installation
34
+
35
+ If you prefer to install the server locally — for example, to use the [MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector) or to pin a specific version — you can install it globally:
36
+
37
+ ```bash
38
+ npm install -g @cobwds/mcp-server
39
+ cobwds-mcp
40
+ ```
41
+
42
+ Or run it directly without installing:
43
+
44
+ ```bash
45
+ npx -y @cobwds/mcp-server
46
+ ```
47
+
48
+ ## Local Development
49
+
50
+ If you're working on the COBWDS repo itself and want your changes reflected in the MCP server:
51
+
52
+ 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.
53
+ 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).
54
+
55
+ ```bash
56
+ # Fastest rebuild loop during MCP development
57
+ npm run build:link
58
+
59
+ # Then restart your AI assistant to pick up the changes
60
+ ```
61
+
62
+ ## Connecting to Your AI Assistant
63
+
64
+ 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.
65
+
66
+ ### GitHub Copilot
67
+
68
+ MCP support in GitHub Copilot is available in VS Code. Add to your VS Code settings or workspace `.vscode/mcp.json`:
69
+
70
+ ```json
71
+ {
72
+ "servers": {
73
+ "cobwds": {
74
+ "command": "npx",
75
+ "args": ["-y", "@cobwds/mcp-server"]
76
+ }
77
+ }
78
+ }
79
+ ```
80
+
81
+ See the [Copilot MCP documentation](https://docs.github.com/en/copilot/using-github-copilot/using-extensions-to-integrate-external-tools-with-copilot-chat) for the latest setup instructions.
82
+
83
+ ### Claude Desktop
84
+
85
+ Add to your Claude Desktop configuration:
86
+
87
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
88
+ - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
89
+
90
+ ```json
91
+ {
92
+ "mcpServers": {
93
+ "cobwds": {
94
+ "command": "npx",
95
+ "args": ["-y", "@cobwds/mcp-server"]
96
+ }
97
+ }
98
+ }
99
+ ```
100
+
101
+ ### Claude Code
102
+
103
+ Add to your project's `.mcp.json`:
104
+
105
+ ```json
106
+ {
107
+ "mcpServers": {
108
+ "cobwds": {
109
+ "command": "npx",
110
+ "args": ["-y", "@cobwds/mcp-server"]
111
+ }
112
+ }
113
+ }
114
+ ```
115
+
116
+ Or configure globally in `~/.claude/settings.json`.
117
+
118
+ ### Cursor
119
+
120
+ Add to your Cursor MCP settings (`.cursor/mcp.json`):
121
+
122
+ ```json
123
+ {
124
+ "mcpServers": {
125
+ "cobwds": {
126
+ "command": "npx",
127
+ "args": ["-y", "@cobwds/mcp-server"]
128
+ }
129
+ }
130
+ }
131
+ ```
132
+
133
+ ### Gemini CLI
134
+
135
+ Add to your Gemini CLI settings file (`~/.gemini/settings.json`) or your project's `.gemini/settings.json`:
136
+
137
+ ```json
138
+ {
139
+ "mcpServers": {
140
+ "cobwds": {
141
+ "command": "npx",
142
+ "args": ["-y", "@cobwds/mcp-server"]
143
+ }
144
+ }
145
+ }
146
+ ```
147
+
148
+ See the [Gemini CLI documentation](https://github.com/google-gemini/gemini-cli) for the latest setup instructions.
149
+
150
+ ## Available Tools
151
+
152
+ ### Components
153
+
154
+ | Tool | Description |
155
+ | ------------------------ | ------------------------------------------------------------------------------------------- |
156
+ | `find_components` | Search for components by name/description, or list all (omit query) |
157
+ | `get_component` | Full documentation for a specific component. Use `includeExamples: true` for code examples. |
158
+ | `validate_component_api` | Validate that attributes/properties are valid for a component |
159
+
160
+ ### Design Tokens
161
+
162
+ | Tool | Description |
163
+ | ----------------- | ---------------------------------------------------------------------- |
164
+ | `get_tokens` | Get tokens, categories, or agency themes. Filter by category or layer. |
165
+ | `find_tokens` | Search tokens by CSS variable name, value, or description |
166
+ | `get_token_info` | Detailed info for a specific token with optional context validation |
167
+ | `get_token_graph` | Token dependency graph showing references and usage |
168
+
169
+ ### Styles & Guides
170
+
171
+ | Tool | Description |
172
+ | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
173
+ | `get_utility_classes` | Grid, flexbox, spacing, display, and typography utility classes |
174
+ | `get_guide` | Guides for installation, forms, styles, fonts, page structure, or framework setup (angular, react, dotnet, drupal, vanilla). Angular, React, .NET, and Drupal guides are currently untested. |
175
+
176
+ ## Available Resources
177
+
178
+ | URI | Description |
179
+ | ------------------------- | ----------------------------------------------------- |
180
+ | `cobwds://components` | Component overview list |
181
+ | `cobwds://component/{tag}` | Individual component docs |
182
+ | `cobwds://tokens` | All design tokens with CSS variables and descriptions |
183
+ | `cobwds://tokens/css` | Raw tokens.css file content |
184
+ | `cobwds://tokens/graph` | Token dependency graph with stats |
185
+ | `cobwds://tokens/color` | Color tokens only |
186
+ | `cobwds://tokens/font` | Typography tokens |
187
+ | `cobwds://tokens/space` | Spacing tokens |
188
+ | `cobwds://tokens/size` | Size tokens |
189
+ | `cobwds://installation` | Installation guide |
190
+
191
+ ## Prompts
192
+
193
+ | Prompt | Description |
194
+ | ------------ | --------------------------------------- |
195
+ | `cobwds_mode` | Activates COBWDS-aware coding assistance |
196
+
197
+ ## Example Prompts
198
+
199
+ Once configured, you can ask your AI assistant to help you build real applications with the web design system.
200
+
201
+ **Building applications from requirements:**
202
+
203
+ > 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.
204
+
205
+ > 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.
206
+
207
+ **Scaffolding and setup:**
208
+
209
+ > 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.
210
+
211
+ > I have an existing .NET Razor Pages app. Walk me through integrating COBWDS components into it step by step.
212
+
213
+ **Building pages and features:**
214
+
215
+ > 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.
216
+
217
+ > 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.
218
+
219
+ **Working with design tokens and theming:**
220
+
221
+ > 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.
222
+
223
+ > Show me all the spacing tokens available and explain the scale. Then refactor this layout to use COBWDS spacing tokens instead of hardcoded values.
224
+
225
+ **Code review and validation:**
226
+
227
+ > Review this HTML page and identify everywhere I'm using COBWDS components incorrectly — wrong attributes, missing required properties, or deprecated patterns.
228
+
229
+ > 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.
230
+
231
+ **Exploring the system:**
232
+
233
+ > What COBWDS components are available for forms? Show me the documentation for each one with code examples.
234
+
235
+ > Show me the token dependency graph for the primary color. I want to understand how the base, semantic, and component layers connect.