@dialpad/dialtone-mcp-server 1.0.2 → 1.2.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.
Files changed (3) hide show
  1. package/README.md +262 -0
  2. package/build/index.js +23515 -759
  3. package/package.json +8 -6
package/README.md ADDED
@@ -0,0 +1,262 @@
1
+ # Dialtone MCP Server
2
+
3
+ A [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that provides AI assistants with search access to Dialtone's design system: utility classes, design tokens, Vue components, and icons.
4
+
5
+ Automatically filters deprecated items, swaps discouraged patterns with recommended alternatives, and provides AI-optimized search results.
6
+
7
+ ## Installation
8
+
9
+ There are three ways to install the Dialtone MCP Server. **Project-scoped installation takes priority** over user-scoped when both exist.
10
+
11
+ ### Project-Scoped (Recommended for Teams)
12
+
13
+ Best for team collaboration - everyone uses the same version via version control.
14
+
15
+ ```bash
16
+ npm install -D @dialpad/dialtone-mcp-server
17
+ ```
18
+
19
+ Create or update `.mcp.json` in your project root:
20
+
21
+ ```json
22
+ {
23
+ "mcpServers": {
24
+ "dialtone": {
25
+ "command": "dialtone-mcp-server"
26
+ }
27
+ }
28
+ }
29
+ ```
30
+
31
+ Commit `.mcp.json` to version control. Restart Claude Code to connect.
32
+
33
+ **Priority:** Project-scoped beats user-scoped. The `dialtone-mcp-server` command resolves from `node_modules/.bin/` first.
34
+
35
+ ### User-Scoped (Personal, All Projects)
36
+
37
+ Available across all your projects. Choose one method:
38
+
39
+ **Option A: Install locally in your user directory**
40
+
41
+ ```bash
42
+ # Install in a dedicated directory
43
+ mkdir -p ~/.mcp-servers
44
+ cd ~/.mcp-servers
45
+ npm install @dialpad/dialtone-mcp-server
46
+
47
+ # Add to Claude Code
48
+ claude mcp add dialtone --scope user dialtone-mcp-server
49
+ ```
50
+
51
+ **Option B: Install globally**
52
+
53
+ ```bash
54
+ npm install -g @dialpad/dialtone-mcp-server
55
+ claude mcp add dialtone --scope user dialtone-mcp-server
56
+ ```
57
+
58
+ **Option C: Use npx (no installation)**
59
+
60
+ ```bash
61
+ claude mcp add dialtone --scope user -- npx -y @dialpad/dialtone-mcp-server
62
+ ```
63
+
64
+ This stores configuration in `~/.claude/mcp.json`.
65
+
66
+ **Version checking:** When the server starts, you'll see the current version. If outdated, follow the instructions shown.
67
+
68
+ ## Updating
69
+
70
+ **Project-scoped:**
71
+
72
+ ```bash
73
+ npm install -D @dialpad/dialtone-mcp-server@latest
74
+ ```
75
+
76
+ **User-scoped (local directory):**
77
+
78
+ ```bash
79
+ cd ~/.mcp-servers
80
+ npm update @dialpad/dialtone-mcp-server
81
+ ```
82
+
83
+ **User-scoped (global):**
84
+
85
+ ```bash
86
+ npm update -g @dialpad/dialtone-mcp-server
87
+ ```
88
+
89
+ **User-scoped (npx):**
90
+
91
+ No action needed - npx always uses the latest version.
92
+
93
+ After updating, restart your Claude Code conversation to pick up the new version.
94
+
95
+ ## What You Can Search
96
+
97
+ ### 1. Utility Classes (3,315 classes)
98
+ Find CSS utility classes for styling HTML elements.
99
+
100
+ **Example queries:**
101
+ - `padding 8px` → d-p8, d-pt8, d-pr8, d-pb8, d-pl8, d-px8, d-py8
102
+ - `display flex` → d-d-flex, d-d-inline-flex
103
+ - `width 100%` → d-w100p
104
+ - `margin top auto` → d-mt-auto
105
+ - `text align center` → d-ta-center
106
+
107
+ ### 2. Design Tokens (5,691 tokens)
108
+ Search for design tokens (CSS variables).
109
+
110
+ **Example queries:**
111
+ - `color foreground primary` → --dt-color-foreground-primary
112
+ - `space 400` → --dt-space-400, --dt-space-400-negative
113
+ - `font family` → --dt-font-family-body, --dt-font-family-expressive
114
+ - `font weight bold` → --dt-font-weight-bold
115
+
116
+ ### 3. Components (87 components)
117
+ Discover Vue components with props, events, and slots.
118
+
119
+ **Example queries:**
120
+ - `button` → DtButton, DtButtonGroup, DtBanner (29 results)
121
+ - `modal` → DtModal, DtBanner, DtDropdown (6 results)
122
+ - `checkbox` → DtCheckbox, DtCheckboxGroup, DtRadio
123
+
124
+ ### 4. Icons (594 icons)
125
+ Find icons from Dialtone's icon library.
126
+
127
+ **Example queries:**
128
+ - `notification` → bell, bell-ring, bell-off, bell-plus
129
+ - `arrow up` → arrow-up, arrow-up-down, arrow-up-left
130
+ - `profile` → user
131
+ - `calendar` → calendar, calendar-plus, calendar-event
132
+
133
+ ## Troubleshooting
134
+
135
+ **Version check shows old version:**
136
+ - Restart your Claude Code conversation after updating
137
+ - The server loads once at conversation start
138
+
139
+ **MCP server not connecting:**
140
+
141
+ For project-scoped:
142
+ 1. Verify `.mcp.json` is in your project root with correct format
143
+ 2. Check package is installed: `npm list @dialpad/dialtone-mcp-server`
144
+ 3. Verify bin command exists: `ls node_modules/.bin/dialtone-mcp-server`
145
+ 4. Restart Claude Code completely
146
+
147
+ For user-scoped:
148
+ 1. List configured servers: `claude mcp list`
149
+ 2. Check if dialtone is listed and enabled
150
+ 3. Test the server: `claude mcp get dialtone`
151
+ 4. Check configuration: `cat ~/.claude/mcp.json`
152
+
153
+ General:
154
+ - Check Claude Code logs for connection errors
155
+ - Remember: Project-scoped configuration overrides user-scoped
156
+
157
+ ## Resources
158
+
159
+ - [MCP Documentation](https://modelcontextprotocol.io)
160
+ - [Dialtone Docs](https://dialtone.dialpad.com)
161
+
162
+ ---
163
+
164
+ ## Development
165
+
166
+ For contributors working in the Dialtone monorepo.
167
+
168
+ ### Build
169
+
170
+ From the monorepo root:
171
+
172
+ ```bash
173
+ pnpm install
174
+ pnpm nx run dialtone-mcp-server:build
175
+ ```
176
+
177
+ ### Test Interactively
178
+
179
+ Try out search queries (must be run from the package directory):
180
+
181
+ ```bash
182
+ cd packages/dialtone-mcp-server
183
+ pnpm run interactive
184
+ ```
185
+
186
+ Or use tsx directly from anywhere:
187
+ ```bash
188
+ npx tsx packages/dialtone-mcp-server/interactive-search.ts
189
+ ```
190
+
191
+ **Query Format:** Use keywords only, not questions.
192
+ - ✓ Good: `padding 8px`, `color primary`, `button`
193
+ - ✗ Bad: `how do I add padding?`, `what button component exists?`
194
+
195
+ ### Run Tests
196
+
197
+ From the package directory:
198
+ ```bash
199
+ cd packages/dialtone-mcp-server
200
+ pnpm run test
201
+ ```
202
+
203
+ Or from monorepo root:
204
+ ```bash
205
+ node packages/dialtone-mcp-server/test-search.js
206
+ ```
207
+
208
+ Expected: `Overall Success Rate: 100%` (77/77 tests)
209
+
210
+ ### Configure with Claude Desktop (for testing)
211
+
212
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (MacOS) or `%APPDATA%/Claude/claude_desktop_config.json` (Windows):
213
+
214
+ ```json
215
+ {
216
+ "mcpServers": {
217
+ "dialtone": {
218
+ "command": "node",
219
+ "args": [
220
+ "/ABSOLUTE/PATH/TO/dialtone/packages/dialtone-mcp-server/build/index.js"
221
+ ]
222
+ }
223
+ }
224
+ }
225
+ ```
226
+
227
+ **Important:**
228
+ - Use the absolute path to your dialtone repo
229
+ - Restart Claude Desktop completely after updating the config
230
+ - Look for the 🔌 icon to confirm connection
231
+
232
+ **Finding your absolute path:**
233
+ ```bash
234
+ cd /path/to/dialtone
235
+ pwd
236
+ # Use the output + /packages/dialtone-mcp-server/build/index.js
237
+ ```
238
+
239
+ ### Project Structure
240
+
241
+ ```
242
+ packages/dialtone-mcp-server/
243
+ ├── src/
244
+ │ ├── index.ts # MCP server setup
245
+ │ ├── types.ts # TypeScript interfaces
246
+ │ ├── data.ts # Data imports
247
+ │ ├── utils/filters.ts # Smart filtering
248
+ │ └── tools/ # Search implementations
249
+ │ ├── utility-classes.ts
250
+ │ ├── tokens.ts
251
+ │ ├── components.ts
252
+ │ └── icons.ts
253
+ ├── build/ # Compiled output
254
+ ├── test-search.js # Automated tests
255
+ ├── interactive-search.ts # Interactive CLI tool
256
+ └── README.md
257
+ ```
258
+
259
+ ### Additional Documentation
260
+
261
+ - [Search Implementation Details](./MCP_CONTEXT.md)
262
+ - [Icon Search Summary](./ICON_SEARCH_SUMMARY.md)