@triptease/design-system-mcp 0.0.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.
- package/CHANGELOG.md +26 -0
- package/README.md +340 -0
- package/dist/package.json +41 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +39 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/manifests/components/entries/badge.d.ts +27 -0
- package/dist/src/manifests/components/entries/badge.js +43 -0
- package/dist/src/manifests/components/entries/badge.js.map +1 -0
- package/dist/src/manifests/components/entries/barChart.d.ts +73 -0
- package/dist/src/manifests/components/entries/barChart.js +125 -0
- package/dist/src/manifests/components/entries/barChart.js.map +1 -0
- package/dist/src/manifests/components/entries/button.d.ts +40 -0
- package/dist/src/manifests/components/entries/button.js +59 -0
- package/dist/src/manifests/components/entries/button.js.map +1 -0
- package/dist/src/manifests/components/entries/card.d.ts +20 -0
- package/dist/src/manifests/components/entries/card.js +34 -0
- package/dist/src/manifests/components/entries/card.js.map +1 -0
- package/dist/src/manifests/components/entries/checkbox.d.ts +31 -0
- package/dist/src/manifests/components/entries/checkbox.js +64 -0
- package/dist/src/manifests/components/entries/checkbox.js.map +1 -0
- package/dist/src/manifests/components/entries/combobox.d.ts +64 -0
- package/dist/src/manifests/components/entries/combobox.js +176 -0
- package/dist/src/manifests/components/entries/combobox.js.map +1 -0
- package/dist/src/manifests/components/entries/datePicker.d.ts +34 -0
- package/dist/src/manifests/components/entries/datePicker.js +67 -0
- package/dist/src/manifests/components/entries/datePicker.js.map +1 -0
- package/dist/src/manifests/components/entries/dateRangePicker.d.ts +34 -0
- package/dist/src/manifests/components/entries/dateRangePicker.js +110 -0
- package/dist/src/manifests/components/entries/dateRangePicker.js.map +1 -0
- package/dist/src/manifests/components/entries/dialog.d.ts +38 -0
- package/dist/src/manifests/components/entries/dialog.js +73 -0
- package/dist/src/manifests/components/entries/dialog.js.map +1 -0
- package/dist/src/manifests/components/entries/lineChart.d.ts +76 -0
- package/dist/src/manifests/components/entries/lineChart.js +141 -0
- package/dist/src/manifests/components/entries/lineChart.js.map +1 -0
- package/dist/src/manifests/components/entries/numberinput.d.ts +52 -0
- package/dist/src/manifests/components/entries/numberinput.js +64 -0
- package/dist/src/manifests/components/entries/numberinput.js.map +1 -0
- package/dist/src/manifests/components/entries/radio.d.ts +31 -0
- package/dist/src/manifests/components/entries/radio.js +50 -0
- package/dist/src/manifests/components/entries/radio.js.map +1 -0
- package/dist/src/manifests/components/entries/select.d.ts +16 -0
- package/dist/src/manifests/components/entries/select.js +23 -0
- package/dist/src/manifests/components/entries/select.js.map +1 -0
- package/dist/src/manifests/components/entries/table.d.ts +16 -0
- package/dist/src/manifests/components/entries/table.js +43 -0
- package/dist/src/manifests/components/entries/table.js.map +1 -0
- package/dist/src/manifests/components/entries/textarea.d.ts +40 -0
- package/dist/src/manifests/components/entries/textarea.js +54 -0
- package/dist/src/manifests/components/entries/textarea.js.map +1 -0
- package/dist/src/manifests/components/entries/textinput.d.ts +40 -0
- package/dist/src/manifests/components/entries/textinput.js +53 -0
- package/dist/src/manifests/components/entries/textinput.js.map +1 -0
- package/dist/src/manifests/components/entries/toggle.d.ts +23 -0
- package/dist/src/manifests/components/entries/toggle.js +30 -0
- package/dist/src/manifests/components/entries/toggle.js.map +1 -0
- package/dist/src/manifests/components/entries/typography.d.ts +23 -0
- package/dist/src/manifests/components/entries/typography.js +32 -0
- package/dist/src/manifests/components/entries/typography.js.map +1 -0
- package/dist/src/manifests/components/index.d.ts +2 -0
- package/dist/src/manifests/components/index.js +39 -0
- package/dist/src/manifests/components/index.js.map +1 -0
- package/dist/src/manifests/components/types.d.ts +56 -0
- package/dist/src/manifests/components/types.js +2 -0
- package/dist/src/manifests/components/types.js.map +1 -0
- package/dist/src/tools/getCSSTokens/handler.d.ts +6 -0
- package/dist/src/tools/getCSSTokens/handler.js +29 -0
- package/dist/src/tools/getCSSTokens/handler.js.map +1 -0
- package/dist/src/tools/getCSSTokens/index.d.ts +12 -0
- package/dist/src/tools/getCSSTokens/index.js +14 -0
- package/dist/src/tools/getCSSTokens/index.js.map +1 -0
- package/dist/src/tools/getCSSTokens/utils.d.ts +5 -0
- package/dist/src/tools/getCSSTokens/utils.js +25 -0
- package/dist/src/tools/getCSSTokens/utils.js.map +1 -0
- package/dist/src/tools/getComponentDocs/handler.d.ts +6 -0
- package/dist/src/tools/getComponentDocs/handler.js +27 -0
- package/dist/src/tools/getComponentDocs/handler.js.map +1 -0
- package/dist/src/tools/getComponentDocs/index.d.ts +12 -0
- package/dist/src/tools/getComponentDocs/index.js +14 -0
- package/dist/src/tools/getComponentDocs/index.js.map +1 -0
- package/dist/src/tools/getSetupGuide/handler.d.ts +6 -0
- package/dist/src/tools/getSetupGuide/handler.js +50 -0
- package/dist/src/tools/getSetupGuide/handler.js.map +1 -0
- package/dist/src/tools/getSetupGuide/index.d.ts +12 -0
- package/dist/src/tools/getSetupGuide/index.js +17 -0
- package/dist/src/tools/getSetupGuide/index.js.map +1 -0
- package/dist/src/tools/getSetupGuide/setupGuides.d.ts +12 -0
- package/dist/src/tools/getSetupGuide/setupGuides.js +49 -0
- package/dist/src/tools/getSetupGuide/setupGuides.js.map +1 -0
- package/dist/src/tools/listCSSTokens/handler.d.ts +3 -0
- package/dist/src/tools/listCSSTokens/handler.js +20 -0
- package/dist/src/tools/listCSSTokens/handler.js.map +1 -0
- package/dist/src/tools/listCSSTokens/index.d.ts +8 -0
- package/dist/src/tools/listCSSTokens/index.js +10 -0
- package/dist/src/tools/listCSSTokens/index.js.map +1 -0
- package/dist/src/tools/listComponents/handler.d.ts +3 -0
- package/dist/src/tools/listComponents/handler.js +18 -0
- package/dist/src/tools/listComponents/handler.js.map +1 -0
- package/dist/src/tools/listComponents/index.d.ts +9 -0
- package/dist/src/tools/listComponents/index.js +11 -0
- package/dist/src/tools/listComponents/index.js.map +1 -0
- package/dist/src/tools/searchComponents/handler.d.ts +6 -0
- package/dist/src/tools/searchComponents/handler.js +29 -0
- package/dist/src/tools/searchComponents/handler.js.map +1 -0
- package/dist/src/tools/searchComponents/index.d.ts +12 -0
- package/dist/src/tools/searchComponents/index.js +14 -0
- package/dist/src/tools/searchComponents/index.js.map +1 -0
- package/dist/src/utils/buildCDNUrls.d.ts +3 -0
- package/dist/src/utils/buildCDNUrls.js +6 -0
- package/dist/src/utils/buildCDNUrls.js.map +1 -0
- package/package.json +43 -0
- package/src/index.ts +46 -0
- package/src/manifests/components/entries/badge.ts +45 -0
- package/src/manifests/components/entries/barChart.ts +132 -0
- package/src/manifests/components/entries/button.ts +61 -0
- package/src/manifests/components/entries/card.ts +35 -0
- package/src/manifests/components/entries/checkbox.ts +68 -0
- package/src/manifests/components/entries/combobox.ts +184 -0
- package/src/manifests/components/entries/datePicker.ts +73 -0
- package/src/manifests/components/entries/dateRangePicker.ts +118 -0
- package/src/manifests/components/entries/dialog.ts +77 -0
- package/src/manifests/components/entries/lineChart.ts +150 -0
- package/src/manifests/components/entries/numberinput.ts +66 -0
- package/src/manifests/components/entries/radio.ts +53 -0
- package/src/manifests/components/entries/select.ts +24 -0
- package/src/manifests/components/entries/table.ts +44 -0
- package/src/manifests/components/entries/textarea.ts +56 -0
- package/src/manifests/components/entries/textinput.ts +55 -0
- package/src/manifests/components/entries/toggle.ts +31 -0
- package/src/manifests/components/entries/typography.ts +33 -0
- package/src/manifests/components/index.ts +41 -0
- package/src/manifests/components/types.ts +64 -0
- package/src/tools/getCSSTokens/__snapshots__/handler.test.ts.snap +78 -0
- package/src/tools/getCSSTokens/handler.test.ts +39 -0
- package/src/tools/getCSSTokens/handler.ts +36 -0
- package/src/tools/getCSSTokens/index.ts +15 -0
- package/src/tools/getCSSTokens/utils.ts +31 -0
- package/src/tools/getComponentDocs/__snapshots__/handler.test.ts.snap +23 -0
- package/src/tools/getComponentDocs/handler.test.ts +14 -0
- package/src/tools/getComponentDocs/handler.ts +34 -0
- package/src/tools/getComponentDocs/index.ts +15 -0
- package/src/tools/getSetupGuide/__snapshots__/handler.test.ts.snap +34 -0
- package/src/tools/getSetupGuide/handler.test.ts +20 -0
- package/src/tools/getSetupGuide/handler.ts +59 -0
- package/src/tools/getSetupGuide/index.ts +20 -0
- package/src/tools/getSetupGuide/setupGuides.ts +62 -0
- package/src/tools/listCSSTokens/__snapshots__/handler.test.ts.snap +12 -0
- package/src/tools/listCSSTokens/handler.test.ts +9 -0
- package/src/tools/listCSSTokens/handler.ts +32 -0
- package/src/tools/listCSSTokens/index.ts +12 -0
- package/src/tools/listComponents/__snapshots__/handler.test.ts.snap +12 -0
- package/src/tools/listComponents/handler.test.ts +9 -0
- package/src/tools/listComponents/handler.ts +20 -0
- package/src/tools/listComponents/index.ts +12 -0
- package/src/tools/searchComponents/__snapshots__/handler.test.ts.snap +23 -0
- package/src/tools/searchComponents/handler.test.ts +14 -0
- package/src/tools/searchComponents/handler.ts +36 -0
- package/src/tools/searchComponents/index.ts +15 -0
- package/src/utils/buildCDNUrls.ts +7 -0
- package/tsconfig.json +12 -0
- package/vitest.config.ts +6 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# @triptease/design-system-mcp
|
|
2
|
+
|
|
3
|
+
## 0.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @triptease/tt-data-point@1.0.1
|
|
9
|
+
- @triptease/tt-highlight@1.0.1
|
|
10
|
+
- @triptease/tt-dataset@1.0.2
|
|
11
|
+
- @triptease/tt-bar-chart@1.0.2
|
|
12
|
+
- @triptease/tt-line-chart@1.0.7
|
|
13
|
+
|
|
14
|
+
## 0.0.2
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
- @triptease/tt-line-chart@1.0.6
|
|
20
|
+
|
|
21
|
+
## 0.0.1
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
- @triptease/stylesheet@1.4.1
|
package/README.md
ADDED
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
# Triptease Design System MCP Server
|
|
2
|
+
|
|
3
|
+
Model Context Protocol (MCP) server that provides programmatic access to Triptease design system documentation, componentManifest, and tokens.
|
|
4
|
+
|
|
5
|
+
## What is this?
|
|
6
|
+
|
|
7
|
+
This MCP server enables Claude Code and other MCP-compatible tools to query design system information directly. Instead of manually looking up component documentation or design tokens, you can ask Claude to retrieve this information for you.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
### Prerequisites
|
|
12
|
+
|
|
13
|
+
- Node.js 18+
|
|
14
|
+
- Yarn
|
|
15
|
+
|
|
16
|
+
### Building
|
|
17
|
+
|
|
18
|
+
From this directory:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
yarn install
|
|
22
|
+
yarn build
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
This will compile the TypeScript source to JavaScript in the `dist/` directory.
|
|
26
|
+
|
|
27
|
+
## Configuration
|
|
28
|
+
|
|
29
|
+
### Claude Code CLI (Recommended)
|
|
30
|
+
|
|
31
|
+
Use the Claude Code CLI to install the MCP server globally for all your projects:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
claude mcp add --scope user --transport stdio triptease-design-system -- \
|
|
35
|
+
node /absolute/path/to/component-library/packages/design-system-mcp/dist/src/index.js
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Important:** Replace `/absolute/path/to/component-library` with the actual path (e.g., `/Users/yourname/repos/component-library`)
|
|
39
|
+
|
|
40
|
+
**Verify installation:**
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# List all MCP servers
|
|
44
|
+
claude mcp list
|
|
45
|
+
|
|
46
|
+
# Should show: triptease-design-system: ... - ✓ Connected
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Restart Claude Code** after installation. The design system tools will now be available in all your sessions.
|
|
50
|
+
|
|
51
|
+
**Management commands:**
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Remove the server
|
|
55
|
+
claude mcp remove triptease-design-system
|
|
56
|
+
|
|
57
|
+
# Get server details
|
|
58
|
+
claude mcp get triptease-design-system
|
|
59
|
+
|
|
60
|
+
# Check status within Claude Code
|
|
61
|
+
/mcp
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Claude Desktop (GUI Application)
|
|
65
|
+
|
|
66
|
+
For the Claude Desktop application, manually edit the configuration file:
|
|
67
|
+
|
|
68
|
+
**Configuration file locations:**
|
|
69
|
+
|
|
70
|
+
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
71
|
+
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
72
|
+
|
|
73
|
+
**Add to the configuration file:**
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"mcpServers": {
|
|
78
|
+
"triptease-design-system": {
|
|
79
|
+
"command": "node",
|
|
80
|
+
"args": ["/absolute/path/to/component-library/design-system-mcp/dist/index.js"]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**macOS example:**
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"mcpServers": {
|
|
91
|
+
"triptease-design-system": {
|
|
92
|
+
"command": "node",
|
|
93
|
+
"args": ["/Users/yourname/repos/component-library/design-system-mcp/dist/index.js"]
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Windows example:**
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"mcpServers": {
|
|
104
|
+
"triptease-design-system": {
|
|
105
|
+
"command": "node",
|
|
106
|
+
"args": ["C:\\Users\\yourname\\repos\\component-library\\design-system-mcp\\dist\\index.js"]
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
> [!IMPORTANT]
|
|
113
|
+
> Use absolute paths, not relative paths. After saving the configuration, restart Claude Desktop completely.
|
|
114
|
+
|
|
115
|
+
#### Usage with NVM
|
|
116
|
+
|
|
117
|
+
If Claude Desktop has issues starting the MCP servers due to resolving the wrong `nvm`-managed node version, replace the command with the absolute path to the `nvm`-managed node version, e.g. in MacOS:
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"mcpServers": {
|
|
122
|
+
"triptease-design-system": {
|
|
123
|
+
"command": "/Users/yourname/.nvm/versions/node/v24.11.1/bin/node",
|
|
124
|
+
"args": ["/Users/yourname/repos/component-library/design-system-mcp/dist/index.js"]
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Per-Project Installation
|
|
131
|
+
|
|
132
|
+
To enable the server for a specific project only (works with both Claude Code and Claude Desktop):
|
|
133
|
+
|
|
134
|
+
**Claude Code CLI:**
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Install for current project only (default scope)
|
|
138
|
+
claude mcp add --transport stdio triptease-design-system -- \
|
|
139
|
+
node /absolute/path/to/component-library/design-system-mcp/dist/index.js
|
|
140
|
+
|
|
141
|
+
# Or install for team sharing (committed to version control)
|
|
142
|
+
claude mcp add --scope project --transport stdio triptease-design-system -- \
|
|
143
|
+
node /absolute/path/to/component-library/design-system-mcp/dist/index.js
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Manual configuration:**
|
|
147
|
+
|
|
148
|
+
Create or edit `.mcp.json` in your project root:
|
|
149
|
+
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"mcpServers": {
|
|
153
|
+
"triptease-design-system": {
|
|
154
|
+
"command": "node",
|
|
155
|
+
"args": ["<path-to-component-library>/design-system-mcp/dist/index.js"]
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Replace `<path-to-component-library>` with the relative or absolute path to the component-library repository.
|
|
162
|
+
|
|
163
|
+
## Available Tools
|
|
164
|
+
|
|
165
|
+
The MCP server provides 4 tools:
|
|
166
|
+
|
|
167
|
+
### 1. `get_component_docs`
|
|
168
|
+
|
|
169
|
+
Get detailed documentation for a specific component.
|
|
170
|
+
|
|
171
|
+
**Parameters:**
|
|
172
|
+
|
|
173
|
+
- `component` (string, required): Component name (e.g., 'button', 'input', 'badge', 'checkbox', 'card')
|
|
174
|
+
|
|
175
|
+
**Returns:** JSON with complete component documentation including usage guidance, attributes, states, examples, and design tokens.
|
|
176
|
+
|
|
177
|
+
**Example usage with Claude:**
|
|
178
|
+
|
|
179
|
+
> "Get me the documentation for the button component"
|
|
180
|
+
|
|
181
|
+
### 2. `list_components`
|
|
182
|
+
|
|
183
|
+
List all available design system componentManifest.
|
|
184
|
+
|
|
185
|
+
**Parameters:** None
|
|
186
|
+
|
|
187
|
+
**Returns:** JSON array of componentManifest with name, description, and element type.
|
|
188
|
+
|
|
189
|
+
**Example usage with Claude:**
|
|
190
|
+
|
|
191
|
+
> "What componentManifest are available in the design system?"
|
|
192
|
+
|
|
193
|
+
### 3. `get_design_tokens`
|
|
194
|
+
|
|
195
|
+
Get design tokens by category.
|
|
196
|
+
|
|
197
|
+
**Parameters:**
|
|
198
|
+
|
|
199
|
+
- `category` (string, required): One of 'colors', 'spacing', 'typography', 'shadows', 'all'
|
|
200
|
+
|
|
201
|
+
**Returns:** JSON object with design tokens organized by category.
|
|
202
|
+
|
|
203
|
+
**Example usage with Claude:**
|
|
204
|
+
|
|
205
|
+
> "Show me all the color tokens in the design system"
|
|
206
|
+
> "What spacing tokens are available?"
|
|
207
|
+
|
|
208
|
+
### 4. `search_components`
|
|
209
|
+
|
|
210
|
+
Search for componentManifest by keyword.
|
|
211
|
+
|
|
212
|
+
**Parameters:**
|
|
213
|
+
|
|
214
|
+
- `query` (string, required): Search term to find in component names and descriptions
|
|
215
|
+
|
|
216
|
+
**Returns:** JSON with search results including matched componentManifest.
|
|
217
|
+
|
|
218
|
+
**Example usage with Claude:**
|
|
219
|
+
|
|
220
|
+
> "Search for form-related componentManifest"
|
|
221
|
+
> "Find componentManifest for status indicators"
|
|
222
|
+
|
|
223
|
+
## Usage Examples
|
|
224
|
+
|
|
225
|
+
Once configured, you can interact with the MCP server naturally through Claude Code:
|
|
226
|
+
|
|
227
|
+
**Getting component documentation:**
|
|
228
|
+
|
|
229
|
+
```text
|
|
230
|
+
You: "How do I create a destructive button?"
|
|
231
|
+
Claude: [Uses get_component_docs to fetch button documentation]
|
|
232
|
+
"Here's how to create a destructive button:
|
|
233
|
+
<button data-theme="destructive-primary">Delete</button>"
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
**Exploring design tokens:**
|
|
237
|
+
|
|
238
|
+
```text
|
|
239
|
+
You: "What color should I use for error states?"
|
|
240
|
+
Claude: [Uses get_design_tokens with category="colors"]
|
|
241
|
+
"For error states, use the alert color tokens:
|
|
242
|
+
- --color-alert-400 for primary error color
|
|
243
|
+
- --color-alert-100 for error backgrounds"
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
**Finding componentManifest:**
|
|
247
|
+
|
|
248
|
+
```text
|
|
249
|
+
You: "What can I use to show validation errors?"
|
|
250
|
+
Claude: [Uses search_components with query="validation"]
|
|
251
|
+
"The Input component supports validation styling via aria-invalid..."
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## Architecture
|
|
255
|
+
|
|
256
|
+
- **Transport**: StdioServerTransport (local, on-demand)
|
|
257
|
+
- **Token Source**: `../../packages/stylesheet/dist/web/tokens.json` (relative to compiled dist directory)
|
|
258
|
+
- **Components**: Component manifest in `src/componentManifest.ts` (button, input, badge, checkbox, card)
|
|
259
|
+
- **Response Format**: JSON for all tool responses
|
|
260
|
+
|
|
261
|
+
## Maintenance
|
|
262
|
+
|
|
263
|
+
### Adding New Components
|
|
264
|
+
|
|
265
|
+
Edit `src/componentManifest.ts` and add new component definitions to the `componentManifest` object. Each component should include:
|
|
266
|
+
|
|
267
|
+
```typescript
|
|
268
|
+
componentName: {
|
|
269
|
+
name: "Component Name",
|
|
270
|
+
description: "Brief description",
|
|
271
|
+
element: "html-element",
|
|
272
|
+
usageGuidance: {
|
|
273
|
+
whenToUse: ["..."],
|
|
274
|
+
bestPractices: ["..."],
|
|
275
|
+
accessibility: ["..."],
|
|
276
|
+
avoid: ["..."]
|
|
277
|
+
},
|
|
278
|
+
dataAttributes: { /* optional */ },
|
|
279
|
+
classes: { /* optional */ },
|
|
280
|
+
attributes: { /* optional */ },
|
|
281
|
+
states: [ /* optional */ ],
|
|
282
|
+
examples: [
|
|
283
|
+
{
|
|
284
|
+
title: "Example name",
|
|
285
|
+
code: `<html example code>`
|
|
286
|
+
}
|
|
287
|
+
],
|
|
288
|
+
tokens: ["--token-1", "--token-2"]
|
|
289
|
+
}
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
After making changes:
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
yarn build
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## Troubleshooting
|
|
299
|
+
|
|
300
|
+
**"Failed to load tokens.json" error:**
|
|
301
|
+
|
|
302
|
+
- Ensure `tokens.json` exists at `packages/stylesheet/dist/web/tokens.json`
|
|
303
|
+
- Try rebuilding the stylesheet package: `cd packages/stylesheet && yarn build`
|
|
304
|
+
|
|
305
|
+
**Server not appearing in Claude Code:**
|
|
306
|
+
|
|
307
|
+
_For Claude Code CLI:_
|
|
308
|
+
|
|
309
|
+
- Run `claude mcp list` to verify the server is installed
|
|
310
|
+
- Check that the server shows `✓ Connected` status
|
|
311
|
+
- If not installed, run the installation command again
|
|
312
|
+
- Restart Claude Code after installation
|
|
313
|
+
- Check logs: `~/.claude/debug/*.txt` for error messages
|
|
314
|
+
|
|
315
|
+
_For Claude Desktop:_
|
|
316
|
+
|
|
317
|
+
- Verify the configuration file exists at the correct location
|
|
318
|
+
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
319
|
+
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
320
|
+
- Check that the path to `dist/index.js` is correct and absolute
|
|
321
|
+
- Verify JSON syntax is valid (no trailing commas, proper quotes)
|
|
322
|
+
- Restart Claude Desktop completely (not just reload)
|
|
323
|
+
- Check logs: `~/Library/Logs/Claude/mcp*.log` (macOS) or `%APPDATA%\Claude\logs` (Windows)
|
|
324
|
+
|
|
325
|
+
_For project-level installation:_
|
|
326
|
+
|
|
327
|
+
- Verify `.mcp.json` exists in your project root
|
|
328
|
+
- Check that the path to `dist/index.js` is correct
|
|
329
|
+
- Restart after configuration changes
|
|
330
|
+
|
|
331
|
+
**Tool calls failing:**
|
|
332
|
+
|
|
333
|
+
- Ensure the build completed successfully (`yarn build`)
|
|
334
|
+
- Check Node.js version is 18+
|
|
335
|
+
- Verify no TypeScript compilation errors
|
|
336
|
+
|
|
337
|
+
## Related
|
|
338
|
+
|
|
339
|
+
- **Design System Documentation**: For design system patterns and usage, see the main component library README
|
|
340
|
+
- **MCP Protocol**: https://modelcontextprotocol.io/
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"private": true,
|
|
3
|
+
"name": "@triptease/design-system-mcp",
|
|
4
|
+
"version": "0.0.3",
|
|
5
|
+
"description": "MCP server for Triptease design system documentation",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"bin": "./dist/index.js",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "rm -rf dist && tsc && tsc-alias",
|
|
11
|
+
"dev": "tsc --watch",
|
|
12
|
+
"start": "node dist/index.js",
|
|
13
|
+
"test": "vitest run",
|
|
14
|
+
"test:watch": "vitest"
|
|
15
|
+
},
|
|
16
|
+
"author": "Triptease",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=18.0.0"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@modelcontextprotocol/sdk": "^1.0.4",
|
|
23
|
+
"@triptease/stylesheet": "1.4.1",
|
|
24
|
+
"@triptease/tt-bar-chart": "1.0.2",
|
|
25
|
+
"@triptease/tt-combobox": "5.6.5",
|
|
26
|
+
"@triptease/tt-data-point": "1.0.1",
|
|
27
|
+
"@triptease/tt-dataset": "1.0.2",
|
|
28
|
+
"@triptease/tt-date-picker": "6.1.2",
|
|
29
|
+
"@triptease/tt-date-range-picker": "6.2.3",
|
|
30
|
+
"@triptease/tt-dialog": "5.1.1",
|
|
31
|
+
"@triptease/tt-highlight": "1.0.1",
|
|
32
|
+
"@triptease/tt-line-chart": "1.0.7",
|
|
33
|
+
"zod": "^4.3.6"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"tsc-alias": "^1.8.16",
|
|
37
|
+
"typescript": "^5.7.2",
|
|
38
|
+
"vite-tsconfig-paths": "^6.0.5",
|
|
39
|
+
"vitest": "^4.0.18"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import packageJson from './../package.json' with { type: 'json' };
|
|
5
|
+
import getComponentDocsTool from './tools/getComponentDocs/index.js';
|
|
6
|
+
import listComponentsTool from './tools/listComponents/index.js';
|
|
7
|
+
import getDesignTokensTool from './tools/getCSSTokens/index.js';
|
|
8
|
+
import searchComponentsTool from './tools/searchComponents/index.js';
|
|
9
|
+
import getSetupGuideTool from './tools/getSetupGuide/index.js';
|
|
10
|
+
import listCSSTokens from './tools/listCSSTokens/index.js';
|
|
11
|
+
// Initialize MCP server
|
|
12
|
+
const server = new McpServer({
|
|
13
|
+
name: 'Triptease Design System MCP Server',
|
|
14
|
+
version: packageJson.version,
|
|
15
|
+
description: packageJson.description,
|
|
16
|
+
}, {
|
|
17
|
+
capabilities: {
|
|
18
|
+
tools: {},
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
// Register getComponentDocsTool definitions
|
|
22
|
+
server.registerTool(getComponentDocsTool.name, getComponentDocsTool.config, getComponentDocsTool.handler);
|
|
23
|
+
server.registerTool(listComponentsTool.name, listComponentsTool.config, listComponentsTool.handler);
|
|
24
|
+
server.registerTool(getDesignTokensTool.name, getDesignTokensTool.config, getDesignTokensTool.handler);
|
|
25
|
+
server.registerTool(searchComponentsTool.name, searchComponentsTool.config, searchComponentsTool.handler);
|
|
26
|
+
server.registerTool(getSetupGuideTool.name, getSetupGuideTool.config, getSetupGuideTool.handler);
|
|
27
|
+
server.registerTool(listCSSTokens.name, listCSSTokens.config, listCSSTokens.handler);
|
|
28
|
+
// Start the server
|
|
29
|
+
async function main() {
|
|
30
|
+
const transport = new StdioServerTransport();
|
|
31
|
+
await server.connect(transport);
|
|
32
|
+
console.info('Server started');
|
|
33
|
+
}
|
|
34
|
+
main().catch((error) => {
|
|
35
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
36
|
+
console.error(errorMessage);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,WAAW,MAAM,mBAAmB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAElE,OAAO,oBAAoB,MAAM,mCAAmC,CAAC;AACrE,OAAO,kBAAkB,MAAM,iCAAiC,CAAC;AACjE,OAAO,mBAAmB,MAAM,+BAA+B,CAAC;AAChE,OAAO,oBAAoB,MAAM,mCAAmC,CAAC;AACrE,OAAO,iBAAiB,MAAM,gCAAgC,CAAC;AAC/D,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAE3D,wBAAwB;AACxB,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B;IACE,IAAI,EAAE,oCAAoC;IAC1C,OAAO,EAAE,WAAW,CAAC,OAAO;IAC5B,WAAW,EAAE,WAAW,CAAC,WAAW;CACrC,EACD;IACE,YAAY,EAAE;QACZ,KAAK,EAAE,EAAE;KACV;CACF,CACF,CAAC;AAEF,4CAA4C;AAC5C,MAAM,CAAC,YAAY,CAAC,oBAAoB,CAAC,IAAI,EAAE,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC1G,MAAM,CAAC,YAAY,CAAC,kBAAkB,CAAC,IAAI,EAAE,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;AACpG,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,IAAI,EAAE,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;AACvG,MAAM,CAAC,YAAY,CAAC,oBAAoB,CAAC,IAAI,EAAE,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC1G,MAAM,CAAC,YAAY,CAAC,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;AACjG,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;AAErF,mBAAmB;AACnB,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AACjC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5E,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAC5B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport packageJson from '@/../package.json' with { type: 'json' };\n\nimport getComponentDocsTool from '@/tools/getComponentDocs/index.js';\nimport listComponentsTool from '@/tools/listComponents/index.js';\nimport getDesignTokensTool from '@/tools/getCSSTokens/index.js';\nimport searchComponentsTool from '@/tools/searchComponents/index.js';\nimport getSetupGuideTool from '@/tools/getSetupGuide/index.js';\nimport listCSSTokens from '@/tools/listCSSTokens/index.js';\n\n// Initialize MCP server\nconst server = new McpServer(\n {\n name: 'Triptease Design System MCP Server',\n version: packageJson.version,\n description: packageJson.description,\n },\n {\n capabilities: {\n tools: {},\n },\n }\n);\n\n// Register getComponentDocsTool definitions\nserver.registerTool(getComponentDocsTool.name, getComponentDocsTool.config, getComponentDocsTool.handler);\nserver.registerTool(listComponentsTool.name, listComponentsTool.config, listComponentsTool.handler);\nserver.registerTool(getDesignTokensTool.name, getDesignTokensTool.config, getDesignTokensTool.handler);\nserver.registerTool(searchComponentsTool.name, searchComponentsTool.config, searchComponentsTool.handler);\nserver.registerTool(getSetupGuideTool.name, getSetupGuideTool.config, getSetupGuideTool.handler);\nserver.registerTool(listCSSTokens.name, listCSSTokens.config, listCSSTokens.handler);\n\n// Start the server\nasync function main() {\n const transport = new StdioServerTransport();\n await server.connect(transport);\n console.info('Server started');\n}\n\nmain().catch((error) => {\n const errorMessage = error instanceof Error ? error.message : String(error);\n console.error(errorMessage);\n process.exit(1);\n});\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
badge: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
element: string;
|
|
6
|
+
usageGuidance: {
|
|
7
|
+
whenToUse: string[];
|
|
8
|
+
avoid: string[];
|
|
9
|
+
};
|
|
10
|
+
classes: {
|
|
11
|
+
badge: string;
|
|
12
|
+
};
|
|
13
|
+
dataAttributes: {
|
|
14
|
+
'data-theme': {
|
|
15
|
+
type: string;
|
|
16
|
+
values: string[];
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
examples: {
|
|
21
|
+
title: string;
|
|
22
|
+
description: string;
|
|
23
|
+
code: string;
|
|
24
|
+
}[];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
badge: {
|
|
3
|
+
name: 'Badge',
|
|
4
|
+
description: 'Status indicator or label badge for highlighting small pieces of information',
|
|
5
|
+
element: 'span',
|
|
6
|
+
usageGuidance: {
|
|
7
|
+
whenToUse: [
|
|
8
|
+
'Display notification counts or unread items',
|
|
9
|
+
'Show status (new, updated, beta)',
|
|
10
|
+
'Label or categorize content',
|
|
11
|
+
'Highlight key metrics or data points',
|
|
12
|
+
],
|
|
13
|
+
avoid: [
|
|
14
|
+
'For interactive elements (use buttons instead)',
|
|
15
|
+
'As primary navigation (consider tabs or links)',
|
|
16
|
+
'For lengthy text (keep content brief)',
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
classes: {
|
|
20
|
+
badge: 'Base badge class (required)',
|
|
21
|
+
},
|
|
22
|
+
dataAttributes: {
|
|
23
|
+
'data-theme': {
|
|
24
|
+
type: 'enum',
|
|
25
|
+
values: ['primary', 'success', 'danger', 'warning', 'info', 'subtle'],
|
|
26
|
+
description: 'Badge color theme with semantic meaning. Use success for positive states (active, completed), danger for errors or destructive actions, warning for caution, info for neutral information, subtle for de-emphasized content.',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
examples: [
|
|
30
|
+
{
|
|
31
|
+
title: 'Status badges',
|
|
32
|
+
description: 'Use semantic themes to indicate status or state',
|
|
33
|
+
code: `<div>
|
|
34
|
+
<span class="badge" data-theme="success">Active</span>
|
|
35
|
+
<span class="badge" data-theme="danger">Failed</span>
|
|
36
|
+
<span class="badge" data-theme="warning">Pending</span>
|
|
37
|
+
<span class="badge" data-theme="info">Draft</span>
|
|
38
|
+
</div>`,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.js","sourceRoot":"","sources":["../../../../../src/manifests/components/entries/badge.ts"],"names":[],"mappings":"AAEA,eAAe;IACb,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,8EAA8E;QAC3F,OAAO,EAAE,MAAM;QACf,aAAa,EAAE;YACb,SAAS,EAAE;gBACT,6CAA6C;gBAC7C,kCAAkC;gBAClC,6BAA6B;gBAC7B,sCAAsC;aACvC;YACD,KAAK,EAAE;gBACL,gDAAgD;gBAChD,gDAAgD;gBAChD,uCAAuC;aACxC;SACF;QACD,OAAO,EAAE;YACP,KAAK,EAAE,6BAA6B;SACrC;QACD,cAAc,EAAE;YACd,YAAY,EAAE;gBACZ,IAAI,EAAE,MAAM;gBACZ,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC;gBACrE,WAAW,EACT,8NAA8N;aACjO;SACF;QACD,QAAQ,EAAE;YACR;gBACE,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,iDAAiD;gBAC9D,IAAI,EAAE;;;;;OAKP;aACA;SACF;KACF;CAC0B,CAAC","sourcesContent":["import { ComponentManifest } from '@/manifests/components/types.js';\n\nexport default {\n badge: {\n name: 'Badge',\n description: 'Status indicator or label badge for highlighting small pieces of information',\n element: 'span',\n usageGuidance: {\n whenToUse: [\n 'Display notification counts or unread items',\n 'Show status (new, updated, beta)',\n 'Label or categorize content',\n 'Highlight key metrics or data points',\n ],\n avoid: [\n 'For interactive elements (use buttons instead)',\n 'As primary navigation (consider tabs or links)',\n 'For lengthy text (keep content brief)',\n ],\n },\n classes: {\n badge: 'Base badge class (required)',\n },\n dataAttributes: {\n 'data-theme': {\n type: 'enum',\n values: ['primary', 'success', 'danger', 'warning', 'info', 'subtle'],\n description:\n 'Badge color theme with semantic meaning. Use success for positive states (active, completed), danger for errors or destructive actions, warning for caution, info for neutral information, subtle for de-emphasized content.',\n },\n },\n examples: [\n {\n title: 'Status badges',\n description: 'Use semantic themes to indicate status or state',\n code: `<div>\n <span class=\"badge\" data-theme=\"success\">Active</span>\n <span class=\"badge\" data-theme=\"danger\">Failed</span>\n <span class=\"badge\" data-theme=\"warning\">Pending</span>\n <span class=\"badge\" data-theme=\"info\">Draft</span>\n</div>`,\n },\n ],\n },\n} satisfies ComponentManifest;\n"]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'bar-chart': {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
ssrSafe: true;
|
|
6
|
+
element: string;
|
|
7
|
+
usageGuidance: {
|
|
8
|
+
whenToUse: string[];
|
|
9
|
+
avoid: string[];
|
|
10
|
+
};
|
|
11
|
+
installation: {
|
|
12
|
+
npm: ({
|
|
13
|
+
name: string;
|
|
14
|
+
includesTypes: true;
|
|
15
|
+
optional: false;
|
|
16
|
+
} | {
|
|
17
|
+
name: string;
|
|
18
|
+
includesTypes: true;
|
|
19
|
+
optional: true;
|
|
20
|
+
})[];
|
|
21
|
+
cdn: {
|
|
22
|
+
name: string;
|
|
23
|
+
includesTypes: false;
|
|
24
|
+
optional: false;
|
|
25
|
+
pinnedVersionUrl: string;
|
|
26
|
+
pinnedMajorVersionUrl: string;
|
|
27
|
+
latestVersionUrl: string;
|
|
28
|
+
guidance: string;
|
|
29
|
+
}[];
|
|
30
|
+
};
|
|
31
|
+
attributes: {
|
|
32
|
+
width: {
|
|
33
|
+
type: string;
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
height: {
|
|
37
|
+
type: string;
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
'x-axis-title': {
|
|
41
|
+
type: string;
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
'y-axis-title': {
|
|
45
|
+
type: string;
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
direction: {
|
|
49
|
+
type: string;
|
|
50
|
+
values: string[];
|
|
51
|
+
description: string;
|
|
52
|
+
};
|
|
53
|
+
stacked: {
|
|
54
|
+
type: string;
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
loading: {
|
|
58
|
+
type: string;
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
examples: ({
|
|
63
|
+
title: string;
|
|
64
|
+
code: string;
|
|
65
|
+
description?: undefined;
|
|
66
|
+
} | {
|
|
67
|
+
title: string;
|
|
68
|
+
description: string;
|
|
69
|
+
code: string;
|
|
70
|
+
})[];
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
export default _default;
|