@kolbo/mcp 1.16.3 → 1.17.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 +44 -2
- package/bin/kolbo-mcp.js +1 -1
- package/package.json +2 -3
- package/src/client.js +9 -116
- package/src/index.js +2 -0
- package/src/polling.js +3 -4
- package/src/tools/_shared.js +11 -0
- package/src/tools/artifacts.js +11 -4
- package/src/tools/chat.js +142 -140
- package/src/tools/generate.js +892 -979
- package/src/tools/projects.js +36 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* ⛔ BACKWARD COMPATIBILITY: Tool names and arg names below are a PUBLIC
|
|
2
|
+
* CONTRACT. Never rename, remove, or break an existing tool/arg — old cached
|
|
3
|
+
* `npx @kolbo/mcp` installs in the wild will break silently. Add new tools or
|
|
4
|
+
* new OPTIONAL args only. Full rules: ../index.js top-of-file and CLAUDE.md. */
|
|
5
|
+
|
|
6
|
+
const { z } = require('zod');
|
|
7
|
+
|
|
8
|
+
function registerProjectTools(server, client) {
|
|
9
|
+
// ─── list_projects ─────────────────────────────────────────
|
|
10
|
+
server.tool(
|
|
11
|
+
'list_projects',
|
|
12
|
+
'List the user\'s projects (owned + shared with edit/full/owner permission). Use this to resolve a project NAME the user mentioned ("put this in my Acme Campaign project") into the project ObjectId you pass back as `project_id` on any generation tool. The tool the user mentions a project by name OR by location, you MUST call this first — the generation tools accept only ObjectIds, not names. Returns id, name, role, and is_default. The project flagged `is_default: true` is the auto-created "API Generations" bucket every SDK generation lands in when project_id is omitted.',
|
|
13
|
+
{},
|
|
14
|
+
async () => {
|
|
15
|
+
const result = await client.get('/v1/projects');
|
|
16
|
+
const projects = (result.projects || []).map(p => ({
|
|
17
|
+
id: p.id,
|
|
18
|
+
name: p.name,
|
|
19
|
+
role: p.role,
|
|
20
|
+
is_default: !!p.is_default
|
|
21
|
+
}));
|
|
22
|
+
return {
|
|
23
|
+
content: [{
|
|
24
|
+
type: 'text',
|
|
25
|
+
text: JSON.stringify({
|
|
26
|
+
projects,
|
|
27
|
+
count: projects.length,
|
|
28
|
+
_hint: 'Pass the chosen `id` as `project_id` on any generate_* tool to drop the generation into that project. Omit project_id to use the project flagged is_default:true.'
|
|
29
|
+
}, null, 2)
|
|
30
|
+
}]
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module.exports = { registerProjectTools };
|