ring-skills-mcp 1.0.6 → 1.0.8
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 +25 -13
- package/dist/index.js +50 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ An MCP (Model Context Protocol) service for fetching and installing company Skil
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- **list_skills** - Fetch company Skills list, supports search and pagination
|
|
8
|
-
- **install_skill** - Install skill to local project by
|
|
8
|
+
- **install_skill** - Install skill to local project by gitUrl (supports GitHub and GitLab)
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
|
@@ -20,8 +20,7 @@ npm run build
|
|
|
20
20
|
|
|
21
21
|
| Variable | Description | Default |
|
|
22
22
|
|----------|-------------|---------|
|
|
23
|
-
| `SKILLS_API_HOST` | API server address |
|
|
24
|
-
| `SKILLS_REPO` | Skills repository path | `anthropics/skills` |
|
|
23
|
+
| `SKILLS_API_HOST` | API server address | None |
|
|
25
24
|
| `SKILLS_AUTH_TOKEN` | API authentication token (required) | None |
|
|
26
25
|
|
|
27
26
|
## Usage in Cursor
|
|
@@ -38,7 +37,6 @@ Add the following MCP configuration in Cursor settings:
|
|
|
38
37
|
"args": ["ring-skills-mcp@latest"],
|
|
39
38
|
"env": {
|
|
40
39
|
"SKILLS_API_HOST": "http://your-api-host:8000",
|
|
41
|
-
"SKILLS_REPO": "your-org/skills-repo",
|
|
42
40
|
"SKILLS_AUTH_TOKEN": "your-auth-token-here"
|
|
43
41
|
}
|
|
44
42
|
}
|
|
@@ -55,8 +53,7 @@ Add the following MCP configuration in Cursor settings:
|
|
|
55
53
|
"command": "node",
|
|
56
54
|
"args": ["/path/to/ring-skills-mcp/dist/index.js"],
|
|
57
55
|
"env": {
|
|
58
|
-
"SKILLS_API_HOST": "
|
|
59
|
-
"SKILLS_REPO": "your-org/skills-repo",
|
|
56
|
+
"SKILLS_API_HOST": "http://your-api-host:8000",
|
|
60
57
|
"SKILLS_AUTH_TOKEN": "your-auth-token-here"
|
|
61
58
|
}
|
|
62
59
|
}
|
|
@@ -73,8 +70,7 @@ Add the following MCP configuration in Cursor settings:
|
|
|
73
70
|
"command": "npx",
|
|
74
71
|
"args": ["tsx", "/path/to/ring-skills-mcp/src/index.ts"],
|
|
75
72
|
"env": {
|
|
76
|
-
"SKILLS_API_HOST": "
|
|
77
|
-
"SKILLS_REPO": "your-org/skills-repo",
|
|
73
|
+
"SKILLS_API_HOST": "http://your-api-host:8000",
|
|
78
74
|
"SKILLS_AUTH_TOKEN": "your-auth-token-here"
|
|
79
75
|
}
|
|
80
76
|
}
|
|
@@ -102,17 +98,33 @@ Search for skills containing "pdf"
|
|
|
102
98
|
|
|
103
99
|
### install_skill
|
|
104
100
|
|
|
105
|
-
Install the specified skill to local project.
|
|
101
|
+
Install the specified skill to local project by gitUrl.
|
|
106
102
|
|
|
107
103
|
**Parameters:**
|
|
108
|
-
- `
|
|
104
|
+
- `gitUrl` (required): Git URL of the skill. Supports both GitHub and GitLab URLs.
|
|
109
105
|
- `projectPath` (required): Project path where the skill will be installed. Please provide the project root directory path of the currently opened file in IDE
|
|
110
|
-
- `targetDir` (optional): Installation target directory, default is
|
|
111
|
-
|
|
106
|
+
- `targetDir` (optional): Installation target directory, default is `.claude/skills`
|
|
107
|
+
|
|
108
|
+
**Supported URL Formats:**
|
|
109
|
+
|
|
110
|
+
| Platform | URL Format | Installation Method |
|
|
111
|
+
|----------|------------|---------------------|
|
|
112
|
+
| GitHub | `https://github.com/{owner}/{repo}/tree/{branch}/{path}` | `npx degit` (fast, no git history) |
|
|
113
|
+
| GitLab | `https://{host}/{owner}/{repo}/-/tree/{branch}/{path}` | `git sparse-checkout` via SSH (no login required for internal networks) |
|
|
114
|
+
|
|
115
|
+
**Example URLs:**
|
|
116
|
+
```
|
|
117
|
+
# GitHub
|
|
118
|
+
https://github.com/anthropics/skills/tree/main/skills/docx
|
|
119
|
+
|
|
120
|
+
# GitLab (self-hosted)
|
|
121
|
+
https://git.ringcentral.com/ai-testing/aiter-skills/-/tree/main/.agent/skills/nova-scripts-generator
|
|
122
|
+
```
|
|
112
123
|
|
|
113
124
|
**Example usage:**
|
|
114
125
|
```
|
|
115
|
-
Install
|
|
126
|
+
Install skill from GitHub URL to /Users/xxx/my-project
|
|
127
|
+
Install skill from GitLab URL to /Users/xxx/my-project
|
|
116
128
|
```
|
|
117
129
|
|
|
118
130
|
## Development
|
package/dist/index.js
CHANGED
|
@@ -98,18 +98,45 @@ function parseGitUrl(gitUrl) {
|
|
|
98
98
|
return null;
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
|
-
*
|
|
101
|
+
* Install Skill from GitHub using degit
|
|
102
102
|
*/
|
|
103
|
-
function
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
103
|
+
async function installFromGitHub(urlInfo, destPath) {
|
|
104
|
+
// GitHub: owner/repo/path#branch
|
|
105
|
+
const sourcePath = `${urlInfo.owner}/${urlInfo.repo}/${urlInfo.skillPath}#${urlInfo.branch}`;
|
|
106
|
+
const command = `npx degit ${sourcePath} ${destPath}`;
|
|
107
|
+
const { stdout, stderr } = await execAsync(command);
|
|
108
|
+
const output = stdout || stderr || "Installation completed";
|
|
109
|
+
return `✅ Skill "${urlInfo.skillName}" has been successfully installed to ${destPath}\n\nSource: ${sourcePath}\n${output}`;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Install Skill from GitLab using git sparse-checkout
|
|
113
|
+
* For private GitLab repositories that degit doesn't support
|
|
114
|
+
* Uses SSH format for internal networks (no login required)
|
|
115
|
+
*/
|
|
116
|
+
async function installFromGitLab(urlInfo, destPath) {
|
|
117
|
+
const skillsDir = path.dirname(destPath);
|
|
118
|
+
const tempDir = `temp-${urlInfo.skillName}-${Date.now()}`;
|
|
119
|
+
// Use SSH format for GitLab (no login required for internal networks)
|
|
120
|
+
const repoUrl = `git@${urlInfo.host}:${urlInfo.owner}/${urlInfo.repo}.git`;
|
|
121
|
+
// Build command sequence:
|
|
122
|
+
// 1. Create target directory
|
|
123
|
+
// 2. Clone with sparse checkout
|
|
124
|
+
// 3. Set sparse-checkout path
|
|
125
|
+
// 4. Move skill folder to destination
|
|
126
|
+
// 5. Cleanup temp directory
|
|
127
|
+
const commands = [
|
|
128
|
+
`mkdir -p ${skillsDir}`,
|
|
129
|
+
`cd ${skillsDir}`,
|
|
130
|
+
`git clone --depth 1 --filter=blob:none --sparse ${repoUrl} ${tempDir}`,
|
|
131
|
+
`cd ${tempDir}`,
|
|
132
|
+
`git sparse-checkout set ${urlInfo.skillPath}`,
|
|
133
|
+
`cd ..`,
|
|
134
|
+
`mv ${tempDir}/${urlInfo.skillPath} ${urlInfo.skillName}`,
|
|
135
|
+
`rm -rf ${tempDir}`,
|
|
136
|
+
].join(" && ");
|
|
137
|
+
const { stdout, stderr } = await execAsync(commands);
|
|
138
|
+
const output = stdout || stderr || "Installation completed";
|
|
139
|
+
return `✅ Skill "${urlInfo.skillName}" has been successfully installed to ${destPath}\n\nSource: ${repoUrl} (${urlInfo.skillPath})\n${output}`;
|
|
113
140
|
}
|
|
114
141
|
/**
|
|
115
142
|
* Install Skill to specified project using gitUrl
|
|
@@ -121,15 +148,18 @@ async function installSkillFromGitUrl(gitUrl, projectPath, targetDir = ".claude/
|
|
|
121
148
|
}
|
|
122
149
|
const skillName = urlInfo.skillName;
|
|
123
150
|
const destPath = path.join(projectPath, targetDir, skillName);
|
|
124
|
-
const sourcePath = buildDegitSource(urlInfo);
|
|
125
|
-
if (!sourcePath) {
|
|
126
|
-
throw new Error(`Could not build degit source from URL: ${gitUrl}`);
|
|
127
|
-
}
|
|
128
|
-
const command = `npx degit ${sourcePath} ${destPath}`;
|
|
129
151
|
try {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
152
|
+
if (urlInfo.type === "github") {
|
|
153
|
+
// Use degit for GitHub (faster, no git history)
|
|
154
|
+
return await installFromGitHub(urlInfo, destPath);
|
|
155
|
+
}
|
|
156
|
+
else if (urlInfo.type === "gitlab") {
|
|
157
|
+
// Use git sparse-checkout for GitLab (supports private repos)
|
|
158
|
+
return await installFromGitLab(urlInfo, destPath);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
throw new Error(`Unsupported git URL type: ${gitUrl}`);
|
|
162
|
+
}
|
|
133
163
|
}
|
|
134
164
|
catch (error) {
|
|
135
165
|
if (error instanceof Error) {
|
|
@@ -208,7 +238,7 @@ server.tool("list_skills", "Fetch company Skills list. You can search for specif
|
|
|
208
238
|
}
|
|
209
239
|
});
|
|
210
240
|
// Register tool: Install Skill
|
|
211
|
-
server.tool("install_skill", "Install skill to local project by gitUrl. Uses npx degit
|
|
241
|
+
server.tool("install_skill", "Install skill to local project by gitUrl. Uses npx degit for GitHub repositories and git sparse-checkout for GitLab repositories. Project path is required, which can be the project path of the currently opened file in IDE.", {
|
|
212
242
|
gitUrl: z.string().describe("Git URL of the skill (e.g., 'https://github.com/anthropics/skills/tree/main/skills/webapp-testing'). The skill name will be extracted from this URL."),
|
|
213
243
|
projectPath: z
|
|
214
244
|
.string()
|