@open-skills-hub/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.
@@ -0,0 +1,385 @@
1
+ # Multi-Platform Support
2
+
3
+ SkillsHub MCP Server now includes intelligent platform detection and automatic directory management for seamless skill installation across different AI agent platforms.
4
+
5
+ ## Supported Platforms
6
+
7
+ The MCP server automatically detects and supports the following platforms:
8
+
9
+ | Platform | Default Skills Directory | Detection Method |
10
+ |----------|-------------------------|------------------|
11
+ | **Cursor** | `~/.cursor/skills` | Directory existence or `CURSOR_USER_DATA` env var |
12
+ | **Codex** | `~/.codex/skills` | Directory existence or `CODEX_HOME` env var |
13
+ | **CodeBuddy** | `~/.codebuddy/skills` | Directory existence or `CODEBUDDY_HOME` env var |
14
+ | **Claude** | `~/.claude/skills` | Directory existence |
15
+ | **Anthropic** | `~/.anthropic/skills` | Directory existence |
16
+ | **Generic** | `~/.skills` | Fallback when no platform detected |
17
+
18
+ ## How Platform Detection Works
19
+
20
+ The system uses a multi-step detection process:
21
+
22
+ 1. **Environment Variables** - Checks for platform-specific environment variables
23
+ 2. **Directory Scanning** - Looks for existing platform directories in user home
24
+ 3. **Explicit Parameter** - Respects user-specified `platform` parameter
25
+ 4. **Fallback** - Uses generic `~/.skills` if no platform is detected
26
+
27
+ ## Usage Examples
28
+
29
+ ### Simplest Usage (Recommended)
30
+
31
+ Let the system auto-detect everything:
32
+
33
+ ```json
34
+ {
35
+ "tool": "skills_install",
36
+ "arguments": {
37
+ "name": "@official/pdf-parser"
38
+ }
39
+ }
40
+ ```
41
+
42
+ **Result:**
43
+ - Platform automatically detected (e.g., "cursor")
44
+ - Directory automatically created (`~/.cursor/skills/`)
45
+ - Skill installed to `~/.cursor/skills/pdf-parser/`
46
+
47
+ ### Specify Platform
48
+
49
+ Install for a specific platform regardless of current environment:
50
+
51
+ ```json
52
+ {
53
+ "tool": "skills_install",
54
+ "arguments": {
55
+ "name": "@official/pdf-parser",
56
+ "platform": "codex"
57
+ }
58
+ }
59
+ ```
60
+
61
+ **Result:**
62
+ - Uses Codex directory: `~/.codex/skills/`
63
+ - Directory created if it doesn't exist
64
+ - Skill installed to `~/.codex/skills/pdf-parser/`
65
+
66
+ ### Custom Directory
67
+
68
+ Override platform detection with a custom path:
69
+
70
+ ```json
71
+ {
72
+ "tool": "skills_install",
73
+ "arguments": {
74
+ "name": "@official/pdf-parser",
75
+ "targetDir": "/Users/george/projects/my-app/skills"
76
+ }
77
+ }
78
+ ```
79
+
80
+ **Result:**
81
+ - Uses specified custom directory
82
+ - Platform detection bypassed
83
+ - Skill installed to custom location
84
+
85
+ ## Directory Creation
86
+
87
+ All directories are created automatically if they don't exist:
88
+
89
+ 1. **Parent Directory** - Creates the main skills directory
90
+ 2. **Skill Directory** - Creates the skill-specific subdirectory
91
+ 3. **Subdirectories** - Creates any nested directories for attachments (scripts/, references/, etc.)
92
+
93
+ **Example:**
94
+
95
+ If `~/.cursor/skills` doesn't exist:
96
+ ```
97
+ Before: ~/
98
+ After: ~/.cursor/
99
+ ~/.cursor/skills/
100
+ ~/.cursor/skills/pdf-parser/
101
+ ~/.cursor/skills/pdf-parser/SKILL.md
102
+ ~/.cursor/skills/pdf-parser/scripts/
103
+ ~/.cursor/skills/pdf-parser/scripts/extract.py
104
+ ```
105
+
106
+ ## Platform-Specific Considerations
107
+
108
+ ### Cursor IDE
109
+
110
+ - Default: `~/.cursor/skills`
111
+ - Skills are automatically available to Cursor AI agents
112
+ - Use the built-in Cursor skills system to manage loaded skills
113
+
114
+ ### Codex (OpenAI)
115
+
116
+ - Default: `~/.codex/skills`
117
+ - May coexist with Codex's native skill system
118
+ - Skills follow Anthropic Agent Skills format (broader compatibility)
119
+
120
+ ### CodeBuddy
121
+
122
+ - Default: `~/.codebuddy/skills`
123
+ - Skills can be loaded by CodeBuddy's agent system
124
+ - Check CodeBuddy documentation for skill activation
125
+
126
+ ### Generic/Custom Platforms
127
+
128
+ - Default: `~/.skills`
129
+ - Universal location that any platform can read from
130
+ - Useful for testing or cross-platform development
131
+
132
+ ## Migration Guide
133
+
134
+ ### From Manual Installation
135
+
136
+ **Before (required explicit paths):**
137
+ ```json
138
+ {
139
+ "name": "@official/skill-name",
140
+ "targetDir": "/Users/george/.cursor/skills"
141
+ }
142
+ ```
143
+
144
+ **After (automatic):**
145
+ ```json
146
+ {
147
+ "name": "@official/skill-name"
148
+ }
149
+ ```
150
+
151
+ ### From Other Skill Systems
152
+
153
+ If you have existing skills in platform-specific locations, SkillsHub will:
154
+
155
+ 1. Detect the existing directory
156
+ 2. Install new skills alongside existing ones
157
+ 3. Not interfere with native platform skill systems
158
+
159
+ ## API Changes
160
+
161
+ ### Updated Tool Definition
162
+
163
+ ```typescript
164
+ {
165
+ name: 'skills_install',
166
+ parameters: {
167
+ name: string; // Required: skill name
168
+ targetDir?: string; // Optional: custom directory
169
+ platform?: string; // Optional: target platform
170
+ version?: string; // Optional: specific version
171
+ }
172
+ }
173
+ ```
174
+
175
+ ### Breaking Changes
176
+
177
+ ⚠️ **Note:** `targetDir` is now **optional** instead of required.
178
+
179
+ **Migration:**
180
+ - Old code specifying `targetDir` will continue to work
181
+ - New code can omit `targetDir` for automatic detection
182
+ - No action required for existing integrations
183
+
184
+ ## Best Practices for AI Agents
185
+
186
+ ### 1. Prefer Auto-Detection
187
+
188
+ ```typescript
189
+ // ✅ Recommended - Simple and works everywhere
190
+ await tools.skills_install({ name: "@official/skill-name" });
191
+
192
+ // ❌ Avoid unless specifically needed
193
+ await tools.skills_install({
194
+ name: "@official/skill-name",
195
+ targetDir: "/some/path"
196
+ });
197
+ ```
198
+
199
+ ### 2. Only Specify Platform When Needed
200
+
201
+ ```typescript
202
+ // ✅ When user explicitly mentions a platform
203
+ User: "Install this for Codex"
204
+ await tools.skills_install({
205
+ name: "@official/skill-name",
206
+ platform: "codex"
207
+ });
208
+
209
+ // ✅ When installing for multiple platforms
210
+ for (const platform of ["cursor", "codex"]) {
211
+ await tools.skills_install({
212
+ name: "@official/skill-name",
213
+ platform
214
+ });
215
+ }
216
+ ```
217
+
218
+ ### 3. Trust the Detection
219
+
220
+ The detection algorithm is robust and handles:
221
+ - Missing directories (creates them)
222
+ - Multiple platforms on same machine (picks primary)
223
+ - Custom setups (falls back gracefully)
224
+
225
+ ### 4. Inform Users About Auto-Creation
226
+
227
+ When directories are auto-created, the response includes:
228
+ - Detected platform name
229
+ - Created directory path
230
+ - Confirmation that directory was auto-created
231
+
232
+ Share this info with users so they know where skills were installed.
233
+
234
+ ## Troubleshooting
235
+
236
+ ### Platform Not Detected
237
+
238
+ **Symptoms:**
239
+ - Skills installed to `~/.skills` instead of platform-specific directory
240
+ - Wrong platform detected
241
+
242
+ **Solutions:**
243
+ 1. Explicitly specify platform:
244
+ ```json
245
+ { "name": "skill", "platform": "cursor" }
246
+ ```
247
+
248
+ 2. Create platform directory manually:
249
+ ```bash
250
+ mkdir -p ~/.cursor/skills
251
+ ```
252
+
253
+ 3. Set environment variable:
254
+ ```bash
255
+ export CURSOR_USER_DATA=/path/to/cursor
256
+ ```
257
+
258
+ ### Directory Permission Issues
259
+
260
+ **Symptoms:**
261
+ - `EACCES` or `EPERM` errors
262
+ - Cannot create directory
263
+
264
+ **Solutions:**
265
+ 1. Check directory permissions:
266
+ ```bash
267
+ ls -la ~/.cursor/
268
+ ```
269
+
270
+ 2. Fix permissions if needed:
271
+ ```bash
272
+ chmod 755 ~/.cursor/skills
273
+ ```
274
+
275
+ 3. Use a custom directory in user-writable location:
276
+ ```json
277
+ { "name": "skill", "targetDir": "~/Documents/skills" }
278
+ ```
279
+
280
+ ### Skills Not Loading in Platform
281
+
282
+ **Symptoms:**
283
+ - Skills installed successfully but not available in platform
284
+ - Platform doesn't recognize skills
285
+
286
+ **Solutions:**
287
+ 1. Check platform-specific skill loading mechanism
288
+ 2. Restart the platform/IDE
289
+ 3. Verify skill format matches platform expectations
290
+ 4. Check platform documentation for skill activation
291
+
292
+ ## Technical Implementation
293
+
294
+ ### Detection Function
295
+
296
+ ```typescript
297
+ function detectPlatform(): string {
298
+ const homeDir = process.env.HOME || '~';
299
+
300
+ // Check existing directories
301
+ for (const [platform, dir] of Object.entries(PLATFORM_SKILLS_DIRS)) {
302
+ if (fs.existsSync(dir.replace('~', homeDir))) {
303
+ return platform;
304
+ }
305
+ }
306
+
307
+ // Check environment variables
308
+ if (process.env.CURSOR_USER_DATA) return 'cursor';
309
+ if (process.env.CODEX_HOME) return 'codex';
310
+
311
+ return 'unknown';
312
+ }
313
+ ```
314
+
315
+ ### Directory Resolution
316
+
317
+ ```typescript
318
+ function getDefaultSkillsDir(platform?: string): string {
319
+ const homeDir = process.env.HOME || '~';
320
+ const detectedPlatform = platform || detectPlatform();
321
+
322
+ return PLATFORM_SKILLS_DIRS[detectedPlatform]?.replace('~', homeDir)
323
+ || path.join(homeDir, '.skills');
324
+ }
325
+ ```
326
+
327
+ ## Future Enhancements
328
+
329
+ Planned improvements for platform support:
330
+
331
+ - [ ] VSCode integration
332
+ - [ ] JetBrains AI support
333
+ - [ ] Continue.dev detection
334
+ - [ ] Aider integration
335
+ - [ ] Per-project skill directories
336
+ - [ ] Skill symlinking across platforms
337
+ - [ ] Platform-specific skill validation
338
+
339
+ ## Contributing
340
+
341
+ To add support for a new platform:
342
+
343
+ 1. Add platform directory mapping in `PLATFORM_SKILLS_DIRS`
344
+ 2. Add detection logic in `detectPlatform()`
345
+ 3. Update documentation and examples
346
+ 4. Test with the new platform
347
+ 5. Submit a pull request
348
+
349
+ Example:
350
+
351
+ ```typescript
352
+ const PLATFORM_SKILLS_DIRS = {
353
+ // ... existing platforms
354
+ 'new-platform': '~/.new-platform/skills',
355
+ };
356
+
357
+ function detectPlatform() {
358
+ // ... existing checks
359
+ if (process.env.NEW_PLATFORM_HOME) return 'new-platform';
360
+ // ...
361
+ }
362
+ ```
363
+
364
+ ## Learn More
365
+
366
+ - [Main README](./README.md) - Full MCP server documentation
367
+ - [Examples](./EXAMPLES.md) - Practical usage examples
368
+ - [SkillsHub Documentation](../../README.md) - Project overview
369
+
370
+ ## Feedback
371
+
372
+ Found a platform that should be supported? Have suggestions for improving detection?
373
+
374
+ Open an issue or submit feedback using:
375
+ ```json
376
+ {
377
+ "tool": "skills_feedback",
378
+ "arguments": {
379
+ "name": "@open-skills-hub/mcp-server",
380
+ "type": "suggestion",
381
+ "rating": 5,
382
+ "comment": "Add support for XYZ platform at ~/.xyz/skills"
383
+ }
384
+ }
385
+ ```
@@ -0,0 +1,128 @@
1
+ # Platform Support - Quick Reference
2
+
3
+ > **TL;DR**: Just use `{ "name": "skill-name" }` - the system auto-detects everything!
4
+
5
+ ## 🚀 Simplest Usage
6
+
7
+ ```json
8
+ {
9
+ "tool": "skills_install",
10
+ "arguments": {
11
+ "name": "@official/pdf-parser"
12
+ }
13
+ }
14
+ ```
15
+
16
+ **That's it!** The system will:
17
+ - ✅ Detect your platform (Cursor, Codex, etc.)
18
+ - ✅ Use the correct default directory
19
+ - ✅ Create directories if needed
20
+ - ✅ Install the skill
21
+
22
+ ## 📍 Default Directories
23
+
24
+ | Platform | Directory |
25
+ |----------|-----------|
26
+ | Cursor | `~/.cursor/skills` |
27
+ | Codex | `~/.codex/skills` |
28
+ | CodeBuddy | `~/.codebuddy/skills` |
29
+ | Claude | `~/.claude/skills` |
30
+ | Anthropic | `~/.anthropic/skills` |
31
+ | *Fallback* | `~/.skills` |
32
+
33
+ ## 🎯 Three Ways to Install
34
+
35
+ ### 1. Auto-Detect (Recommended)
36
+ ```json
37
+ { "name": "@official/skill" }
38
+ ```
39
+ System detects platform and uses default directory.
40
+
41
+ ### 2. Specify Platform
42
+ ```json
43
+ {
44
+ "name": "@official/skill",
45
+ "platform": "cursor"
46
+ }
47
+ ```
48
+ Force install to specific platform's directory.
49
+
50
+ ### 3. Custom Directory
51
+ ```json
52
+ {
53
+ "name": "@official/skill",
54
+ "targetDir": "/custom/path"
55
+ }
56
+ ```
57
+ Override everything with custom location.
58
+
59
+ ## 🆕 What Changed?
60
+
61
+ | Before | After |
62
+ |--------|-------|
63
+ | `targetDir` required | `targetDir` optional |
64
+ | Manual directory creation | Auto-created |
65
+ | Must know platform | Auto-detected |
66
+
67
+ ## ✅ Backward Compatible
68
+
69
+ Old code still works:
70
+ ```json
71
+ {
72
+ "name": "@official/skill",
73
+ "targetDir": "/Users/george/.cursor/skills"
74
+ }
75
+ ```
76
+
77
+ ## 🛠️ For AI Agents
78
+
79
+ **Simple Rule**: Only ask for directory if user explicitly wants custom location.
80
+
81
+ ```typescript
82
+ // ✅ Default behavior
83
+ User: "Install the PDF skill"
84
+ → { name: "@official/pdf-parser" }
85
+
86
+ // ✅ Platform specified
87
+ User: "Install for Codex"
88
+ → { name: "@official/pdf-parser", platform: "codex" }
89
+
90
+ // ✅ Custom location
91
+ User: "Install to my project at /path/to/project"
92
+ → { name: "@official/pdf-parser", targetDir: "/path/to/project/skills" }
93
+ ```
94
+
95
+ ## 📚 Full Documentation
96
+
97
+ - [Platform Support Guide](./PLATFORM-SUPPORT.md) - Complete details
98
+ - [Changelog](./CHANGELOG-PLATFORM.md) - What's new
99
+ - [Examples](./EXAMPLES.md) - Practical examples
100
+ - [README](./README.md) - Full documentation
101
+
102
+ ## 💡 Pro Tips
103
+
104
+ 1. **Let it auto-detect** - Works 99% of the time
105
+ 2. **Only specify platform** when installing for different platform than current
106
+ 3. **Only use custom dir** when user explicitly wants non-standard location
107
+ 4. **Trust the system** - It handles missing directories automatically
108
+
109
+ ## ❓ Troubleshooting
110
+
111
+ **Wrong platform detected?**
112
+ ```json
113
+ { "name": "skill", "platform": "cursor" }
114
+ ```
115
+
116
+ **Need custom location?**
117
+ ```json
118
+ { "name": "skill", "targetDir": "/custom/path" }
119
+ ```
120
+
121
+ **Permission errors?**
122
+ ```bash
123
+ chmod 755 ~/.cursor/skills
124
+ ```
125
+
126
+ ---
127
+
128
+ **Updated**: 2026-02-05 | **Version**: 2.0.0