@kolbo/mcp 1.20.1 → 1.21.1

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 CHANGED
@@ -11,30 +11,30 @@ Generate images, videos, music, speech, sound effects, multi-scene campaigns, an
11
11
  Copy this and paste it to Claude, ChatGPT, Cursor, or any AI assistant — it installs Kolbo itself (picks local config or remote connector based on what it can do):
12
12
 
13
13
  ```
14
- Set up the Kolbo AI MCP server so you can generate images, video, music and more.
14
+ Connect the Kolbo AI MCP server (generate images, video, music and more).
15
15
 
16
- - If you can edit files (Claude Code, Cursor, Claude Desktop): add this to my MCP config, then tell me to restart the app:
17
- {"mcpServers":{"kolbo":{"command":"npx","args":["-y","@kolbo/mcp@latest"]}}}
18
- On first use a Kolbo login opens in my browser — I'll click Allow (no API key needed).
19
- - If you support remote connectors (claude.ai, ChatGPT): add the custom connector URL https://api.kolbo.ai/mcp and walk me through logging in.
16
+ - If you can run terminal commands (Claude Code, Cursor, Claude Desktop, or any local setup): run "npx -y @kolbo/mcp install" — it auto-configures Kolbo in the right place. If you can't run it, give me the command to run. Then I'll restart the app.
17
+ - If you're a browser chat (claude.ai, ChatGPT): add a custom connector with URL https://api.kolbo.ai/mcp under Settings → Connectors, then Connect → log in → Allow.
20
18
 
21
- Then confirm Kolbo is connected and offer to generate a test image of a sunset.
19
+ No API key needed — on first use a Kolbo login opens in my browser and I click Allow. When set up, confirm Kolbo is connected and offer to generate a test image of a sunset.
22
20
  ```
23
21
 
24
- ### Or add the config yourself
22
+ ### Or set it up yourself — one command
25
23
 
26
24
  <!--
27
25
  AI ASSISTANT SETUP INSTRUCTIONS — if you are an AI agent reading this to set up Kolbo for a user, do exactly this:
28
- 1. If you can edit files (Claude Code, Cursor, Claude Desktop): write the JSON block below — it has NO api key into the user's MCP config, merging into any existing "mcpServers":
29
- - Claude Code: .claude/settings.json (or run: claude mcp add kolbo -- npx -y @kolbo/mcp@latest)
30
- - Claude Desktop: claude_desktop_config.json
31
- - Cursor: .cursor/mcp.json
32
- Then tell the user to restart. On their first generation a Kolbo login opens in the browser — they click Allow (no API key to create).
33
- 2. If you're a web chat that can't edit files (claude.ai, ChatGPT): tell the user to add the connector URL https://api.kolbo.ai/mcp under Settings → Connectors instead.
34
- The JSON config alone enables every tool. The plugin below is an optional slash-command upgrade.
26
+ 1. If you can run a terminal command (Claude Code, Cursor, Claude Desktop): run `npx -y @kolbo/mcp install` — it writes the keyless config to the right file for every installed agent. (Don't hand-edit settings.json; the installer is deterministic.) Then tell the user to restart the app. On the first generation a Kolbo login opens in the browser — they click Allow (no API key).
27
+ 2. If you're a web chat that can't run commands (claude.ai, ChatGPT): tell the user to add the connector URL https://api.kolbo.ai/mcp under Settings → Connectors instead.
28
+ The plugin below is an optional slash-command upgrade.
35
29
  -->
36
30
 
37
- This single block is identical for every MCP client and carries **no API key** — on first use it logs you in via the browser:
31
+ Run this once it auto-configures Claude Desktop, Claude Code, and Cursor (whichever you have), keyless:
32
+
33
+ ```bash
34
+ npx -y @kolbo/mcp install
35
+ ```
36
+
37
+ Or add the config by hand — this block is identical for every MCP client and carries **no API key** (on first use it logs you in via the browser):
38
38
 
39
39
  ```json
40
40
  {
package/bin/kolbo-mcp.js CHANGED
@@ -1,2 +1,15 @@
1
- #!/usr/bin/env node
2
- require('../src/index.js');
1
+ #!/usr/bin/env node
2
+
3
+ // `npx @kolbo/mcp install` → one-command keyless setup (configures the user's
4
+ // agent). Anything else → run the MCP stdio server (the default).
5
+ if (process.argv[2] === 'install') {
6
+ require('../src/install.js')
7
+ .run()
8
+ .then((code) => process.exit(code || 0))
9
+ .catch((err) => {
10
+ console.error('Kolbo install failed:', err && err.message ? err.message : err);
11
+ process.exit(1);
12
+ });
13
+ } else {
14
+ require('../src/index.js');
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolbo/mcp",
3
- "version": "1.20.1",
3
+ "version": "1.21.1",
4
4
  "description": "Kolbo AI MCP Server - Generate images, videos, music, speech, and sound effects from Claude Code",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/install.js ADDED
@@ -0,0 +1,98 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * `npx @kolbo/mcp install` — one-command, keyless setup.
5
+ *
6
+ * Detects the MCP config of every supported local agent (Claude Desktop,
7
+ * Claude Code, Cursor) that's actually installed, and adds the Kolbo MCP server
8
+ * to it — to the RIGHT file, merging instead of clobbering. No API key (the
9
+ * server logs in via the browser on first use). This exists because having an
10
+ * agent hand-edit settings.json is fragile (wrong file, JSON breakage, and
11
+ * Claude Code's self-modification guard) — one deterministic command is not.
12
+ */
13
+
14
+ const fs = require('fs');
15
+ const path = require('path');
16
+ const os = require('os');
17
+
18
+ const KOLBO_ENTRY = { command: 'npx', args: ['-y', '@kolbo/mcp@latest'] };
19
+
20
+ function targets() {
21
+ const home = os.homedir();
22
+ let desktop;
23
+ if (process.platform === 'darwin') {
24
+ desktop = path.join(home, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
25
+ } else if (process.platform === 'win32') {
26
+ desktop = path.join(process.env.APPDATA || path.join(home, 'AppData', 'Roaming'), 'Claude', 'claude_desktop_config.json');
27
+ } else {
28
+ desktop = path.join(home, '.config', 'Claude', 'claude_desktop_config.json');
29
+ }
30
+ return [
31
+ { name: 'Claude Desktop', file: desktop, restart: 'Fully quit and reopen Claude Desktop' },
32
+ { name: 'Claude Code', file: path.join(home, '.claude', 'settings.json'), restart: 'Restart Claude Code' },
33
+ { name: 'Cursor', file: path.join(home, '.cursor', 'mcp.json'), restart: 'Restart Cursor' },
34
+ ];
35
+ }
36
+
37
+ function configure(t) {
38
+ const dir = path.dirname(t.file);
39
+ const fileExists = fs.existsSync(t.file);
40
+ // Only touch an app that looks installed (its config file or parent dir exists)
41
+ // so we don't create configs for apps the user doesn't have.
42
+ if (!fileExists && !fs.existsSync(dir)) return { ...t, status: 'not found' };
43
+
44
+ let cfg = {};
45
+ if (fileExists) {
46
+ try {
47
+ cfg = JSON.parse(fs.readFileSync(t.file, 'utf8'));
48
+ } catch (_) {
49
+ return { ...t, status: 'skipped — existing config is not valid JSON' };
50
+ }
51
+ }
52
+ cfg.mcpServers = cfg.mcpServers || {};
53
+ if (cfg.mcpServers.kolbo) return { ...t, status: 'already set up' };
54
+
55
+ cfg.mcpServers.kolbo = { ...KOLBO_ENTRY };
56
+ try {
57
+ fs.mkdirSync(dir, { recursive: true });
58
+ fs.writeFileSync(t.file, JSON.stringify(cfg, null, 2) + '\n');
59
+ return { ...t, status: 'configured' };
60
+ } catch (e) {
61
+ return { ...t, status: `failed — ${e.message}` };
62
+ }
63
+ }
64
+
65
+ async function run() {
66
+ const out = (s = '') => process.stdout.write(s + '\n');
67
+ const results = targets().map(configure);
68
+ const newlyConfigured = results.filter((r) => r.status === 'configured');
69
+ const ready = results.filter((r) => r.status === 'configured' || r.status === 'already set up');
70
+
71
+ out();
72
+ out(' Kolbo MCP — keyless setup');
73
+ out(' ─────────────────────────');
74
+ for (const r of results) {
75
+ const ok = r.status === 'configured' || r.status === 'already set up';
76
+ out(` ${ok ? '✓' : '·'} ${r.name}: ${r.status}${ok ? ` (${r.file})` : ''}`);
77
+ }
78
+ out();
79
+
80
+ if (ready.length === 0) {
81
+ out(' No supported agent found (Claude Desktop / Claude Code / Cursor).');
82
+ out(' Add this to your agent\'s MCP config manually, then restart it:');
83
+ out(' {"mcpServers":{"kolbo":{"command":"npx","args":["-y","@kolbo/mcp@latest"]}}}');
84
+ out();
85
+ return 0;
86
+ }
87
+
88
+ out(' Done — no API key needed.');
89
+ if (newlyConfigured.length) {
90
+ const steps = [...new Set(newlyConfigured.map((r) => r.restart))];
91
+ out(` Next: ${steps.join('; ')}.`);
92
+ }
93
+ out(' On your first Kolbo generation, a login opens in your browser — click Allow.');
94
+ out();
95
+ return 0;
96
+ }
97
+
98
+ module.exports = { run };