@skillbrickai/mcp-server 0.1.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 +74 -0
- package/dist/http.d.ts +13 -0
- package/dist/http.js +86 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +12 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +1656 -0
- package/package.json +74 -0
package/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# @skillbrickai/mcp-server
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server for discovering and installing skills from the [SkillBrick AI](https://skillbrickai.com) platform. This lets AI agents like Claude search, browse, and install skills directly.
|
|
4
|
+
|
|
5
|
+
## Available Tools
|
|
6
|
+
|
|
7
|
+
| Tool | Description |
|
|
8
|
+
|------|-------------|
|
|
9
|
+
| `search_skills` | Search and browse skills by query, domain, tag, or sort order. Auto-infers domain and technology from natural language queries. |
|
|
10
|
+
| `get_skill` | Get full skill details including prompt content |
|
|
11
|
+
| `install_skill` | Install a skill (requires auth token) |
|
|
12
|
+
| `upload_skill` | Upload or update a skill (upsert, requires auth token) |
|
|
13
|
+
| `sync_skills` | Bulk-sync multiple skills in one call (requires auth token) |
|
|
14
|
+
| `my_skills` | List all skills owned by the authenticated user |
|
|
15
|
+
| `check_credits` | Check download credit balance |
|
|
16
|
+
| `list_collections` | Browse skill collections |
|
|
17
|
+
| `get_collection` | Get a collection with all its skills |
|
|
18
|
+
| `list_domains` | List available skill domains/categories |
|
|
19
|
+
| `recommend_skills` | Intelligent skill recommendations based on a task description |
|
|
20
|
+
|
|
21
|
+
## Setup
|
|
22
|
+
|
|
23
|
+
### Build
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pnpm install
|
|
27
|
+
pnpm --filter @skillbrickai/mcp-server build
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Claude Desktop
|
|
31
|
+
|
|
32
|
+
Add to your Claude Desktop config file (`claude_desktop_config.json`):
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"mcpServers": {
|
|
37
|
+
"skillbrickai": {
|
|
38
|
+
"command": "node",
|
|
39
|
+
"args": ["C:/Users/user/Documents/skillbrickai/packages/mcp-server/dist/index.js"],
|
|
40
|
+
"env": {
|
|
41
|
+
"SKILLBRICK_API_URL": "https://skillbrickai.com",
|
|
42
|
+
"SKILLBRICK_API_TOKEN": "your-api-token-here"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Claude Code
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
claude mcp add skillbrick -- node C:/Users/user/Documents/skillbrickai/packages/mcp-server/dist/index.js
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Or via npx (once published):
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
claude mcp add skillbrick -- npx @skillbrickai/mcp-server
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Environment Variables
|
|
62
|
+
|
|
63
|
+
| Variable | Description | Default |
|
|
64
|
+
|----------|-------------|---------|
|
|
65
|
+
| `SKILLBRICK_API_URL` | Base URL for the SkillBrick API | `https://skillbrickai.com` |
|
|
66
|
+
| `SKILLBRICK_API_TOKEN` | API auth token (required for `install_skill`, `upload_skill`, `sync_skills`, `my_skills`, `check_credits`) | _(none)_ |
|
|
67
|
+
|
|
68
|
+
## How the search works
|
|
69
|
+
|
|
70
|
+
1. **Intent parsing** -- extracts domain and technology tags from natural language
|
|
71
|
+
2. **Domain inference** -- maps casual terms ("backend", "k8s") to actual domain values
|
|
72
|
+
3. **Multi-pass search** -- queries by text, inferred domain, and inferred tags in parallel
|
|
73
|
+
4. **Relevance scoring** -- scores results by name/description/tag match + popularity signals
|
|
74
|
+
5. **Fallback broadening** -- if filtered search returns nothing, retries without filters
|
package/dist/http.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* HTTP transport entry point for the SkillBrick AI MCP server.
|
|
4
|
+
*
|
|
5
|
+
* Exposes the MCP server over Streamable HTTP so it can be accessed
|
|
6
|
+
* by remote clients like Smithery, rather than requiring a local stdio process.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* SKILLBRICK_API_URL=https://api.skillbrickai.com node dist/http.js
|
|
10
|
+
*
|
|
11
|
+
* The server listens on PORT (default 3001) and serves the MCP protocol at /mcp.
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
package/dist/http.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* HTTP transport entry point for the SkillBrick AI MCP server.
|
|
4
|
+
*
|
|
5
|
+
* Exposes the MCP server over Streamable HTTP so it can be accessed
|
|
6
|
+
* by remote clients like Smithery, rather than requiring a local stdio process.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* SKILLBRICK_API_URL=https://api.skillbrickai.com node dist/http.js
|
|
10
|
+
*
|
|
11
|
+
* The server listens on PORT (default 3001) and serves the MCP protocol at /mcp.
|
|
12
|
+
*/
|
|
13
|
+
import express from "express";
|
|
14
|
+
import { randomUUID } from "crypto";
|
|
15
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
16
|
+
import { createSkillBrickServer } from "./server.js";
|
|
17
|
+
const PORT = parseInt(process.env.MCP_PORT || "3001", 10);
|
|
18
|
+
// Map of session ID -> transport (for stateful connections)
|
|
19
|
+
const transports = new Map();
|
|
20
|
+
const app = express();
|
|
21
|
+
app.use(express.json());
|
|
22
|
+
// Health check
|
|
23
|
+
app.get("/health", (_req, res) => {
|
|
24
|
+
res.json({ status: "ok", service: "skillbrickai-mcp" });
|
|
25
|
+
});
|
|
26
|
+
// Handle MCP Streamable HTTP requests
|
|
27
|
+
app.all("/mcp", async (req, res) => {
|
|
28
|
+
const sessionId = req.headers["mcp-session-id"];
|
|
29
|
+
if (req.method === "GET") {
|
|
30
|
+
// SSE stream for server-initiated messages
|
|
31
|
+
if (!sessionId || !transports.has(sessionId)) {
|
|
32
|
+
res.status(400).json({ error: "Missing or invalid session ID. Initialize with a POST first." });
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const transport = transports.get(sessionId);
|
|
36
|
+
await transport.handleRequest(req, res);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (req.method === "POST") {
|
|
40
|
+
// Check if this is an initialization request (no session ID)
|
|
41
|
+
if (!sessionId) {
|
|
42
|
+
// New session — create transport and server
|
|
43
|
+
const transport = new StreamableHTTPServerTransport({
|
|
44
|
+
sessionIdGenerator: () => randomUUID(),
|
|
45
|
+
});
|
|
46
|
+
const server = createSkillBrickServer();
|
|
47
|
+
await server.connect(transport);
|
|
48
|
+
// Store the transport by session ID after the init response sets it
|
|
49
|
+
transport.onclose = () => {
|
|
50
|
+
if (transport.sessionId) {
|
|
51
|
+
transports.delete(transport.sessionId);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
await transport.handleRequest(req, res);
|
|
55
|
+
// After handling, the transport now has a session ID
|
|
56
|
+
if (transport.sessionId) {
|
|
57
|
+
transports.set(transport.sessionId, transport);
|
|
58
|
+
}
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
// Existing session
|
|
62
|
+
const transport = transports.get(sessionId);
|
|
63
|
+
if (!transport) {
|
|
64
|
+
res.status(404).json({ error: "Session not found. It may have expired." });
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
await transport.handleRequest(req, res);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (req.method === "DELETE") {
|
|
71
|
+
// Session termination
|
|
72
|
+
if (sessionId && transports.has(sessionId)) {
|
|
73
|
+
const transport = transports.get(sessionId);
|
|
74
|
+
await transport.close();
|
|
75
|
+
transports.delete(sessionId);
|
|
76
|
+
}
|
|
77
|
+
res.status(200).json({ message: "Session closed" });
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
res.status(405).json({ error: "Method not allowed" });
|
|
81
|
+
});
|
|
82
|
+
app.listen(PORT, "0.0.0.0", () => {
|
|
83
|
+
console.log(`SkillBrick AI MCP server (HTTP) running on http://0.0.0.0:${PORT}`);
|
|
84
|
+
console.log(`MCP endpoint: http://0.0.0.0:${PORT}/mcp`);
|
|
85
|
+
console.log(`Health check: http://0.0.0.0:${PORT}/health`);
|
|
86
|
+
});
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { createSkillBrickServer } from "./server.js";
|
|
4
|
+
async function main() {
|
|
5
|
+
const server = createSkillBrickServer();
|
|
6
|
+
const transport = new StdioServerTransport();
|
|
7
|
+
await server.connect(transport);
|
|
8
|
+
}
|
|
9
|
+
main().catch((err) => {
|
|
10
|
+
console.error("Fatal error starting MCP server:", err);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
});
|
package/dist/server.d.ts
ADDED