skillsmp-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/LICENSE +21 -0
- package/README.md +267 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +428 -0
- package/dist/index.js.map +1 -0
- package/dist/utils.d.ts +162 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +284 -0
- package/dist/utils.js.map +1 -0
- package/package.json +64 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Anilcan Cakir
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
# SkillsMP MCP Server
|
|
2
|
+
|
|
3
|
+
A Model Context Protocol (MCP) server that enables AI agents to search, discover, and install skills from the [SkillsMP](https://skillsmp.com) marketplace.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
| Tool | Description |
|
|
8
|
+
|------|-------------|
|
|
9
|
+
| `skillsmp_search` | Search skills by keywords with pagination and sorting |
|
|
10
|
+
| `skillsmp_ai_search` | AI-powered semantic search using natural language |
|
|
11
|
+
| `skillsmp_get_skill_content` | Read skill content (SKILL.md) from GitHub |
|
|
12
|
+
| `skillsmp_list_repo_skills` | List available skills in a repository |
|
|
13
|
+
| `skillsmp_install_skill` | Install skills to AI coding agents |
|
|
14
|
+
|
|
15
|
+
## Requirements
|
|
16
|
+
|
|
17
|
+
- Node.js 18+
|
|
18
|
+
- SkillsMP API key ([Get one here](https://skillsmp.com))
|
|
19
|
+
|
|
20
|
+
## Setup
|
|
21
|
+
|
|
22
|
+
### Claude Code
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
claude mcp add skillsmp -- npx -y skillsmp-mcp-server --env SKILLSMP_API_KEY=your_api_key
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Cursor
|
|
29
|
+
|
|
30
|
+
Add to your Cursor MCP configuration (`~/.cursor/mcp.json`):
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"mcpServers": {
|
|
35
|
+
"skillsmp": {
|
|
36
|
+
"command": "npx",
|
|
37
|
+
"args": ["-y", "skillsmp-mcp-server"],
|
|
38
|
+
"env": {
|
|
39
|
+
"SKILLSMP_API_KEY": "your_api_key"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Claude Desktop
|
|
47
|
+
|
|
48
|
+
Add to your Claude Desktop configuration:
|
|
49
|
+
|
|
50
|
+
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
51
|
+
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"mcpServers": {
|
|
56
|
+
"skillsmp": {
|
|
57
|
+
"command": "npx",
|
|
58
|
+
"args": ["-y", "skillsmp-mcp-server"],
|
|
59
|
+
"env": {
|
|
60
|
+
"SKILLSMP_API_KEY": "your_api_key"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Opencode
|
|
68
|
+
|
|
69
|
+
Add to your Opencode configuration:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"mcp": {
|
|
74
|
+
"skillsmp": {
|
|
75
|
+
"type": "local",
|
|
76
|
+
"command": ["npx", "-y", "skillsmp-mcp-server"],
|
|
77
|
+
"env": {
|
|
78
|
+
"SKILLSMP_API_KEY": "your_api_key"
|
|
79
|
+
},
|
|
80
|
+
"enabled": true
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Google Antigravity
|
|
87
|
+
|
|
88
|
+
Add to your Antigravity MCP configuration:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"mcpServers": {
|
|
93
|
+
"skillsmp": {
|
|
94
|
+
"command": "npx",
|
|
95
|
+
"args": ["-y", "skillsmp-mcp-server"],
|
|
96
|
+
"env": {
|
|
97
|
+
"SKILLSMP_API_KEY": "your_api_key"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Roo Code
|
|
105
|
+
|
|
106
|
+
Add to your Roo Code MCP settings:
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"mcpServers": {
|
|
111
|
+
"skillsmp": {
|
|
112
|
+
"command": "npx",
|
|
113
|
+
"args": ["-y", "skillsmp-mcp-server"],
|
|
114
|
+
"env": {
|
|
115
|
+
"SKILLSMP_API_KEY": "your_api_key"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### GitHub Copilot
|
|
123
|
+
|
|
124
|
+
Add to your Copilot MCP configuration:
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"mcpServers": {
|
|
129
|
+
"skillsmp": {
|
|
130
|
+
"command": "npx",
|
|
131
|
+
"args": ["-y", "skillsmp-mcp-server"],
|
|
132
|
+
"env": {
|
|
133
|
+
"SKILLSMP_API_KEY": "your_api_key"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Environment Variables
|
|
141
|
+
|
|
142
|
+
| Variable | Required | Description |
|
|
143
|
+
|----------|----------|-------------|
|
|
144
|
+
| `SKILLSMP_API_KEY` | Yes | Your SkillsMP API key |
|
|
145
|
+
| `TRANSPORT` | No | Transport type: `stdio` (default) or `http` |
|
|
146
|
+
| `PORT` | No | HTTP port when using http transport (default: 3000) |
|
|
147
|
+
|
|
148
|
+
## Usage
|
|
149
|
+
|
|
150
|
+
Once configured, the MCP server tools become available to your AI assistant.
|
|
151
|
+
|
|
152
|
+
### Search Skills
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
Search for Python skills sorted by stars
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### AI Semantic Search
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
Find skills that help with building REST APIs with authentication
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### List Repository Skills
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
What skills are available in anthropics/claude-code?
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Install Skills
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
Install the frontend-design skill from anthropics/claude-code to Claude Code
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## API Reference
|
|
177
|
+
|
|
178
|
+
### skillsmp_search
|
|
179
|
+
|
|
180
|
+
Search skills by keywords.
|
|
181
|
+
|
|
182
|
+
| Parameter | Type | Required | Default | Description |
|
|
183
|
+
|-----------|------|----------|---------|-------------|
|
|
184
|
+
| `query` | string | Yes | - | Search keywords |
|
|
185
|
+
| `page` | number | No | 1 | Page number |
|
|
186
|
+
| `limit` | number | No | 20 | Results per page (max: 100) |
|
|
187
|
+
| `sort_by` | string | No | stars | Sort by `stars` or `recent` |
|
|
188
|
+
|
|
189
|
+
### skillsmp_ai_search
|
|
190
|
+
|
|
191
|
+
AI-powered semantic search using natural language.
|
|
192
|
+
|
|
193
|
+
| Parameter | Type | Required | Description |
|
|
194
|
+
|-----------|------|----------|-------------|
|
|
195
|
+
| `query` | string | Yes | Natural language query |
|
|
196
|
+
|
|
197
|
+
### skillsmp_get_skill_content
|
|
198
|
+
|
|
199
|
+
Read skill content from GitHub repository.
|
|
200
|
+
|
|
201
|
+
| Parameter | Type | Required | Default | Description |
|
|
202
|
+
|-----------|------|----------|---------|-------------|
|
|
203
|
+
| `owner` | string | Yes | - | GitHub username/org |
|
|
204
|
+
| `repo` | string | Yes | - | Repository name |
|
|
205
|
+
| `path` | string | No | - | Path to skill folder |
|
|
206
|
+
| `branch` | string | No | main | Git branch |
|
|
207
|
+
|
|
208
|
+
### skillsmp_list_repo_skills
|
|
209
|
+
|
|
210
|
+
List all skills in a repository.
|
|
211
|
+
|
|
212
|
+
| Parameter | Type | Required | Description |
|
|
213
|
+
|-----------|------|----------|-------------|
|
|
214
|
+
| `source` | string | Yes | GitHub `owner/repo` |
|
|
215
|
+
|
|
216
|
+
### skillsmp_install_skill
|
|
217
|
+
|
|
218
|
+
Install skills to AI coding agents.
|
|
219
|
+
|
|
220
|
+
| Parameter | Type | Required | Default | Description |
|
|
221
|
+
|-----------|------|----------|---------|-------------|
|
|
222
|
+
| `source` | string | Yes | - | GitHub `owner/repo` |
|
|
223
|
+
| `skills` | string | Yes | - | Skill names (comma-separated) |
|
|
224
|
+
| `agents` | string | Yes | - | Target agents (comma-separated) |
|
|
225
|
+
| `global` | boolean | No | false | Install user-level instead of project-level |
|
|
226
|
+
|
|
227
|
+
**Supported Agents:** `claude-code`, `cursor`, `codex`, `opencode`, `antigravity`, `github-copilot`, `roo`
|
|
228
|
+
|
|
229
|
+
## HTTP Transport
|
|
230
|
+
|
|
231
|
+
For remote deployments or multi-client scenarios:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
SKILLSMP_API_KEY="your_api_key" TRANSPORT=http PORT=3000 npx skillsmp-mcp-server
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Development
|
|
238
|
+
|
|
239
|
+
### From Source
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
git clone https://github.com/anilcancakir/skillsmp-mcp-server.git
|
|
243
|
+
cd skillsmp-mcp-server
|
|
244
|
+
npm install
|
|
245
|
+
npm run build
|
|
246
|
+
npm run dev
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### Running Tests
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
npm run test:run
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
## License
|
|
256
|
+
|
|
257
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
258
|
+
|
|
259
|
+
## Links
|
|
260
|
+
|
|
261
|
+
- [SkillsMP Marketplace](https://skillsmp.com)
|
|
262
|
+
- [Model Context Protocol](https://modelcontextprotocol.io)
|
|
263
|
+
- [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk)
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
Built with the [Model Context Protocol](https://modelcontextprotocol.io) TypeScript SDK.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* MCP Server for SkillsMP API.
|
|
4
|
+
*
|
|
5
|
+
* Provides tools to search skills using keyword and AI semantic search
|
|
6
|
+
* from the SkillsMP marketplace.
|
|
7
|
+
*
|
|
8
|
+
* Environment Variables:
|
|
9
|
+
* SKILLSMP_API_KEY: Your SkillsMP API key (required)
|
|
10
|
+
* TRANSPORT: 'stdio' (default) or 'http'
|
|
11
|
+
* PORT: HTTP port when using http transport (default: 3000)
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* MCP Server for SkillsMP API.
|
|
4
|
+
*
|
|
5
|
+
* Provides tools to search skills using keyword and AI semantic search
|
|
6
|
+
* from the SkillsMP marketplace.
|
|
7
|
+
*
|
|
8
|
+
* Environment Variables:
|
|
9
|
+
* SKILLSMP_API_KEY: Your SkillsMP API key (required)
|
|
10
|
+
* TRANSPORT: 'stdio' (default) or 'http'
|
|
11
|
+
* PORT: HTTP port when using http transport (default: 3000)
|
|
12
|
+
*/
|
|
13
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
14
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
15
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
16
|
+
import express from "express";
|
|
17
|
+
import axios, { AxiosError } from "axios";
|
|
18
|
+
import { exec } from "child_process";
|
|
19
|
+
import { promisify } from "util";
|
|
20
|
+
import {
|
|
21
|
+
// Enums
|
|
22
|
+
ResponseFormat,
|
|
23
|
+
// Schemas
|
|
24
|
+
KeywordSearchInputSchema, AISearchInputSchema, GetSkillContentInputSchema, ListRepoSkillsInputSchema, InstallSkillInputSchema, makeApiRequest, handleApiError, formatSkillsMarkdown, formatSkillsJson, SKILL_FILE_NAMES, } from "./utils.js";
|
|
25
|
+
const execAsync = promisify(exec);
|
|
26
|
+
// Create MCP server
|
|
27
|
+
const server = new McpServer({
|
|
28
|
+
name: "skillsmp-mcp-server",
|
|
29
|
+
version: "1.0.0",
|
|
30
|
+
});
|
|
31
|
+
// Register keyword search tool
|
|
32
|
+
server.registerTool("skillsmp_search", {
|
|
33
|
+
title: "Search Skills",
|
|
34
|
+
description: `Search SkillsMP marketplace for AI coding skills by keywords.
|
|
35
|
+
|
|
36
|
+
Parameters:
|
|
37
|
+
- query: Search terms (e.g., "fastapi", "react testing")
|
|
38
|
+
- page: Page number (default: 1)
|
|
39
|
+
- limit: Results per page (default: 20, max: 100)
|
|
40
|
+
- sort_by: "stars" (default) or "recent"
|
|
41
|
+
|
|
42
|
+
Returns skills with name, description, author, stars, and GitHub URL.`,
|
|
43
|
+
inputSchema: KeywordSearchInputSchema,
|
|
44
|
+
annotations: {
|
|
45
|
+
readOnlyHint: true,
|
|
46
|
+
destructiveHint: false,
|
|
47
|
+
idempotentHint: true,
|
|
48
|
+
openWorldHint: true,
|
|
49
|
+
},
|
|
50
|
+
}, async (params) => {
|
|
51
|
+
try {
|
|
52
|
+
const requestParams = {
|
|
53
|
+
q: params.query,
|
|
54
|
+
page: params.page,
|
|
55
|
+
limit: params.limit,
|
|
56
|
+
sortBy: params.sort_by,
|
|
57
|
+
};
|
|
58
|
+
const data = await makeApiRequest("skills/search", requestParams);
|
|
59
|
+
const skills = data.data?.skills || [];
|
|
60
|
+
const total = data.data?.pagination?.total;
|
|
61
|
+
if (!skills.length) {
|
|
62
|
+
return {
|
|
63
|
+
content: [
|
|
64
|
+
{
|
|
65
|
+
type: "text",
|
|
66
|
+
text: `No skills found matching '${params.query}'. Try different keywords.`,
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const output = {
|
|
72
|
+
query: params.query,
|
|
73
|
+
page: params.page,
|
|
74
|
+
limit: params.limit,
|
|
75
|
+
count: skills.length,
|
|
76
|
+
total,
|
|
77
|
+
has_more: total !== undefined ? total > params.page * params.limit : undefined,
|
|
78
|
+
skills: skills.map((s) => ({
|
|
79
|
+
name: s.name,
|
|
80
|
+
description: s.description,
|
|
81
|
+
stars: s.stars,
|
|
82
|
+
author: s.author,
|
|
83
|
+
skillUrl: s.skillUrl,
|
|
84
|
+
githubUrl: s.githubUrl,
|
|
85
|
+
})),
|
|
86
|
+
};
|
|
87
|
+
let textContent;
|
|
88
|
+
if (params.response_format === ResponseFormat.MARKDOWN) {
|
|
89
|
+
textContent = formatSkillsMarkdown(skills, params.query, total);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
textContent = formatSkillsJson(skills, params.query, params.page, params.limit, total);
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
content: [{ type: "text", text: textContent }],
|
|
96
|
+
structuredContent: output,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
return {
|
|
101
|
+
content: [{ type: "text", text: handleApiError(error) }],
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
// Register AI semantic search tool
|
|
106
|
+
server.registerTool("skillsmp_ai_search", {
|
|
107
|
+
title: "AI Search Skills",
|
|
108
|
+
description: `Semantic search for skills using natural language queries. Powered by AI to understand intent.
|
|
109
|
+
|
|
110
|
+
Use this when keywords aren't enough - describe what you want to accomplish.
|
|
111
|
+
|
|
112
|
+
Parameters:
|
|
113
|
+
- query: Natural language query (e.g., "How to build REST APIs with authentication")
|
|
114
|
+
|
|
115
|
+
Examples: "tools for web scraping", "help with React testing", "automate deployments"`,
|
|
116
|
+
inputSchema: AISearchInputSchema,
|
|
117
|
+
annotations: {
|
|
118
|
+
readOnlyHint: true,
|
|
119
|
+
destructiveHint: false,
|
|
120
|
+
idempotentHint: true,
|
|
121
|
+
openWorldHint: true,
|
|
122
|
+
},
|
|
123
|
+
}, async (params) => {
|
|
124
|
+
try {
|
|
125
|
+
const data = await makeApiRequest("skills/ai-search", {
|
|
126
|
+
q: params.query,
|
|
127
|
+
});
|
|
128
|
+
// AI search returns skills nested in data.data[].skill
|
|
129
|
+
const skills = (data.data?.data || [])
|
|
130
|
+
.map((item) => item.skill)
|
|
131
|
+
.filter((skill) => skill !== undefined);
|
|
132
|
+
if (!skills.length) {
|
|
133
|
+
return {
|
|
134
|
+
content: [
|
|
135
|
+
{
|
|
136
|
+
type: "text",
|
|
137
|
+
text: `No skills found for '${params.query}'. Try rephrasing your query.`,
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
const output = {
|
|
143
|
+
query: params.query,
|
|
144
|
+
count: skills.length,
|
|
145
|
+
skills: skills.map((s) => ({
|
|
146
|
+
name: s.name,
|
|
147
|
+
description: s.description,
|
|
148
|
+
stars: s.stars,
|
|
149
|
+
author: s.author,
|
|
150
|
+
skillUrl: s.skillUrl,
|
|
151
|
+
githubUrl: s.githubUrl,
|
|
152
|
+
})),
|
|
153
|
+
};
|
|
154
|
+
let textContent;
|
|
155
|
+
if (params.response_format === ResponseFormat.MARKDOWN) {
|
|
156
|
+
textContent = formatSkillsMarkdown(skills, params.query);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
textContent = formatSkillsJson(skills, params.query);
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
content: [{ type: "text", text: textContent }],
|
|
163
|
+
structuredContent: output,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
return {
|
|
168
|
+
content: [{ type: "text", text: handleApiError(error) }],
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
// Register get skill content tool
|
|
173
|
+
server.registerTool("skillsmp_get_skill_content", {
|
|
174
|
+
title: "Get Skill Content",
|
|
175
|
+
description: `Read skill file content (SKILL.md) from a GitHub repository. Use to preview a skill before installing.
|
|
176
|
+
|
|
177
|
+
Parameters:
|
|
178
|
+
- owner: GitHub username/org (e.g., "anthropics")
|
|
179
|
+
- repo: Repository name (e.g., "claude-code")
|
|
180
|
+
- path: Path to skill folder (e.g., "plugins/frontend-design/skills/frontend-design")
|
|
181
|
+
- branch: Git branch (default: "main")
|
|
182
|
+
|
|
183
|
+
If path has no skill.md, returns directory listing.`,
|
|
184
|
+
inputSchema: GetSkillContentInputSchema,
|
|
185
|
+
annotations: {
|
|
186
|
+
readOnlyHint: true,
|
|
187
|
+
destructiveHint: false,
|
|
188
|
+
idempotentHint: true,
|
|
189
|
+
openWorldHint: true,
|
|
190
|
+
},
|
|
191
|
+
}, async (params) => {
|
|
192
|
+
try {
|
|
193
|
+
// Use GitHub raw content API directly
|
|
194
|
+
const basePath = params.path || "";
|
|
195
|
+
for (const fileName of SKILL_FILE_NAMES) {
|
|
196
|
+
const skillPath = basePath ? `${basePath}/${fileName}` : fileName;
|
|
197
|
+
const rawUrl = `https://raw.githubusercontent.com/${params.owner}/${params.repo}/${params.branch}/${skillPath}`;
|
|
198
|
+
try {
|
|
199
|
+
const response = await axios.get(rawUrl, {
|
|
200
|
+
timeout: 30000,
|
|
201
|
+
headers: {
|
|
202
|
+
Accept: "text/plain",
|
|
203
|
+
},
|
|
204
|
+
});
|
|
205
|
+
return {
|
|
206
|
+
content: [{ type: "text", text: response.data }],
|
|
207
|
+
structuredContent: {
|
|
208
|
+
owner: params.owner,
|
|
209
|
+
repo: params.repo,
|
|
210
|
+
path: skillPath,
|
|
211
|
+
branch: params.branch,
|
|
212
|
+
content: response.data,
|
|
213
|
+
},
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
catch {
|
|
217
|
+
// Try next file name
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
// If no skill file found, fall through to directory listing
|
|
222
|
+
throw new AxiosError("Skill file not found", "404", undefined, undefined, {
|
|
223
|
+
status: 404,
|
|
224
|
+
statusText: "Not Found",
|
|
225
|
+
headers: {},
|
|
226
|
+
config: {},
|
|
227
|
+
data: {},
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
catch (error) {
|
|
231
|
+
// If skill.md not found, try listing directory via GitHub API
|
|
232
|
+
if (error instanceof AxiosError && error.response?.status === 404) {
|
|
233
|
+
try {
|
|
234
|
+
const apiUrl = `https://api.github.com/repos/${params.owner}/${params.repo}/contents/${params.path || ""}?ref=${params.branch}`;
|
|
235
|
+
const dirResponse = await axios.get(apiUrl, {
|
|
236
|
+
timeout: 30000,
|
|
237
|
+
headers: {
|
|
238
|
+
Accept: "application/vnd.github.v3+json",
|
|
239
|
+
},
|
|
240
|
+
});
|
|
241
|
+
const items = dirResponse.data;
|
|
242
|
+
if (Array.isArray(items)) {
|
|
243
|
+
const listing = items.map((item) => ({
|
|
244
|
+
name: item.name,
|
|
245
|
+
type: item.type,
|
|
246
|
+
path: item.path,
|
|
247
|
+
}));
|
|
248
|
+
return {
|
|
249
|
+
content: [
|
|
250
|
+
{
|
|
251
|
+
type: "text",
|
|
252
|
+
text: `Directory listing for ${params.owner}/${params.repo}/${params.path || ""}:\n\n${JSON.stringify(listing, null, 2)}`,
|
|
253
|
+
},
|
|
254
|
+
],
|
|
255
|
+
structuredContent: {
|
|
256
|
+
owner: params.owner,
|
|
257
|
+
repo: params.repo,
|
|
258
|
+
path: params.path,
|
|
259
|
+
branch: params.branch,
|
|
260
|
+
type: "directory",
|
|
261
|
+
items: listing,
|
|
262
|
+
},
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
return {
|
|
266
|
+
content: [{ type: "text", text: JSON.stringify(dirResponse.data, null, 2) }],
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
catch {
|
|
270
|
+
return {
|
|
271
|
+
content: [{ type: "text", text: `Error: Path '${params.path}' not found in ${params.owner}/${params.repo}` }],
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return {
|
|
276
|
+
content: [{ type: "text", text: handleApiError(error) }],
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
// Register list repo skills tool
|
|
281
|
+
server.registerTool("skillsmp_list_repo_skills", {
|
|
282
|
+
title: "List Repository Skills",
|
|
283
|
+
description: `List all available skills in a GitHub repository without installing.
|
|
284
|
+
|
|
285
|
+
Parameters:
|
|
286
|
+
- source: GitHub shorthand "owner/repo" (e.g., "anthropics/claude-code")
|
|
287
|
+
|
|
288
|
+
Returns skill names and descriptions found in the repository.`,
|
|
289
|
+
inputSchema: ListRepoSkillsInputSchema,
|
|
290
|
+
annotations: {
|
|
291
|
+
readOnlyHint: true,
|
|
292
|
+
destructiveHint: false,
|
|
293
|
+
idempotentHint: true,
|
|
294
|
+
openWorldHint: true,
|
|
295
|
+
},
|
|
296
|
+
}, async (params) => {
|
|
297
|
+
try {
|
|
298
|
+
const { stdout, stderr } = await execAsync(`npx add-skill "${params.source}" --list`, { timeout: 60000 });
|
|
299
|
+
const output = stdout || stderr;
|
|
300
|
+
return {
|
|
301
|
+
content: [{ type: "text", text: output }],
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
catch (error) {
|
|
305
|
+
if (error instanceof Error && "stdout" in error) {
|
|
306
|
+
const execError = error;
|
|
307
|
+
const output = execError.stdout || execError.stderr || execError.message;
|
|
308
|
+
return {
|
|
309
|
+
content: [{ type: "text", text: `Error listing skills: ${output}` }],
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
return {
|
|
313
|
+
content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }],
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
// Register install skill tool
|
|
318
|
+
server.registerTool("skillsmp_install_skill", {
|
|
319
|
+
title: "Install Skill",
|
|
320
|
+
description: `Install skills from GitHub to AI coding agents.
|
|
321
|
+
|
|
322
|
+
Parameters:
|
|
323
|
+
- source: GitHub "owner/repo" (e.g., "anthropics/claude-code") [REQUIRED]
|
|
324
|
+
- skills: Skill names, comma-separated (e.g., "frontend-design,backend-dev") [REQUIRED]
|
|
325
|
+
- agents: Target agents, comma-separated [REQUIRED]
|
|
326
|
+
Valid: claude-code, cursor, codex, opencode, antigravity, github-copilot, roo
|
|
327
|
+
- global: Install user-level instead of project-level (default: false)
|
|
328
|
+
|
|
329
|
+
Example: source="anthropics/claude-code", skills="frontend-design", agents="claude-code"`,
|
|
330
|
+
inputSchema: InstallSkillInputSchema,
|
|
331
|
+
annotations: {
|
|
332
|
+
readOnlyHint: false,
|
|
333
|
+
destructiveHint: false,
|
|
334
|
+
idempotentHint: false,
|
|
335
|
+
openWorldHint: true,
|
|
336
|
+
},
|
|
337
|
+
}, async (params) => {
|
|
338
|
+
try {
|
|
339
|
+
// Validate required params
|
|
340
|
+
if (!params.skills || params.skills.length === 0) {
|
|
341
|
+
return {
|
|
342
|
+
content: [{ type: "text", text: "Error: 'skills' parameter is required. Specify skill names to install (comma-separated)." }],
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
if (!params.agents || params.agents.length === 0) {
|
|
346
|
+
return {
|
|
347
|
+
content: [{ type: "text", text: "Error: 'agents' parameter is required. Specify target agents (e.g., 'claude-code', 'cursor')." }],
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
// Build command: npx add-skill "source" -s skill1 skill2 -a agent1 agent2 -y [-g]
|
|
351
|
+
let cmd = `npx add-skill "${params.source}"`;
|
|
352
|
+
cmd += ` -s ${params.skills.map((s) => `"${s}"`).join(" ")}`;
|
|
353
|
+
cmd += ` -a ${params.agents.join(" ")}`;
|
|
354
|
+
cmd += " -y"; // Skip confirmation prompts
|
|
355
|
+
if (params.global) {
|
|
356
|
+
cmd += " -g";
|
|
357
|
+
}
|
|
358
|
+
const { stdout, stderr } = await execAsync(cmd, { timeout: 120000 });
|
|
359
|
+
const output = stdout || stderr || "Skill installed successfully.";
|
|
360
|
+
return {
|
|
361
|
+
content: [{ type: "text", text: output }],
|
|
362
|
+
structuredContent: {
|
|
363
|
+
success: true,
|
|
364
|
+
command: cmd,
|
|
365
|
+
source: params.source,
|
|
366
|
+
skills: params.skills,
|
|
367
|
+
agents: params.agents,
|
|
368
|
+
global: params.global,
|
|
369
|
+
output,
|
|
370
|
+
},
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
catch (error) {
|
|
374
|
+
if (error instanceof Error && "stdout" in error) {
|
|
375
|
+
const execError = error;
|
|
376
|
+
const output = execError.stdout || execError.stderr || execError.message;
|
|
377
|
+
return {
|
|
378
|
+
content: [{ type: "text", text: `Installation failed: ${output}` }],
|
|
379
|
+
structuredContent: {
|
|
380
|
+
success: false,
|
|
381
|
+
source: params.source,
|
|
382
|
+
error: output,
|
|
383
|
+
},
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
return {
|
|
387
|
+
content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }],
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
// Transport handlers
|
|
392
|
+
async function runStdio() {
|
|
393
|
+
const transport = new StdioServerTransport();
|
|
394
|
+
await server.connect(transport);
|
|
395
|
+
console.error("SkillsMP MCP server running via stdio");
|
|
396
|
+
}
|
|
397
|
+
async function runHttp() {
|
|
398
|
+
const app = express();
|
|
399
|
+
app.use(express.json());
|
|
400
|
+
app.post("/mcp", async (req, res) => {
|
|
401
|
+
const transport = new StreamableHTTPServerTransport({
|
|
402
|
+
sessionIdGenerator: undefined,
|
|
403
|
+
enableJsonResponse: true,
|
|
404
|
+
});
|
|
405
|
+
res.on("close", () => transport.close());
|
|
406
|
+
await server.connect(transport);
|
|
407
|
+
await transport.handleRequest(req, res, req.body);
|
|
408
|
+
});
|
|
409
|
+
const port = parseInt(process.env.PORT || "3000", 10);
|
|
410
|
+
app.listen(port, () => {
|
|
411
|
+
console.error(`SkillsMP MCP server running on http://localhost:${port}/mcp`);
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
// Main
|
|
415
|
+
const transport = process.env.TRANSPORT || "stdio";
|
|
416
|
+
if (transport === "http") {
|
|
417
|
+
runHttp().catch((error) => {
|
|
418
|
+
console.error("Server error:", error);
|
|
419
|
+
process.exit(1);
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
runStdio().catch((error) => {
|
|
424
|
+
console.error("Server error:", error);
|
|
425
|
+
process.exit(1);
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,OAAO;AAGL,QAAQ;AACR,cAAc;AAUd,UAAU;AACV,wBAAwB,EACxB,mBAAmB,EACnB,0BAA0B,EAC1B,yBAAyB,EACzB,uBAAuB,EAGvB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAEpB,MAAM,SAAS,GAAG,SAAS,CAAC,I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AAE,CAAC,CAAC;IACtD,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;QACpB,OAAO,CAAC,KAAK,CAAC,mDAAmD,IAAI,MAAM,CAAC,CAAC;IAC/E,CAAC,CAAC,CAAC;AACL,CAAC;AAED,OAAO;AACP,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,OAAO,CAAC;AAEnD,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;IACzB,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACxB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;QACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;KAAM,CAAC;IACN,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACzB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;QACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions and types for SkillsMP MCP Server.
|
|
3
|
+
* Extracted for testability.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
export declare const API_BASE_URL = "https://skillsmp.com/api/v1";
|
|
7
|
+
export declare const CHARACTER_LIMIT = 25000;
|
|
8
|
+
export declare const DEFAULT_LIMIT = 20;
|
|
9
|
+
export declare const MAX_LIMIT = 100;
|
|
10
|
+
export declare enum ResponseFormat {
|
|
11
|
+
MARKDOWN = "markdown",
|
|
12
|
+
JSON = "json"
|
|
13
|
+
}
|
|
14
|
+
export declare enum SortBy {
|
|
15
|
+
STARS = "stars",
|
|
16
|
+
RECENT = "recent"
|
|
17
|
+
}
|
|
18
|
+
export declare enum Agent {
|
|
19
|
+
CLAUDE_CODE = "claude-code",
|
|
20
|
+
OPENCODE = "opencode",
|
|
21
|
+
CODEX = "codex",
|
|
22
|
+
CURSOR = "cursor",
|
|
23
|
+
ANTIGRAVITY = "antigravity",
|
|
24
|
+
GITHUB_COPILOT = "github-copilot",
|
|
25
|
+
ROO = "roo"
|
|
26
|
+
}
|
|
27
|
+
export interface Skill {
|
|
28
|
+
id?: string;
|
|
29
|
+
name?: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
stars?: number;
|
|
32
|
+
author?: string;
|
|
33
|
+
skillUrl?: string;
|
|
34
|
+
githubUrl?: string;
|
|
35
|
+
updatedAt?: number;
|
|
36
|
+
[key: string]: unknown;
|
|
37
|
+
}
|
|
38
|
+
export interface KeywordSearchResponse {
|
|
39
|
+
success?: boolean;
|
|
40
|
+
data?: {
|
|
41
|
+
skills?: Skill[];
|
|
42
|
+
pagination?: {
|
|
43
|
+
page?: number;
|
|
44
|
+
limit?: number;
|
|
45
|
+
total?: number;
|
|
46
|
+
totalPages?: number;
|
|
47
|
+
hasNext?: boolean;
|
|
48
|
+
hasPrev?: boolean;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
error?: {
|
|
52
|
+
code?: string;
|
|
53
|
+
message?: string;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export interface AISearchResult {
|
|
57
|
+
file_id?: string;
|
|
58
|
+
filename?: string;
|
|
59
|
+
score?: number;
|
|
60
|
+
skill?: Skill;
|
|
61
|
+
}
|
|
62
|
+
export interface AISearchResponse {
|
|
63
|
+
success?: boolean;
|
|
64
|
+
data?: {
|
|
65
|
+
object?: string;
|
|
66
|
+
search_query?: string;
|
|
67
|
+
data?: AISearchResult[];
|
|
68
|
+
};
|
|
69
|
+
error?: {
|
|
70
|
+
code?: string;
|
|
71
|
+
message?: string;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export declare const KeywordSearchInputSchema: z.ZodObject<{
|
|
75
|
+
query: z.ZodString;
|
|
76
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
77
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
78
|
+
sort_by: z.ZodDefault<z.ZodNativeEnum<typeof SortBy>>;
|
|
79
|
+
response_format: z.ZodDefault<z.ZodNativeEnum<typeof ResponseFormat>>;
|
|
80
|
+
}, "strict", z.ZodTypeAny, {
|
|
81
|
+
query: string;
|
|
82
|
+
page: number;
|
|
83
|
+
limit: number;
|
|
84
|
+
sort_by: SortBy;
|
|
85
|
+
response_format: ResponseFormat;
|
|
86
|
+
}, {
|
|
87
|
+
query: string;
|
|
88
|
+
page?: number | undefined;
|
|
89
|
+
limit?: number | undefined;
|
|
90
|
+
sort_by?: SortBy | undefined;
|
|
91
|
+
response_format?: ResponseFormat | undefined;
|
|
92
|
+
}>;
|
|
93
|
+
export declare const AISearchInputSchema: z.ZodObject<{
|
|
94
|
+
query: z.ZodString;
|
|
95
|
+
response_format: z.ZodDefault<z.ZodNativeEnum<typeof ResponseFormat>>;
|
|
96
|
+
}, "strict", z.ZodTypeAny, {
|
|
97
|
+
query: string;
|
|
98
|
+
response_format: ResponseFormat;
|
|
99
|
+
}, {
|
|
100
|
+
query: string;
|
|
101
|
+
response_format?: ResponseFormat | undefined;
|
|
102
|
+
}>;
|
|
103
|
+
export declare const GetSkillContentInputSchema: z.ZodObject<{
|
|
104
|
+
owner: z.ZodString;
|
|
105
|
+
repo: z.ZodString;
|
|
106
|
+
path: z.ZodOptional<z.ZodString>;
|
|
107
|
+
branch: z.ZodDefault<z.ZodString>;
|
|
108
|
+
}, "strict", z.ZodTypeAny, {
|
|
109
|
+
owner: string;
|
|
110
|
+
repo: string;
|
|
111
|
+
branch: string;
|
|
112
|
+
path?: string | undefined;
|
|
113
|
+
}, {
|
|
114
|
+
owner: string;
|
|
115
|
+
repo: string;
|
|
116
|
+
path?: string | undefined;
|
|
117
|
+
branch?: string | undefined;
|
|
118
|
+
}>;
|
|
119
|
+
export declare const ListRepoSkillsInputSchema: z.ZodObject<{
|
|
120
|
+
source: z.ZodString;
|
|
121
|
+
}, "strict", z.ZodTypeAny, {
|
|
122
|
+
source: string;
|
|
123
|
+
}, {
|
|
124
|
+
source: string;
|
|
125
|
+
}>;
|
|
126
|
+
export declare const InstallSkillInputSchema: z.ZodObject<{
|
|
127
|
+
source: z.ZodString;
|
|
128
|
+
skills: z.ZodEffects<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>, string[], string | string[]>;
|
|
129
|
+
agents: z.ZodEffects<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>, string[], string | string[]>;
|
|
130
|
+
global: z.ZodEffects<z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>, boolean, string | boolean | undefined>;
|
|
131
|
+
}, "strict", z.ZodTypeAny, {
|
|
132
|
+
source: string;
|
|
133
|
+
skills: string[];
|
|
134
|
+
agents: string[];
|
|
135
|
+
global: boolean;
|
|
136
|
+
}, {
|
|
137
|
+
source: string;
|
|
138
|
+
skills: string | string[];
|
|
139
|
+
agents: string | string[];
|
|
140
|
+
global?: string | boolean | undefined;
|
|
141
|
+
}>;
|
|
142
|
+
export type KeywordSearchInput = z.infer<typeof KeywordSearchInputSchema>;
|
|
143
|
+
export type AISearchInput = z.infer<typeof AISearchInputSchema>;
|
|
144
|
+
export type GetSkillContentInput = z.infer<typeof GetSkillContentInputSchema>;
|
|
145
|
+
export type ListRepoSkillsInput = z.infer<typeof ListRepoSkillsInputSchema>;
|
|
146
|
+
export type InstallSkillInput = z.infer<typeof InstallSkillInputSchema>;
|
|
147
|
+
export declare function getApiKey(): string;
|
|
148
|
+
export declare function makeApiRequest<T>(endpoint: string, params: Record<string, string | number | undefined>): Promise<T>;
|
|
149
|
+
export declare function handleApiError(error: unknown): string;
|
|
150
|
+
export declare function formatSkillsMarkdown(skills: Skill[], query: string, total?: number): string;
|
|
151
|
+
export declare function formatSkillsJson(skills: Skill[], query: string, page?: number, limit?: number, total?: number): string;
|
|
152
|
+
export declare function buildInstallCommand(params: {
|
|
153
|
+
source: string;
|
|
154
|
+
skills: string[];
|
|
155
|
+
agents: string[];
|
|
156
|
+
global: boolean;
|
|
157
|
+
}): string;
|
|
158
|
+
export declare function buildRawGitHubUrl(owner: string, repo: string, branch: string, path: string): string;
|
|
159
|
+
export declare function buildGitHubApiUrl(owner: string, repo: string, path: string, branch: string): string;
|
|
160
|
+
export declare const SKILL_FILE_NAMES: string[];
|
|
161
|
+
export declare function buildSkillPath(basePath: string, fileName: string): string;
|
|
162
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,YAAY,gCAAgC,CAAC;AAC1D,eAAO,MAAM,eAAe,QAAQ,CAAC;AACrC,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,eAAO,MAAM,SAAS,MAAM,CAAC;AAG7B,oBAAY,cAAc;IACxB,QAAQ,aAAa;IACrB,IAAI,SAAS;CACd;AAED,oBAAY,MAAM;IAChB,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED,oBAAY,KAAK;IACf,WAAW,gBAAgB;IAC3B,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,cAAc,mBAAmB;IACjC,GAAG,QAAQ;CACZ;AAGD,MAAM,WAAW,KAAK;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC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AE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB,GAAG,MAAM,CAST;AAGD,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,MAAM,CAER;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACb,MAAM,CAER;AAED,eAAO,MAAM,gBAAgB,UAAuC,CAAC;AAErE,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEzE"}
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions and types for SkillsMP MCP Server.
|
|
3
|
+
* Extracted for testability.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import axios, { AxiosError } from "axios";
|
|
7
|
+
// Constants
|
|
8
|
+
export const API_BASE_URL = "https://skillsmp.com/api/v1";
|
|
9
|
+
export const CHARACTER_LIMIT = 25000;
|
|
10
|
+
export const DEFAULT_LIMIT = 20;
|
|
11
|
+
export const MAX_LIMIT = 100;
|
|
12
|
+
// Enums
|
|
13
|
+
export var ResponseFormat;
|
|
14
|
+
(function (ResponseFormat) {
|
|
15
|
+
ResponseFormat["MARKDOWN"] = "markdown";
|
|
16
|
+
ResponseFormat["JSON"] = "json";
|
|
17
|
+
})(ResponseFormat || (ResponseFormat = {}));
|
|
18
|
+
export var SortBy;
|
|
19
|
+
(function (SortBy) {
|
|
20
|
+
SortBy["STARS"] = "stars";
|
|
21
|
+
SortBy["RECENT"] = "recent";
|
|
22
|
+
})(SortBy || (SortBy = {}));
|
|
23
|
+
export var Agent;
|
|
24
|
+
(function (Agent) {
|
|
25
|
+
Agent["CLAUDE_CODE"] = "claude-code";
|
|
26
|
+
Agent["OPENCODE"] = "opencode";
|
|
27
|
+
Agent["CODEX"] = "codex";
|
|
28
|
+
Agent["CURSOR"] = "cursor";
|
|
29
|
+
Agent["ANTIGRAVITY"] = "antigravity";
|
|
30
|
+
Agent["GITHUB_COPILOT"] = "github-copilot";
|
|
31
|
+
Agent["ROO"] = "roo";
|
|
32
|
+
})(Agent || (Agent = {}));
|
|
33
|
+
// Zod Schemas
|
|
34
|
+
export const KeywordSearchInputSchema = z
|
|
35
|
+
.object({
|
|
36
|
+
query: z
|
|
37
|
+
.string()
|
|
38
|
+
.min(1, "Query is required")
|
|
39
|
+
.max(200, "Query must not exceed 200 characters")
|
|
40
|
+
.describe("Search query for skills (e.g., 'SEO', 'web scraper', 'data analysis')"),
|
|
41
|
+
page: z
|
|
42
|
+
.number()
|
|
43
|
+
.int()
|
|
44
|
+
.min(1)
|
|
45
|
+
.default(1)
|
|
46
|
+
.describe("Page number for pagination"),
|
|
47
|
+
limit: z
|
|
48
|
+
.number()
|
|
49
|
+
.int()
|
|
50
|
+
.min(1)
|
|
51
|
+
.max(MAX_LIMIT)
|
|
52
|
+
.default(DEFAULT_LIMIT)
|
|
53
|
+
.describe(`Items per page (default: ${DEFAULT_LIMIT}, max: ${MAX_LIMIT})`),
|
|
54
|
+
sort_by: z
|
|
55
|
+
.nativeEnum(SortBy)
|
|
56
|
+
.default(SortBy.STARS)
|
|
57
|
+
.describe("Sort results by: 'stars' (default) or 'recent'"),
|
|
58
|
+
response_format: z
|
|
59
|
+
.nativeEnum(ResponseFormat)
|
|
60
|
+
.default(ResponseFormat.MARKDOWN)
|
|
61
|
+
.describe("Output format: 'markdown' for human-readable or 'json' for machine-readable"),
|
|
62
|
+
})
|
|
63
|
+
.strict();
|
|
64
|
+
export const AISearchInputSchema = z
|
|
65
|
+
.object({
|
|
66
|
+
query: z
|
|
67
|
+
.string()
|
|
68
|
+
.min(1, "Query is required")
|
|
69
|
+
.max(500, "Query must not exceed 500 characters")
|
|
70
|
+
.describe("Natural language query for AI semantic search (e.g., 'How to create a web scraper', 'tools for SEO optimization')"),
|
|
71
|
+
response_format: z
|
|
72
|
+
.nativeEnum(ResponseFormat)
|
|
73
|
+
.default(ResponseFormat.MARKDOWN)
|
|
74
|
+
.describe("Output format: 'markdown' for human-readable or 'json' for machine-readable"),
|
|
75
|
+
})
|
|
76
|
+
.strict();
|
|
77
|
+
export const GetSkillContentInputSchema = z
|
|
78
|
+
.object({
|
|
79
|
+
owner: z
|
|
80
|
+
.string()
|
|
81
|
+
.min(1)
|
|
82
|
+
.describe("GitHub repository owner (e.g., 'davila7')"),
|
|
83
|
+
repo: z
|
|
84
|
+
.string()
|
|
85
|
+
.min(1)
|
|
86
|
+
.describe("GitHub repository name (e.g., 'claude-code-templates')"),
|
|
87
|
+
path: z
|
|
88
|
+
.string()
|
|
89
|
+
.optional()
|
|
90
|
+
.describe("Path to skill within repo (e.g., 'cli-tool/components/skills/development/senior-prompt-engineer'). If not provided, lists available skills."),
|
|
91
|
+
branch: z
|
|
92
|
+
.string()
|
|
93
|
+
.default("main")
|
|
94
|
+
.describe("Git branch (default: 'main')"),
|
|
95
|
+
})
|
|
96
|
+
.strict();
|
|
97
|
+
export const ListRepoSkillsInputSchema = z
|
|
98
|
+
.object({
|
|
99
|
+
source: z
|
|
100
|
+
.string()
|
|
101
|
+
.min(1)
|
|
102
|
+
.describe("GitHub shorthand 'owner/repo' (e.g., 'davila7/claude-code-templates') or full GitHub URL"),
|
|
103
|
+
})
|
|
104
|
+
.strict();
|
|
105
|
+
export const InstallSkillInputSchema = z
|
|
106
|
+
.object({
|
|
107
|
+
source: z
|
|
108
|
+
.string()
|
|
109
|
+
.min(1)
|
|
110
|
+
.describe("GitHub shorthand 'owner/repo' (e.g., 'davila7/claude-code-templates'), full GitHub URL, or local path"),
|
|
111
|
+
skills: z
|
|
112
|
+
.union([z.array(z.string()), z.string()])
|
|
113
|
+
.transform((val) => {
|
|
114
|
+
if (!val)
|
|
115
|
+
return [];
|
|
116
|
+
if (typeof val === "string")
|
|
117
|
+
return val.split(",").map((s) => s.trim());
|
|
118
|
+
return val;
|
|
119
|
+
})
|
|
120
|
+
.describe("Skill names to install (comma-separated: 'skill1,skill2' or array). REQUIRED."),
|
|
121
|
+
agents: z
|
|
122
|
+
.union([z.array(z.string()), z.string()])
|
|
123
|
+
.transform((val) => {
|
|
124
|
+
if (!val)
|
|
125
|
+
return [];
|
|
126
|
+
if (typeof val === "string")
|
|
127
|
+
return val.split(",").map((s) => s.trim());
|
|
128
|
+
return val;
|
|
129
|
+
})
|
|
130
|
+
.describe("Target agents (comma-separated: 'claude-code,cursor'). Valid: opencode, claude-code, codex, cursor, antigravity, github-copilot, roo. REQUIRED."),
|
|
131
|
+
global: z
|
|
132
|
+
.union([z.boolean(), z.string()])
|
|
133
|
+
.default(false)
|
|
134
|
+
.transform((val) => val === true || val === "true")
|
|
135
|
+
.describe("Install globally (user-level) instead of project-level (default: false)"),
|
|
136
|
+
})
|
|
137
|
+
.strict();
|
|
138
|
+
// Utility Functions
|
|
139
|
+
export function getApiKey() {
|
|
140
|
+
const apiKey = process.env.SKILLSMP_API_KEY;
|
|
141
|
+
if (!apiKey) {
|
|
142
|
+
throw new Error("SKILLSMP_API_KEY environment variable is required. Set it with your SkillsMP API key.");
|
|
143
|
+
}
|
|
144
|
+
return apiKey;
|
|
145
|
+
}
|
|
146
|
+
export async function makeApiRequest(endpoint, params) {
|
|
147
|
+
const apiKey = getApiKey();
|
|
148
|
+
const filteredParams = {};
|
|
149
|
+
for (const [key, value] of Object.entries(params)) {
|
|
150
|
+
if (value !== undefined) {
|
|
151
|
+
filteredParams[key] = value;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
const response = await axios.get(`${API_BASE_URL}/${endpoint}`, {
|
|
155
|
+
params: filteredParams,
|
|
156
|
+
headers: {
|
|
157
|
+
Authorization: `Bearer ${apiKey}`,
|
|
158
|
+
Accept: "application/json",
|
|
159
|
+
},
|
|
160
|
+
timeout: 30000,
|
|
161
|
+
});
|
|
162
|
+
return response.data;
|
|
163
|
+
}
|
|
164
|
+
export function handleApiError(error) {
|
|
165
|
+
if (error instanceof AxiosError) {
|
|
166
|
+
if (error.response) {
|
|
167
|
+
const status = error.response.status;
|
|
168
|
+
const data = error.response.data;
|
|
169
|
+
const errorCode = data?.error?.code;
|
|
170
|
+
const errorMsg = data?.error?.message;
|
|
171
|
+
if (status === 401) {
|
|
172
|
+
if (errorCode === "MISSING_API_KEY") {
|
|
173
|
+
return "Error: API key not provided. Set SKILLSMP_API_KEY environment variable.";
|
|
174
|
+
}
|
|
175
|
+
if (errorCode === "INVALID_API_KEY") {
|
|
176
|
+
return "Error: Invalid API key. Check your SKILLSMP_API_KEY value.";
|
|
177
|
+
}
|
|
178
|
+
return `Error: Authentication failed - ${errorMsg || "Unknown auth error"}`;
|
|
179
|
+
}
|
|
180
|
+
if (status === 400) {
|
|
181
|
+
return `Error: Bad request - ${errorMsg || "Check your query parameters."}`;
|
|
182
|
+
}
|
|
183
|
+
if (status === 429) {
|
|
184
|
+
return "Error: Rate limit exceeded. Please wait before making more requests.";
|
|
185
|
+
}
|
|
186
|
+
if (status === 500) {
|
|
187
|
+
return "Error: SkillsMP server error. Please try again later.";
|
|
188
|
+
}
|
|
189
|
+
return `Error: API request failed (${status}) - ${errorMsg || "Unknown error"}`;
|
|
190
|
+
}
|
|
191
|
+
if (error.code === "ECONNABORTED") {
|
|
192
|
+
return "Error: Request timed out. Please try again.";
|
|
193
|
+
}
|
|
194
|
+
if (error.code === "ENOTFOUND" || error.code === "ECONNREFUSED") {
|
|
195
|
+
return "Error: Cannot connect to SkillsMP API. Check your network connection.";
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
if (error instanceof Error) {
|
|
199
|
+
return `Error: ${error.message}`;
|
|
200
|
+
}
|
|
201
|
+
return `Error: Unexpected error - ${String(error)}`;
|
|
202
|
+
}
|
|
203
|
+
export function formatSkillsMarkdown(skills, query, total) {
|
|
204
|
+
const lines = [`# Skills Search Results: '${query}'`, ""];
|
|
205
|
+
if (total !== undefined) {
|
|
206
|
+
lines.push(`Found ${total} skills (showing ${skills.length})`);
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
lines.push(`Found ${skills.length} skills`);
|
|
210
|
+
}
|
|
211
|
+
lines.push("");
|
|
212
|
+
for (const skill of skills) {
|
|
213
|
+
const name = skill.name || "Unknown";
|
|
214
|
+
const description = skill.description || "No description";
|
|
215
|
+
const stars = skill.stars || 0;
|
|
216
|
+
const author = skill.author || "Unknown";
|
|
217
|
+
const skillUrl = skill.skillUrl || "";
|
|
218
|
+
const githubUrl = skill.githubUrl || "";
|
|
219
|
+
lines.push(`## ${name}`);
|
|
220
|
+
if (stars) {
|
|
221
|
+
lines.push(`ā ${stars} stars | By: ${author}`);
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
lines.push(`By: ${author}`);
|
|
225
|
+
}
|
|
226
|
+
lines.push("");
|
|
227
|
+
lines.push(description);
|
|
228
|
+
if (skillUrl) {
|
|
229
|
+
lines.push(`\nš [View Skill](${skillUrl})`);
|
|
230
|
+
}
|
|
231
|
+
if (githubUrl) {
|
|
232
|
+
lines.push(`š¦ [GitHub](${githubUrl})`);
|
|
233
|
+
}
|
|
234
|
+
lines.push("");
|
|
235
|
+
lines.push("---");
|
|
236
|
+
lines.push("");
|
|
237
|
+
}
|
|
238
|
+
return lines.join("\n");
|
|
239
|
+
}
|
|
240
|
+
export function formatSkillsJson(skills, query, page = 1, limit = DEFAULT_LIMIT, total) {
|
|
241
|
+
const response = {
|
|
242
|
+
query,
|
|
243
|
+
page,
|
|
244
|
+
limit,
|
|
245
|
+
count: skills.length,
|
|
246
|
+
skills,
|
|
247
|
+
};
|
|
248
|
+
if (total !== undefined) {
|
|
249
|
+
response.total = total;
|
|
250
|
+
response.has_more = total > page * limit;
|
|
251
|
+
}
|
|
252
|
+
let result = JSON.stringify(response, null, 2);
|
|
253
|
+
if (result.length > CHARACTER_LIMIT) {
|
|
254
|
+
const half = Math.max(1, Math.floor(skills.length / 2));
|
|
255
|
+
response.skills = skills.slice(0, half);
|
|
256
|
+
response.truncated = true;
|
|
257
|
+
response.truncation_message = `Response truncated from ${skills.length} to ${half} items. Use 'page' parameter to see more results.`;
|
|
258
|
+
result = JSON.stringify(response, null, 2);
|
|
259
|
+
}
|
|
260
|
+
return result;
|
|
261
|
+
}
|
|
262
|
+
// Command building utility for install
|
|
263
|
+
export function buildInstallCommand(params) {
|
|
264
|
+
let cmd = `npx add-skill "${params.source}"`;
|
|
265
|
+
cmd += ` -s ${params.skills.map((s) => `"${s}"`).join(" ")}`;
|
|
266
|
+
cmd += ` -a ${params.agents.join(" ")}`;
|
|
267
|
+
cmd += " -y";
|
|
268
|
+
if (params.global) {
|
|
269
|
+
cmd += " -g";
|
|
270
|
+
}
|
|
271
|
+
return cmd;
|
|
272
|
+
}
|
|
273
|
+
// GitHub URL construction utilities
|
|
274
|
+
export function buildRawGitHubUrl(owner, repo, branch, path) {
|
|
275
|
+
return `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${path}`;
|
|
276
|
+
}
|
|
277
|
+
export function buildGitHubApiUrl(owner, repo, path, branch) {
|
|
278
|
+
return `https://api.github.com/repos/${owner}/${repo}/contents/${path}?ref=${branch}`;
|
|
279
|
+
}
|
|
280
|
+
export const SKILL_FILE_NAMES = ["skill.md", "SKILL.md", "Skill.md"];
|
|
281
|
+
export function buildSkillPath(basePath, fileName) {
|
|
282
|
+
return basePath ? `${basePath}/${fileName}` : fileName;
|
|
283
|
+
}
|
|
284
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,U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E,CAAC;AACxF,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AAErE,MAAM,UAAU,cAAc,CAAC,QAAgB,EAAE,QAAgB;IAC/D,OAAO,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;AACzD,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "skillsmp-mcp-server",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for SkillsMP - Search, discover, and install AI coding skills",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"skillsmp-mcp-server": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"start": "node dist/index.js",
|
|
17
|
+
"dev": "tsx watch src/index.ts",
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"clean": "rm -rf dist",
|
|
20
|
+
"test": "vitest",
|
|
21
|
+
"test:run": "vitest run",
|
|
22
|
+
"test:coverage": "vitest run --coverage",
|
|
23
|
+
"prepublishOnly": "npm run clean && npm run build && npm run test:run"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=18"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"mcp",
|
|
30
|
+
"model-context-protocol",
|
|
31
|
+
"skillsmp",
|
|
32
|
+
"ai-skills",
|
|
33
|
+
"claude",
|
|
34
|
+
"cursor",
|
|
35
|
+
"codex",
|
|
36
|
+
"ai-assistant",
|
|
37
|
+
"developer-tools"
|
|
38
|
+
],
|
|
39
|
+
"author": "Anilcan Cakir <anilcan.cakir@gmail.com>",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://github.com/anilcancakir/skillsmp-mcp-server.git"
|
|
44
|
+
},
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/anilcancakir/skillsmp-mcp-server/issues"
|
|
47
|
+
},
|
|
48
|
+
"homepage": "https://github.com/anilcancakir/skillsmp-mcp-server#readme",
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@modelcontextprotocol/sdk": "^1.6.1",
|
|
51
|
+
"axios": "^1.7.9",
|
|
52
|
+
"express": "^4.21.2",
|
|
53
|
+
"zod": "^3.23.8"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/express": "^5.0.0",
|
|
57
|
+
"@types/node": "^22.10.0",
|
|
58
|
+
"@vitest/coverage-v8": "^4.0.17",
|
|
59
|
+
"axios-mock-adapter": "^2.1.0",
|
|
60
|
+
"tsx": "^4.19.2",
|
|
61
|
+
"typescript": "^5.7.2",
|
|
62
|
+
"vitest": "^4.0.17"
|
|
63
|
+
}
|
|
64
|
+
}
|