@elsahafy/ux-mcp-server 2.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 +190 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1766 -0
- package/knowledge/animation.json +469 -0
- package/knowledge/dark-mode.json +212 -0
- package/knowledge/design-tokens.json +286 -0
- package/knowledge/error-messages.json +307 -0
- package/knowledge/i18n.json +464 -0
- package/knowledge/nielsen-heuristics.json +253 -0
- package/knowledge/performance.json +347 -0
- package/knowledge/react-patterns.json +353 -0
- package/knowledge/responsive-design.json +258 -0
- package/knowledge/seo.json +518 -0
- package/knowledge/ui-patterns.json +344 -0
- package/knowledge/wcag-guidelines.json +201 -0
- package/package.json +62 -0
package/README.md
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# UX MCP Server
|
|
2
|
+
|
|
3
|
+
Model Context Protocol server that provides UX best practices, accessibility guidelines, usability heuristics, UI patterns, and design system principles to AI assistants.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
### 📚 Resources (Static Knowledge)
|
|
8
|
+
|
|
9
|
+
Access comprehensive UX knowledge bases:
|
|
10
|
+
|
|
11
|
+
- **ux://accessibility/wcag** - WCAG 2.1 AA Guidelines with code checks
|
|
12
|
+
- **ux://usability/nielsen-heuristics** - Nielsen's 10 Usability Heuristics
|
|
13
|
+
- **ux://patterns/ui-patterns** - Common UI patterns library
|
|
14
|
+
- **ux://design-systems/tokens** - Design system principles & tokens
|
|
15
|
+
- **ux://responsive/design** - Responsive design & mobile-first principles
|
|
16
|
+
- **ux://themes/dark-mode** - Dark mode implementation guide
|
|
17
|
+
- **ux://content/error-messages** - User-friendly error message library
|
|
18
|
+
|
|
19
|
+
### 🛠️ Tools (Dynamic Operations)
|
|
20
|
+
|
|
21
|
+
Eight powerful tools for UX analysis and generation:
|
|
22
|
+
|
|
23
|
+
1. **analyze_accessibility** - Check code for WCAG violations
|
|
24
|
+
2. **review_usability** - Evaluate against Nielsen's heuristics
|
|
25
|
+
3. **suggest_pattern** - Find appropriate UI patterns for use cases
|
|
26
|
+
4. **generate_component_example** - Create accessible HTML/CSS examples
|
|
27
|
+
5. **audit_design_system** - Review design token structure
|
|
28
|
+
6. **check_contrast** - Verify WCAG color contrast ratios
|
|
29
|
+
7. **check_responsive** - Analyze mobile-first and responsive design
|
|
30
|
+
8. **suggest_error_message** - Get user-friendly error messages
|
|
31
|
+
|
|
32
|
+
### 💬 Prompts (Pre-configured Reviews)
|
|
33
|
+
|
|
34
|
+
Three comprehensive review workflows:
|
|
35
|
+
|
|
36
|
+
1. **accessibility_review** - Full WCAG accessibility audit
|
|
37
|
+
2. **usability_audit** - Complete Nielsen heuristics evaluation
|
|
38
|
+
3. **design_system_setup** - Guide for creating design systems
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Install dependencies
|
|
44
|
+
npm install
|
|
45
|
+
|
|
46
|
+
# Build the project
|
|
47
|
+
npm run build
|
|
48
|
+
|
|
49
|
+
# Test locally
|
|
50
|
+
npm run dev
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Usage with Claude Desktop
|
|
54
|
+
|
|
55
|
+
Add to your Claude Desktop config (`claude_desktop_config.json`):
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"mcpServers": {
|
|
60
|
+
"ux-best-practices": {
|
|
61
|
+
"command": "node",
|
|
62
|
+
"args": [
|
|
63
|
+
"/path/to/ux-mcp-server/dist/index.js"
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
On Windows, the path might look like:
|
|
71
|
+
```json
|
|
72
|
+
"C:\\Users\\YourName\\ux-mcp-server\\dist\\index.js"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Example Usage
|
|
76
|
+
|
|
77
|
+
### Analyze Accessibility
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
// In Claude Desktop, you can now ask:
|
|
81
|
+
"Analyze this button for accessibility issues"
|
|
82
|
+
|
|
83
|
+
// Claude will use the analyze_accessibility tool
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Get UI Pattern Suggestions
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
"I need to display a list of items with filtering - what UI pattern should I use?"
|
|
90
|
+
|
|
91
|
+
// Claude will use suggest_pattern tool
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Generate Component Examples
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
"Generate an accessible modal dialog example"
|
|
98
|
+
|
|
99
|
+
// Claude will use generate_component_example tool
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Check Color Contrast
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
"Check if #3b82f6 on #ffffff meets WCAG AA"
|
|
106
|
+
|
|
107
|
+
// Claude will use check_contrast tool
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Knowledge Base Contents
|
|
111
|
+
|
|
112
|
+
### WCAG Guidelines
|
|
113
|
+
- Perceivable (alt text, contrast, semantic HTML)
|
|
114
|
+
- Operable (keyboard access, focus management)
|
|
115
|
+
- Understandable (error handling, clear labels)
|
|
116
|
+
- Robust (ARIA, assistive technology support)
|
|
117
|
+
|
|
118
|
+
### Nielsen's Heuristics
|
|
119
|
+
1. Visibility of System Status
|
|
120
|
+
2. Match Between System and Real World
|
|
121
|
+
3. User Control and Freedom
|
|
122
|
+
4. Consistency and Standards
|
|
123
|
+
5. Error Prevention
|
|
124
|
+
6. Recognition Rather than Recall
|
|
125
|
+
7. Flexibility and Efficiency of Use
|
|
126
|
+
8. Aesthetic and Minimalist Design
|
|
127
|
+
9. Help Users Recognize, Diagnose, and Recover from Errors
|
|
128
|
+
10. Help and Documentation
|
|
129
|
+
|
|
130
|
+
### UI Patterns
|
|
131
|
+
- **Navigation**: Headers, breadcrumbs, tabs
|
|
132
|
+
- **Forms**: Single column, multi-step wizards, validation
|
|
133
|
+
- **Feedback**: Toasts, modals, loading states
|
|
134
|
+
- **Data Display**: Tables, cards, empty states
|
|
135
|
+
- **Input Components**: Search, date pickers, file upload
|
|
136
|
+
|
|
137
|
+
### Design System Principles
|
|
138
|
+
- Atomic Design methodology
|
|
139
|
+
- Design token structure (primitive → semantic → component)
|
|
140
|
+
- Typography scales
|
|
141
|
+
- Spacing systems
|
|
142
|
+
- Color theory
|
|
143
|
+
- Component API design
|
|
144
|
+
|
|
145
|
+
## Development
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# Watch mode during development
|
|
149
|
+
npm run watch
|
|
150
|
+
|
|
151
|
+
# Build for production
|
|
152
|
+
npm run build
|
|
153
|
+
|
|
154
|
+
# Test the server
|
|
155
|
+
npm run dev
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Framework Agnostic
|
|
159
|
+
|
|
160
|
+
All examples and guidelines are framework-agnostic, focusing on:
|
|
161
|
+
- Semantic HTML
|
|
162
|
+
- CSS best practices
|
|
163
|
+
- ARIA attributes
|
|
164
|
+
- Accessibility standards
|
|
165
|
+
- Universal UX principles
|
|
166
|
+
|
|
167
|
+
Works with React, Vue, Svelte, Angular, or vanilla JavaScript.
|
|
168
|
+
|
|
169
|
+
## Contributing
|
|
170
|
+
|
|
171
|
+
To add new patterns or guidelines:
|
|
172
|
+
|
|
173
|
+
1. Add content to appropriate file in `knowledge/` directory
|
|
174
|
+
2. Update tool implementations in `src/index.ts` if needed
|
|
175
|
+
3. Rebuild: `npm run build`
|
|
176
|
+
|
|
177
|
+
## License
|
|
178
|
+
|
|
179
|
+
MIT
|
|
180
|
+
|
|
181
|
+
## Credits
|
|
182
|
+
|
|
183
|
+
- WCAG 2.1 Guidelines from W3C
|
|
184
|
+
- Nielsen's Usability Heuristics by Jakob Nielsen
|
|
185
|
+
- UI Patterns from established design systems and best practices
|
|
186
|
+
- Design Token concepts from design system community
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
**Built for AI-assisted development with accessibility and usability as first-class citizens.**
|
package/dist/index.d.ts
ADDED