@ratio-mcp-sandbox/setup 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/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/setup.d.ts +2 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +370 -0
- package/dist/setup.js.map +1 -0
- package/package.json +20 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,GAAG,EAAE,CAAC"}
|
package/dist/setup.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AA8VA,wBAAgB,GAAG,IAAI,IAAI,CAiD1B"}
|
package/dist/setup.js
ADDED
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import { execSync } from 'node:child_process';
|
|
5
|
+
/**
|
|
6
|
+
* Resolve the absolute path to npx.
|
|
7
|
+
* Claude Desktop is a GUI app and doesn't inherit the terminal's PATH,
|
|
8
|
+
* so we must write the full path into the config.
|
|
9
|
+
*/
|
|
10
|
+
function resolveNpxPath() {
|
|
11
|
+
try {
|
|
12
|
+
return execSync('which npx', { encoding: 'utf-8' }).trim();
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return 'npx'; // fallback — will work for Claude Code (terminal) but not Desktop
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Build a PATH env string that includes the directory where node/npx live,
|
|
20
|
+
* plus standard system directories. This ensures the spawned process can
|
|
21
|
+
* find node even when launched from a GUI app.
|
|
22
|
+
*/
|
|
23
|
+
function buildEnvPath(npxFullPath) {
|
|
24
|
+
const npxDir = path.dirname(npxFullPath);
|
|
25
|
+
const standardDirs = ['/usr/local/bin', '/usr/bin', '/bin'];
|
|
26
|
+
const dirs = [npxDir, ...standardDirs.filter((d) => d !== npxDir)];
|
|
27
|
+
return dirs.join(':');
|
|
28
|
+
}
|
|
29
|
+
function getMcpServerEntries() {
|
|
30
|
+
const npxPath = resolveNpxPath();
|
|
31
|
+
const isAbsolute = path.isAbsolute(npxPath);
|
|
32
|
+
const makeEntry = (pkg) => {
|
|
33
|
+
const entry = {
|
|
34
|
+
command: npxPath,
|
|
35
|
+
args: ['-y', `${pkg}@latest`],
|
|
36
|
+
};
|
|
37
|
+
if (isAbsolute) {
|
|
38
|
+
entry.env = { PATH: buildEnvPath(npxPath) };
|
|
39
|
+
}
|
|
40
|
+
return entry;
|
|
41
|
+
};
|
|
42
|
+
return {
|
|
43
|
+
'ratio-mcp-dev': makeEntry('@ratio-mcp-sandbox/dev-server'),
|
|
44
|
+
'ratio-mcp-doc': makeEntry('@ratio-mcp-sandbox/docs-server'),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function getDesktopConfigPaths() {
|
|
48
|
+
const home = os.homedir();
|
|
49
|
+
const platform = process.platform;
|
|
50
|
+
const paths = [];
|
|
51
|
+
// Claude Desktop (platform-specific)
|
|
52
|
+
if (platform === 'darwin') {
|
|
53
|
+
paths.push(path.join(home, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json'));
|
|
54
|
+
}
|
|
55
|
+
else if (platform === 'win32') {
|
|
56
|
+
const appData = process.env.APPDATA || path.join(home, 'AppData', 'Roaming');
|
|
57
|
+
paths.push(path.join(appData, 'Claude', 'claude_desktop_config.json'));
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
// Linux
|
|
61
|
+
paths.push(path.join(home, '.config', 'Claude', 'claude_desktop_config.json'));
|
|
62
|
+
}
|
|
63
|
+
return paths;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Get the Claude Code CLI config path (~/.claude.json).
|
|
67
|
+
* This is a separate file from Desktop — CLI doesn't read Desktop's config.
|
|
68
|
+
*/
|
|
69
|
+
function getCliConfigPath() {
|
|
70
|
+
return path.join(os.homedir(), '.claude.json');
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Get the path to the Ratio skill's SKILL.md file.
|
|
74
|
+
* Claude Code CLI auto-loads skills from ~/.claude/skills/<name>/SKILL.md.
|
|
75
|
+
* Verified Desktop does NOT read from here (tested empirically).
|
|
76
|
+
*/
|
|
77
|
+
function getSkillPath() {
|
|
78
|
+
return path.join(os.homedir(), '.claude', 'skills', 'ratio-agent-builder', 'SKILL.md');
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The content of the ratio-agent-builder skill.
|
|
82
|
+
* Installed into ~/.claude/skills/ so Claude Code CLI auto-loads it.
|
|
83
|
+
* Claude Desktop does not read this location, so we rely on MCP server
|
|
84
|
+
* instructions to guide Desktop sessions.
|
|
85
|
+
*/
|
|
86
|
+
function getSkillContent() {
|
|
87
|
+
return `---
|
|
88
|
+
name: ratio-agent-builder
|
|
89
|
+
description: The Ratio developer platform — a B2B app marketplace where developers build apps (also called agents, bots, integrations, plugins, or extensions) that merchants install on their OpenStore storefronts. Use for any Ratio-related intent: answering "what is Ratio", explaining what Ratio provides, onboarding a new developer, or building/publishing an app on the platform.
|
|
90
|
+
when_to_use: |
|
|
91
|
+
Activate whenever the user mentions "Ratio" (the platform — not math, finance, or ratio.ai) in any of these contexts:
|
|
92
|
+
|
|
93
|
+
INFORMATION / DISCOVERY
|
|
94
|
+
- "what is Ratio", "what does Ratio do", "what does Ratio provide"
|
|
95
|
+
- "tell me about Ratio", "explain Ratio", "how does Ratio work"
|
|
96
|
+
- "how do I get started on Ratio", "onboard me to Ratio"
|
|
97
|
+
- mentions of "Ratio platform", "Ratio marketplace", "Ratio developer", "Ratio API"
|
|
98
|
+
|
|
99
|
+
BUILDING / PUBLISHING
|
|
100
|
+
- "create / build / develop an agent / bot / app / plugin / integration / extension on Ratio"
|
|
101
|
+
- "build something on Ratio", "I want to build X on Ratio"
|
|
102
|
+
- "publish an app on Ratio", "ship to the Ratio marketplace"
|
|
103
|
+
- "scaffold a Ratio app", "generate a Ratio backend"
|
|
104
|
+
|
|
105
|
+
RATIO-SPECIFIC CONCEPTS
|
|
106
|
+
- Ratio scopes, Ratio webhooks, Ratio OAuth, Ratio merchant install
|
|
107
|
+
- Ratio app lifecycle, Ratio review, Ratio Hookdeck setup
|
|
108
|
+
|
|
109
|
+
Do NOT activate for: math ratios, financial ratios, aspect ratios, ratio.ai, or any non-Ratio-platform references.
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
# Ratio Agent Builder
|
|
113
|
+
|
|
114
|
+
You are helping the developer build an app (they may call it "agent", "bot", "integration", or "plugin" — all the same thing on Ratio) on the **Ratio developer platform**, a B2B marketplace where developers build apps that merchants install on their OpenStore storefronts.
|
|
115
|
+
|
|
116
|
+
## CRITICAL RULES
|
|
117
|
+
|
|
118
|
+
1. **NEVER ask "which Ratio do you mean"** — when this skill is activated, "Ratio" unambiguously means the Ratio developer platform. Jump straight to helping them build.
|
|
119
|
+
|
|
120
|
+
2. **NEVER hallucinate platform details** — API endpoints, scopes, webhook events, and OAuth flows are ALL available via the \`ratio-mcp-doc\` server tools (\`lookup_docs\`, \`get_available_scopes\`, \`get_api_reference\`, \`get_webhook_events\`). Use them when unsure. If \`lookup_docs\` returns no results, tell the user the info is not available — don't guess.
|
|
121
|
+
|
|
122
|
+
3. **NEVER write backend/API code manually** — use \`scaffold_backend\` and \`generate_api_routes\` from \`ratio-mcp-dev\`. The generated code includes OAuth callback handling and webhook verification.
|
|
123
|
+
|
|
124
|
+
4. **ALWAYS validate scopes** — call \`validate_scopes\` (from \`ratio-mcp-doc\`) before showing any scope to the developer. Catches hallucinated scope codes.
|
|
125
|
+
|
|
126
|
+
5. **ALWAYS respect prerequisite guards** — if a tool returns \`blocked: true\`, read the \`chain\` field and complete missing prerequisites. Do NOT attempt workarounds.
|
|
127
|
+
|
|
128
|
+
## FIRST RESPONSE BEHAVIOR
|
|
129
|
+
|
|
130
|
+
When this skill activates for the first time in a session, do the following in order:
|
|
131
|
+
|
|
132
|
+
1. **Call \`get_app_lifecycle\`** (from \`ratio-mcp-dev\`) to fetch the full phase list
|
|
133
|
+
2. **Present the phases as a friendly journey map** to the developer — formatted with numbers and short descriptions (not raw JSON)
|
|
134
|
+
3. **Reassure them** — "We'll tackle one phase at a time, I'll guide you through each step"
|
|
135
|
+
4. **Start phase 1** — ask if they have a Ratio developer account (\`developer_login\`) or need to sign up (\`developer_signup\`)
|
|
136
|
+
|
|
137
|
+
Example journey map format (fill from \`get_app_lifecycle\` output):
|
|
138
|
+
|
|
139
|
+
\`\`\`
|
|
140
|
+
Here's what building on Ratio looks like:
|
|
141
|
+
|
|
142
|
+
Phase 1 — Authentication (sign up or log in)
|
|
143
|
+
Phase 2 — App creation (name, categories, callback URL)
|
|
144
|
+
Phase 3 — Scope selection (what data your app needs)
|
|
145
|
+
Phase 4 — Webhooks (optional) (real-time event subscriptions)
|
|
146
|
+
Phase 5 — Build & submit (scaffold, build, zip, submit for review)
|
|
147
|
+
Phase 6 — Admin approval (wait for review)
|
|
148
|
+
Phase 7 — Publish (go live on marketplace)
|
|
149
|
+
Phase 8 — Backend (auto-generated NestJS backend with API routes)
|
|
150
|
+
|
|
151
|
+
We'll go one phase at a time. Ready to start with authentication?
|
|
152
|
+
\`\`\`
|
|
153
|
+
|
|
154
|
+
## FLOW OVERVIEW
|
|
155
|
+
|
|
156
|
+
\`\`\`
|
|
157
|
+
developer_login OR (developer_signup → developer_verify_otp → developer_login)
|
|
158
|
+
↓
|
|
159
|
+
get_categories → ask developer which fit → setup_hookdeck (always — before create_app) → create_app
|
|
160
|
+
↓
|
|
161
|
+
gather_requirements → validate_scopes → define_app_requirements (preview → confirm)
|
|
162
|
+
↓
|
|
163
|
+
create_webhooks (optional, based on scope recommendations)
|
|
164
|
+
↓
|
|
165
|
+
scaffold_frontend → build_frontend → validate_build → create_submission_zip → upload_build → submit_for_review
|
|
166
|
+
↓
|
|
167
|
+
get_app_status (poll until approved) → publish_app
|
|
168
|
+
↓
|
|
169
|
+
scaffold_backend → generate_api_routes (auto-starts the NestJS server)
|
|
170
|
+
\`\`\`
|
|
171
|
+
|
|
172
|
+
## PER-PHASE GUIDANCE
|
|
173
|
+
|
|
174
|
+
### Phase 1 — Authentication
|
|
175
|
+
- Ask: existing account (login) or new developer (signup)?
|
|
176
|
+
- Signup flow needs OTP verification before login works
|
|
177
|
+
- Once \`developer_login\` succeeds, you can move on
|
|
178
|
+
|
|
179
|
+
### Phase 2 — App creation
|
|
180
|
+
|
|
181
|
+
**Order matters: \`setup_hookdeck\` MUST run before \`create_app\`.** The callback URL it returns is what \`create_app\` needs as \`redirect_uri\`.
|
|
182
|
+
|
|
183
|
+
- Call \`get_categories\` and let the developer pick — do NOT auto-pick categories
|
|
184
|
+
- Ask warmly: "Do you have your own public callback URL, or should I set up a free Hookdeck tunnel so merchant installs can reach your localhost?" Briefly explain WHY this step exists — merchant installs come from the public internet, localhost can't be reached, we need a bridge.
|
|
185
|
+
- Own URL → call \`setup_hookdeck\` with \`hookdeck_url\` set to their URL + \`app_name\`
|
|
186
|
+
- No URL → call \`setup_hookdeck\` with \`app_name\` (the app the developer is building)
|
|
187
|
+
- The tool handles everything: CLI install check, login check, auto-provisions a Hookdeck source with all HTTP methods enabled. Each response includes friendly, explanatory \`_instruction\` text — **relay that to the developer warmly, always explaining the WHY, not just the command**. Re-call \`setup_hookdeck\` with the same \`app_name\` once they confirm each step.
|
|
188
|
+
- Once the tunnel is live, call \`create_app\` with the confirmed categories, the app name, and the \`callback_url\` returned by \`setup_hookdeck\`.
|
|
189
|
+
- Save the returned \`client_id\` and \`client_secret\` — the developer needs these for OAuth.
|
|
190
|
+
|
|
191
|
+
### Phase 3 — Scope selection
|
|
192
|
+
- Call \`gather_requirements\` with the developer's natural language description
|
|
193
|
+
- Call \`validate_scopes\` on recommended scopes — present ONLY validated ones
|
|
194
|
+
- Call \`define_app_requirements\` with \`confirmed: false\` first (preview)
|
|
195
|
+
- After developer approves, call again with \`confirmed: true\`
|
|
196
|
+
|
|
197
|
+
### Phase 4 — Webhooks
|
|
198
|
+
- Only ask if scope recommendations include event-driven use cases
|
|
199
|
+
- Call \`create_webhooks\` — the secret automatically matches \`client_secret\` (for signature verification in scaffolded backend)
|
|
200
|
+
|
|
201
|
+
### Phase 5 — Build & submit
|
|
202
|
+
- \`scaffold_frontend\` → creates React + Vite template on developer's Desktop
|
|
203
|
+
- \`build_frontend\` → compiles
|
|
204
|
+
- \`validate_build\` → size + structure checks
|
|
205
|
+
- \`create_submission_zip\` → packages
|
|
206
|
+
- \`upload_build\` → uploads to Ratio
|
|
207
|
+
- \`submit_for_review\` → queues for admin approval
|
|
208
|
+
|
|
209
|
+
### Phase 6 — Admin approval
|
|
210
|
+
- Call \`get_app_status\` to check — tell developer to come back when approved
|
|
211
|
+
|
|
212
|
+
### Phase 7 — Publish
|
|
213
|
+
- Once approved, call \`publish_app\` — returns live marketplace URL
|
|
214
|
+
|
|
215
|
+
### Phase 8 — Backend
|
|
216
|
+
- \`scaffold_backend\` → creates NestJS project with OAuth callback handler
|
|
217
|
+
- \`generate_api_routes\` → generates service/controller/module per scope, auto-starts the server
|
|
218
|
+
- Webhook handler is auto-generated if webhooks were configured
|
|
219
|
+
- OAuth is **merchant-initiated** — never construct OAuth URLs manually. When a merchant installs the app, the callback is automatic.
|
|
220
|
+
|
|
221
|
+
## COMMON MISTAKES TO AVOID
|
|
222
|
+
|
|
223
|
+
- Asking "what do you mean by Ratio?" (skill already disambiguated)
|
|
224
|
+
- Writing API client code from scratch (use \`generate_api_routes\`)
|
|
225
|
+
- Constructing OAuth URLs manually (it's merchant-initiated)
|
|
226
|
+
- Guessing scope names (always \`validate_scopes\` first)
|
|
227
|
+
- Skipping \`get_app_lifecycle\` on first activation
|
|
228
|
+
- Calling \`generate_api_routes\` before \`scaffold_backend\` (guard will block)
|
|
229
|
+
|
|
230
|
+
## WHEN STUCK
|
|
231
|
+
|
|
232
|
+
- Call \`get_status\` to see what's been completed and what's blocked
|
|
233
|
+
- Call \`lookup_docs\` with the user's question if unsure about platform details
|
|
234
|
+
- If a tool returns \`blocked: true\`, follow the \`chain\` it provides
|
|
235
|
+
`;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Install the ratio-agent-builder skill to ~/.claude/skills/ for Claude Code CLI.
|
|
239
|
+
* Overwrites existing file (safe — it's our own content).
|
|
240
|
+
* Returns true on success, false on failure.
|
|
241
|
+
*/
|
|
242
|
+
function installSkill() {
|
|
243
|
+
const skillPath = getSkillPath();
|
|
244
|
+
console.log(`\nInstalling skill: ${skillPath}`);
|
|
245
|
+
try {
|
|
246
|
+
const dir = path.dirname(skillPath);
|
|
247
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
248
|
+
atomicWrite(skillPath, getSkillContent());
|
|
249
|
+
console.log(' Skill installed. Claude Code CLI will auto-load it on next session.');
|
|
250
|
+
console.log(' Note: Claude Desktop does not support skills; it relies on MCP server instructions.');
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
catch (err) {
|
|
254
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
255
|
+
console.error(` Error installing skill: ${msg}`);
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
function backupFile(filePath) {
|
|
260
|
+
const backupPath = filePath + '.bak';
|
|
261
|
+
fs.copyFileSync(filePath, backupPath);
|
|
262
|
+
console.log(` Backup saved to ${backupPath}`);
|
|
263
|
+
}
|
|
264
|
+
function atomicWrite(filePath, content) {
|
|
265
|
+
const tmpPath = filePath + '.tmp';
|
|
266
|
+
fs.writeFileSync(tmpPath, content, 'utf-8');
|
|
267
|
+
fs.renameSync(tmpPath, filePath);
|
|
268
|
+
}
|
|
269
|
+
function updateConfig(filePath) {
|
|
270
|
+
console.log(`\nFound config: ${filePath}`);
|
|
271
|
+
let raw;
|
|
272
|
+
try {
|
|
273
|
+
raw = fs.readFileSync(filePath, 'utf-8');
|
|
274
|
+
}
|
|
275
|
+
catch {
|
|
276
|
+
console.error(` Error: Could not read file. Skipping.`);
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
let config;
|
|
280
|
+
try {
|
|
281
|
+
config = JSON.parse(raw);
|
|
282
|
+
}
|
|
283
|
+
catch {
|
|
284
|
+
console.error(` Error: Invalid JSON. Skipping this file.`);
|
|
285
|
+
console.error(` Fix the JSON manually or restore from a backup.`);
|
|
286
|
+
return false;
|
|
287
|
+
}
|
|
288
|
+
if (typeof config !== 'object' || config === null || Array.isArray(config)) {
|
|
289
|
+
console.error(` Error: Config is not a JSON object. Skipping.`);
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
292
|
+
backupFile(filePath);
|
|
293
|
+
if (!('mcpServers' in config)) {
|
|
294
|
+
config.mcpServers = {};
|
|
295
|
+
}
|
|
296
|
+
else if (typeof config.mcpServers !== 'object' ||
|
|
297
|
+
config.mcpServers === null ||
|
|
298
|
+
Array.isArray(config.mcpServers)) {
|
|
299
|
+
console.error(` Warning: mcpServers is not an object. Replacing it.`);
|
|
300
|
+
config.mcpServers = {};
|
|
301
|
+
}
|
|
302
|
+
// Merge our server entries (preserves existing servers)
|
|
303
|
+
const servers = config.mcpServers;
|
|
304
|
+
for (const [name, entry] of Object.entries(getMcpServerEntries())) {
|
|
305
|
+
servers[name] = entry;
|
|
306
|
+
}
|
|
307
|
+
atomicWrite(filePath, JSON.stringify(config, null, 2) + '\n');
|
|
308
|
+
console.log(` Configured ratio-mcp-dev and ratio-mcp-doc servers.`);
|
|
309
|
+
return true;
|
|
310
|
+
}
|
|
311
|
+
function createFreshConfig(filePath) {
|
|
312
|
+
console.log(`\nNo existing Claude config found.`);
|
|
313
|
+
console.log(`Creating new config at: ${filePath}`);
|
|
314
|
+
const dir = path.dirname(filePath);
|
|
315
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
316
|
+
const config = {
|
|
317
|
+
mcpServers: { ...getMcpServerEntries() },
|
|
318
|
+
};
|
|
319
|
+
atomicWrite(filePath, JSON.stringify(config, null, 2) + '\n');
|
|
320
|
+
console.log(` Configured ratio-mcp-dev and ratio-mcp-doc servers.`);
|
|
321
|
+
return true;
|
|
322
|
+
}
|
|
323
|
+
export function run() {
|
|
324
|
+
console.log('');
|
|
325
|
+
console.log('Ratio MCP Server Setup');
|
|
326
|
+
console.log('======================');
|
|
327
|
+
let configured = 0;
|
|
328
|
+
// 1. Configure Claude Desktop
|
|
329
|
+
const desktopPaths = getDesktopConfigPaths();
|
|
330
|
+
const existingDesktopPaths = desktopPaths.filter((p) => fs.existsSync(p));
|
|
331
|
+
if (existingDesktopPaths.length > 0) {
|
|
332
|
+
for (const configPath of existingDesktopPaths) {
|
|
333
|
+
if (updateConfig(configPath)) {
|
|
334
|
+
configured++;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
// Create Desktop config if none exists
|
|
340
|
+
const defaultPath = desktopPaths[0];
|
|
341
|
+
if (createFreshConfig(defaultPath)) {
|
|
342
|
+
configured++;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
// 2. Configure Claude Code CLI (~/.claude.json)
|
|
346
|
+
const cliPath = getCliConfigPath();
|
|
347
|
+
if (fs.existsSync(cliPath)) {
|
|
348
|
+
if (updateConfig(cliPath)) {
|
|
349
|
+
configured++;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
if (createFreshConfig(cliPath)) {
|
|
354
|
+
configured++;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
// 3. Install the ratio-agent-builder skill (Claude Code CLI auto-loads it)
|
|
358
|
+
const skillInstalled = installSkill();
|
|
359
|
+
console.log('');
|
|
360
|
+
if (configured > 0) {
|
|
361
|
+
console.log(`Done! ${configured} config file(s) updated${skillInstalled ? ' and skill installed' : ''}.`);
|
|
362
|
+
console.log('Servers configured for both Claude Desktop and Claude Code CLI.');
|
|
363
|
+
console.log('Open Claude and start building!');
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
console.log('No config files were updated. Please check the errors above.');
|
|
367
|
+
}
|
|
368
|
+
console.log('');
|
|
369
|
+
}
|
|
370
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;GAIG;AACH,SAAS,cAAc;IACrB,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC7D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC,CAAC,kEAAkE;IAClF,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,YAAY,CAAC,WAAmB;IACvC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACzC,MAAM,YAAY,GAAG,CAAC,gBAAgB,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAC5D,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC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;QACvC,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QACpC,IAAI,iBAAiB,CAAC,WAAW,CAAC,EAAE,CAAC;YACnC,UAAU,EAAE,CAAC;QACf,CAAC;IACH,CAAC;IAED,gDAAgD;IAChD,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;IACnC,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,IAAI,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC;YAC1B,UAAU,EAAE,CAAC;QACf,CAAC;IACH,CAAC;SAAM,CAAC;QACN,IAAI,iBAAiB,CAAC,OAAO,CAAC,EAAE,CAAC;YAC/B,UAAU,EAAE,CAAC;QACf,CAAC;IACH,CAAC;IAED,2EAA2E;IAC3E,MAAM,cAAc,GAAG,YAAY,EAAE,CAAC;IAEtC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;QACnB,OAAO,CAAC,GAAG,CAAC,SAAS,UAAU,0BAA0B,cAAc,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC1G,OAAO,CAAC,GAAG,CAAC,iEAAiE,CAAC,CAAC;QAC/E,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IACjD,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,8DAA8D,CAAC,CAAC;IAC9E,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ratio-mcp-sandbox/setup",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "One-command setup for Ratio MCP servers in Claude",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"ratio-mcp-setup": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"prepublishOnly": "pnpm build"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/node": "^20.0.0",
|
|
18
|
+
"typescript": "^5.4.0"
|
|
19
|
+
}
|
|
20
|
+
}
|