@nysds/mcp-server 1.0.0
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.
- package/README.md +169 -0
- package/data/guides/.gitkeep +0 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# @nysds/mcp-server
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server for the New York State Design System. Exposes NYSDS components, design tokens, and documentation to AI assistants.
|
|
4
|
+
|
|
5
|
+
> [!WARNING]
|
|
6
|
+
> This MCP server is a work-in-progress and the current results are incomplete or inaccurate. The server is functional, but the quality of the output depends on the robustness of the underlying documentation, which requires some updating. Our team is in the process of migrating design tokens to the [DTCG 2025.10 format](https://www.designtokens.org/tr/2025.10/format/) (will be @nysds/tokens) and 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/). AI results should improve significantly as tokens and improved documentation rolls out.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
> [!CAUTION]
|
|
11
|
+
> This package is not yet published to npm. You must clone the repository and build locally until it is.
|
|
12
|
+
|
|
13
|
+
Once it's cloned, run this command from the `/packages/mcp-server` directory:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Clone the repository
|
|
17
|
+
git clone https://github.com/ITS-HCD/nysds nysds-mcp
|
|
18
|
+
cd nysds-mcp
|
|
19
|
+
|
|
20
|
+
# Switch to the MCP feature branch
|
|
21
|
+
git checkout feature/mcp-server
|
|
22
|
+
|
|
23
|
+
# Install dependencies (from repo root)
|
|
24
|
+
npm install
|
|
25
|
+
|
|
26
|
+
# Build the MCP server
|
|
27
|
+
npm run build --workspace=packages/mcp-server
|
|
28
|
+
|
|
29
|
+
# Explore the MCP server with the MCP inspector
|
|
30
|
+
cd packages
|
|
31
|
+
npx @modelcontextprotocol/inspector node dist/index.js
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Connecting to the MCP Server
|
|
35
|
+
|
|
36
|
+
Once the MCP server is set up and built, your AI code assistant can automatically connect and communicate with it. You only need to set up the configuration. 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 will automatically connect and use the available tools.
|
|
37
|
+
|
|
38
|
+
> [!NOTE]
|
|
39
|
+
> The "args" in these examples will change after the package is published to npm.
|
|
40
|
+
|
|
41
|
+
### GitHub Copilot
|
|
42
|
+
|
|
43
|
+
MCP support in GitHub Copilot is available in VS Code. Add to your VS Code settings or workspace `.vscode/mcp.json`:
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"servers": {
|
|
48
|
+
"nysds": {
|
|
49
|
+
"command": "node",
|
|
50
|
+
"args": ["/absolute/path/to/nysds-mcp/packages/mcp-server/dist/index.js"]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
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.
|
|
57
|
+
|
|
58
|
+
### Claude Desktop
|
|
59
|
+
|
|
60
|
+
Add to your Claude Desktop configuration:
|
|
61
|
+
|
|
62
|
+
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
|
|
63
|
+
- Windows: %APPDATA%\Claude\claude_desktop_config.json
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"mcpServers": {
|
|
68
|
+
"nysds": {
|
|
69
|
+
"command": "node",
|
|
70
|
+
"args": ["/absolute/path/to/nysds-mcp/packages/mcp-server/dist/index.js"]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Claude Code
|
|
77
|
+
|
|
78
|
+
Add to your project's `.mcp.json`:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"mcpServers": {
|
|
83
|
+
"nysds": {
|
|
84
|
+
"command": "node",
|
|
85
|
+
"args": ["/absolute/path/to/nysds-mcp/packages/mcp-server/dist/index.js"]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Or configure globally in `~/.claude/settings.json`.
|
|
92
|
+
|
|
93
|
+
### Cursor
|
|
94
|
+
|
|
95
|
+
Add to your Cursor MCP settings (`.cursor/mcp.json`):
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"mcpServers": {
|
|
100
|
+
"nysds": {
|
|
101
|
+
"command": "node",
|
|
102
|
+
"args": ["/absolute/path/to/nysds-mcp/packages/mcp-server/dist/index.js"]
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Available Tools
|
|
109
|
+
|
|
110
|
+
### P0 (Core)
|
|
111
|
+
|
|
112
|
+
| Tool | Description |
|
|
113
|
+
|------|-------------|
|
|
114
|
+
| `list_components` | List all NYSDS components with summaries |
|
|
115
|
+
| `get_component_docs` | Full documentation for a specific component |
|
|
116
|
+
| `find_components` | Search components by name/description |
|
|
117
|
+
| `get_design_tokens` | Get token values by category |
|
|
118
|
+
| `get_usage_guide` | Installation and usage patterns |
|
|
119
|
+
|
|
120
|
+
### P1 (Extended)
|
|
121
|
+
|
|
122
|
+
| Tool | Description |
|
|
123
|
+
|------|-------------|
|
|
124
|
+
| `validate_component_api` | Validate prop/attribute usage |
|
|
125
|
+
| `setup_framework` | Framework-specific setup guides |
|
|
126
|
+
| `find_tokens` | Search tokens by name/value |
|
|
127
|
+
|
|
128
|
+
## Available Resources
|
|
129
|
+
|
|
130
|
+
| URI | Description |
|
|
131
|
+
|-----|-------------|
|
|
132
|
+
| `nysds://components` | Component overview list |
|
|
133
|
+
| `nysds://component/{tag}` | Individual component docs |
|
|
134
|
+
| `nysds://tokens` | All design tokens |
|
|
135
|
+
| `nysds://installation` | Installation guide |
|
|
136
|
+
|
|
137
|
+
## Prompts
|
|
138
|
+
|
|
139
|
+
| Prompt | Description |
|
|
140
|
+
|--------|-------------|
|
|
141
|
+
| `nysds_mode` | Activates NYSDS-aware coding assistance |
|
|
142
|
+
|
|
143
|
+
## Example Prompts
|
|
144
|
+
|
|
145
|
+
Once configured, you can ask your AI assistant questions like:
|
|
146
|
+
|
|
147
|
+
**Discovering components:**
|
|
148
|
+
- "What NYSDS components are available for forms?"
|
|
149
|
+
- "Show me the documentation for the nys-button component"
|
|
150
|
+
- "What properties does nys-alert support?"
|
|
151
|
+
|
|
152
|
+
**Building UI:**
|
|
153
|
+
- "Create a contact form using NYSDS components with fields for name, email, and message"
|
|
154
|
+
- "Build a page header with the global header component and navigation"
|
|
155
|
+
- "Add form validation to this input using NYSDS error message components"
|
|
156
|
+
|
|
157
|
+
**Working with tokens:**
|
|
158
|
+
- "What color tokens are available in NYSDS?"
|
|
159
|
+
- "Show me the spacing tokens I should use for consistent layouts"
|
|
160
|
+
- "What's the correct token for the primary brand color?"
|
|
161
|
+
|
|
162
|
+
**Framework integration:**
|
|
163
|
+
- "How do I set up NYSDS components in my Angular project?"
|
|
164
|
+
- "Show me how to use nys-button in React"
|
|
165
|
+
- "What's the recommended way to integrate NYSDS with Vue?"
|
|
166
|
+
|
|
167
|
+
**Code review:**
|
|
168
|
+
- "Is this the correct way to use the nys-select component?"
|
|
169
|
+
- "Check if I'm using valid attributes on this nys-checkbox"
|
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nysds/mcp-server",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for the New York State Design System. Exposes components, tokens, and documentation to AI assistants.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"nysds-mcp": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist/",
|
|
19
|
+
"data/"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc",
|
|
23
|
+
"dev": "tsc --watch",
|
|
24
|
+
"start": "node dist/index.js",
|
|
25
|
+
"inspect": "npx @modelcontextprotocol/inspector node dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^22.0.0",
|
|
32
|
+
"typescript": "^5.9.3"
|
|
33
|
+
},
|
|
34
|
+
"keywords": [
|
|
35
|
+
"mcp",
|
|
36
|
+
"model-context-protocol",
|
|
37
|
+
"new-york-state",
|
|
38
|
+
"design-system",
|
|
39
|
+
"web-components",
|
|
40
|
+
"ai-assistant"
|
|
41
|
+
],
|
|
42
|
+
"author": "New York State Design System Team",
|
|
43
|
+
"license": "MIT",
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "git+https://github.com/ITS-HCD/nysds.git",
|
|
47
|
+
"directory": "packages/mcp-server"
|
|
48
|
+
}
|
|
49
|
+
}
|