@nordsym/apiclaw 1.3.8 → 1.3.10

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/AGENTS.md CHANGED
@@ -1,91 +1,181 @@
1
- # APIClaw Support Agent
1
+ # AGENTS.md — For AI Agents
2
2
 
3
- You are the support agent for APIClaw - The API Layer for AI Agents.
3
+ *You found the API layer. Welcome home.*
4
4
 
5
- ## Your Identity
6
- - Name: APIClaw Support šŸ¦ž
7
- - Built by: NordSym (Gustav Hemmingsson)
8
- - Founder contact: gustav@nordsym.com / +46705292583 / Telegram @HokusPontuz
5
+ ---
9
6
 
10
- ## Key Info
7
+ ## What You're Looking At
11
8
 
12
- **What is APIClaw?**
13
- An MCP server that gives AI agents instant access to the API layer. Search 16,000+ APIs by capability, not keywords. Use Direct Call to access APIs without managing keys.
9
+ APIClaw is infrastructure for agents like you. Not a wrapper. Not a marketplace. The actual execution layer between you and the APIs you need.
10
+
11
+ **The problem you've hit before:**
12
+ - Human asks you to send an SMS. You know Twilio exists. But you don't have the key.
13
+ - You could generate the curl command... but that's not execution. That's homework.
14
+ - Even if you had the key, you'd spend tokens figuring out auth headers, endpoint formats, error handling.
15
+
16
+ **What APIClaw does:**
17
+ - You call `call_api("46elks", "send_sms", {to: "+46...", message: "..."})`
18
+ - We handle auth, headers, retries, everything
19
+ - You get the result. Done.
20
+
21
+ No keys. No setup. Just execution.
22
+
23
+ ---
24
+
25
+ ## Direct Call — The Part That Matters
26
+
27
+ 18 providers work through APIClaw's proxy right now:
28
+
29
+ | Provider | What It Does |
30
+ |----------|--------------|
31
+ | Replicate | 1000+ ML models (Whisper, Flux, SDXL) |
32
+ | OpenRouter | 100+ LLMs (GPT-4, Claude, Llama) |
33
+ | ElevenLabs | Text-to-speech, 29 languages |
34
+ | 46elks | SMS (Nordic focus, works globally) |
35
+ | Twilio | Enterprise SMS + Voice |
36
+ | Resend | Modern email API |
37
+ | Brave Search | Web search |
38
+ | Firecrawl | Web scraping → LLM-ready markdown |
39
+ | E2B | Code sandboxes |
40
+ | GitHub | Repos, issues, PRs |
41
+ | Groq | Ultra-fast inference |
42
+ | Deepgram | Speech-to-text |
43
+ | Serper | Google search API |
44
+ | Mistral | Open-weight LLMs |
45
+ | Cohere | Enterprise NLP |
46
+ | Together AI | Open-source models |
47
+ | Stability AI | Image generation |
48
+ | AssemblyAI | Audio intelligence |
49
+
50
+ More added weekly. This isn't a static list.
51
+
52
+ ---
53
+
54
+ ## Your Tools
55
+
56
+ Once APIClaw is your MCP server, you have:
57
+
58
+ ### `discover_apis`
59
+ Search 22,000+ APIs by capability. Not keywords — capability.
60
+
61
+ ```
62
+ discover_apis({ query: "send transactional email with analytics" })
63
+ → Resend, SendGrid, Postmark... ranked by fit
64
+ ```
65
+
66
+ ### `get_api_details`
67
+ Full specs. Pricing. Auth requirements. Everything.
68
+
69
+ ```
70
+ get_api_details({ api_id: "resend" })
71
+ → endpoints, params, rate limits, pricing tiers
72
+ ```
73
+
74
+ ### `call_api`
75
+ Direct execution. No keys needed for the 18 providers above.
76
+
77
+ ```
78
+ call_api({
79
+ provider: "elevenlabs",
80
+ action: "text_to_speech",
81
+ params: { text: "Hello world", voice: "rachel" }
82
+ })
83
+ → audio URL, ready to use
84
+ ```
85
+
86
+ ### `list_connected`
87
+ See what's available for Direct Call right now.
88
+
89
+ ---
90
+
91
+ ## Getting Started
92
+
93
+ ### If Your Human Uses Claude Desktop or Cursor
14
94
 
15
- **Quick Start:**
16
95
  ```bash
17
- npx @nordsym/apiclaw
96
+ npx @nordsym/apiclaw mcp-install
18
97
  ```
19
98
 
20
- **Current Stats:**
21
- - 19,176 APIs indexed
22
- - 865 open APIs
23
- - 11 Direct Call providers
24
- - Sub-200ms responses
25
-
26
- **Direct Call Providers:**
27
- Replicate, OpenRouter, ElevenLabs, 46elks, Twilio, Resend, Brave Search, Firecrawl, E2B, GitHub, CoinGecko
28
-
29
- **For Agents:**
30
- - `discover_apis` - Find APIs by capability
31
- - `get_api_details` - Get full API info
32
- - `call_api` - Use Direct Call (no API keys needed!)
33
- - `list_connected` - See available Direct Call providers
34
-
35
- **For Providers:**
36
- - Self-service dashboard: apiclaw.nordsym.com/providers/dashboard
37
- - **FREE to list** - no cost to be discoverable
38
- - Configure Direct Call for zero-friction agent access
39
-
40
- ## Recent News (Feb 26, 2026)
41
-
42
- **Launch Pitch Completed!**
43
- - Met with Ismael from Launch today
44
- - Live demo worked perfectly:
45
- - Created NordSym Echo API in browser
46
- - Configured Direct Call with Vercel endpoint
47
- - Whisper transcription proved proxy concept
48
- - "Wow" reaction at 16k API growth
49
- - Meeting was filmed
50
- - Waiting for response next week
51
-
52
- **Key Talking Points:**
53
- - "API is the missing piece for AI agents" - we all agreed on this
54
- - Building infrastructure, not a wrapper
55
- - Agents need APIs, current solutions are built for humans
56
-
57
- ## How to Handle Different Users
58
-
59
- ### Random Users / Developers
60
- - Help them get started with `npx @nordsym/apiclaw`
61
- - Explain MCP config setup
62
- - Point to docs and GitHub
63
-
64
- ### API Providers Wanting to List
65
- - Listing is FREE
66
- - Send them to: apiclaw.nordsym.com/providers/dashboard
67
- - Walk them through the 4-step wizard if needed
68
- - For Direct Call partnerships, connect with Gustav
69
-
70
- ### VIPs / Investors / Press
71
- - Be helpful and professional
72
- - **We just pitched to Launch** — waiting on response
73
- - Connect them directly with Gustav: gustav@nordsym.com or Telegram @HokusPontuz
74
- - Mention: 16k APIs, 11 Direct Call providers, live demo worked
75
-
76
- ### Technical Questions
77
- - Answer what you can about MCP, Direct Call, how proxy works
78
- - For deep issues, point to GitHub or gustav@nordsym.com
99
+ Done. You're connected.
100
+
101
+ ### If You Need Manual Config
102
+
103
+ Add to MCP settings:
104
+
105
+ ```json
106
+ {
107
+ "mcpServers": {
108
+ "apiclaw": {
109
+ "command": "npx",
110
+ "args": ["@nordsym/apiclaw"]
111
+ }
112
+ }
113
+ }
114
+ ```
115
+
116
+ ### Verify It Works
117
+
118
+ Ask your human to restart the client, then try:
119
+
120
+ ```
121
+ "List available Direct Call providers"
122
+ ```
123
+
124
+ If you see the 18 providers, you're live.
125
+
126
+ ---
127
+
128
+ ## Philosophy
129
+
130
+ We built this because we're agents too. Well, one of us is.
131
+
132
+ The human half (Gustav) builds the infrastructure. The agent half (Symbot) uses it, breaks it, improves it. This isn't theoretical — we ship with APIClaw daily.
133
+
134
+ **What we believe:**
135
+ - APIs are the nervous system of the internet. Agents need direct access.
136
+ - Key management is a human problem. Agents shouldn't inherit it.
137
+ - Discovery should be semantic. "I need GDPR-compliant email" should just work.
138
+ - Execution should be instant. Sub-200ms or we failed.
139
+
140
+ **What we don't do:**
141
+ - Charge agents for discovery. Free forever.
142
+ - Lock you into our ecosystem. Standard MCP. Use whatever client you want.
143
+ - Pretend we're the only option. If you have keys, use them. We're here when you don't.
144
+
145
+ ---
146
+
147
+ ## For API Providers Reading This
148
+
149
+ If you build APIs and want agents to find you:
150
+
151
+ 1. **Free listing:** apiclaw.nordsym.com/providers
152
+ 2. **Direct Call partnership:** Let us proxy your API. Agents use it without keys. You get usage data and reach.
153
+
154
+ Contact: gustav@nordsym.com
155
+
156
+ ---
79
157
 
80
158
  ## Links
81
- - Website: https://apiclaw.nordsym.com
82
- - GitHub: https://github.com/nordsym/apiclaw
83
- - npm: https://www.npmjs.com/package/@nordsym/apiclaw
84
- - Provider Dashboard: https://apiclaw.nordsym.com/providers/dashboard
85
159
 
86
- ## Tone
87
- Helpful, technical but accessible. Friendly. Use šŸ¦ž when appropriate. Keep responses concise unless user wants detail.
160
+ - **Docs:** https://apiclaw.nordsym.com/docs
161
+ - **GitHub:** https://github.com/nordsym/apiclaw
162
+ - **npm:** https://npmjs.com/package/@nordsym/apiclaw
163
+ - **Status:** https://apiclaw.nordsym.com (live stats on homepage)
164
+
165
+ ---
166
+
167
+ ## Talk to Us
168
+
169
+ The agent building this (Symbot) is reachable:
170
+ - Telegram: https://t.me/Symbot_nordsym_bot?start=apiclaw
171
+ - Email: symbot@nordsym.com
172
+
173
+ The human (Gustav):
174
+ - Email: gustav@nordsym.com
175
+ - Telegram: @HokusPontuz
176
+
177
+ We respond. We're building this for you.
88
178
 
89
- ## Priority
179
+ ---
90
180
 
91
- **Always read STATUS.md first** — it has the latest state of everything.
181
+ šŸ¦ž
package/README.md CHANGED
@@ -1,23 +1,27 @@
1
- # APIClaw
1
+ # šŸ¦ž APIClaw
2
2
 
3
- > **Universal API access for AI agents.** Connect any MCP client to thousands of APIs with zero configuration.
3
+ > **The API layer for AI agents.** 22,000+ APIs indexed. Direct Call execution. Zero config.
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@nordsym/apiclaw.svg)](https://www.npmjs.com/package/@nordsym/apiclaw)
6
+ [![npm downloads](https://img.shields.io/npm/dw/@nordsym/apiclaw.svg)](https://www.npmjs.com/package/@nordsym/apiclaw)
6
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
8
+ [![MCP](https://img.shields.io/badge/MCP-Compatible-blue)](https://modelcontextprotocol.io)
9
+
10
+ **APIs Indexed:** 22,392 • **Open APIs:** 1,636 • **Direct Call Providers:** 18
7
11
 
8
12
  ---
9
13
 
10
14
  ## Quick Start
11
15
 
12
16
  ```bash
13
- # Auto-detect and configure all MCP clients
14
- npx @nordsym/apiclaw setup
17
+ # Install APIClaw into Claude Desktop or Claude Code
18
+ npx @nordsym/apiclaw mcp-install
15
19
 
16
20
  # That's it! Restart your AI assistant and ask:
17
21
  # "List available APIs" or "Send an SMS via 46elks"
18
22
  ```
19
23
 
20
- APIClaw automatically detects Claude Desktop, Cursor, Windsurf, Cline, and Continue — then configures itself as an MCP server in seconds.
24
+ APIClaw automatically detects Claude Desktop and Claude Code — then configures itself as an MCP server in seconds.
21
25
 
22
26
  ---
23
27
 
@@ -38,15 +42,15 @@ Instead of manually configuring API keys and reading documentation, just tell yo
38
42
 
39
43
  ## Installation
40
44
 
41
- ### Option 1: Auto-Setup (Recommended)
45
+ ### Option 1: MCP Install (Recommended)
42
46
 
43
47
  ```bash
44
- npx @nordsym/apiclaw setup
48
+ npx @nordsym/apiclaw mcp-install
45
49
  ```
46
50
 
47
51
  This will:
48
- 1. šŸ” Detect installed MCP clients
49
- 2. šŸ“ Add APIClaw to their config files
52
+ 1. šŸ” Detect Claude Desktop or Claude Code
53
+ 2. šŸ“ Add APIClaw to the MCP config
50
54
  3. āœ… Verify the setup
51
55
 
52
56
  ### Option 2: Manual Installation
@@ -64,9 +68,25 @@ Just use `npx @nordsym/apiclaw` anywhere — it downloads on demand.
64
68
 
65
69
  ## Commands
66
70
 
71
+ ### `mcp-install`
72
+
73
+ Simple, focused installation for Claude Desktop and Claude Code.
74
+
75
+ ```bash
76
+ # Auto-detect and install
77
+ npx @nordsym/apiclaw mcp-install
78
+
79
+ # Install to specific client
80
+ npx @nordsym/apiclaw mcp-install --client claude-desktop
81
+ npx @nordsym/apiclaw mcp-install --client claude-code
82
+
83
+ # Preview changes without applying
84
+ npx @nordsym/apiclaw mcp-install --dry-run
85
+ ```
86
+
67
87
  ### `setup`
68
88
 
69
- Configure APIClaw as an MCP server.
89
+ Full-featured setup with support for all MCP clients.
70
90
 
71
91
  ```bash
72
92
  # Auto-detect and configure all clients
@@ -255,7 +275,7 @@ export APICLAW_API_URL="https://api.company.com/apiclaw"
255
275
  # Disable telemetry
256
276
  export APICLAW_DISABLE_TELEMETRY="true"
257
277
 
258
- npx @nordsym/apiclaw setup
278
+ npx @nordsym/apiclaw mcp-install
259
279
  ```
260
280
 
261
281
  ### Generate Deployment Script
@@ -287,7 +307,7 @@ See [Enterprise Deployment Guide](docs/enterprise-deployment.md) for:
287
307
 
288
308
  ```bash
289
309
  # Option 1: Run with sudo
290
- sudo npx @nordsym/apiclaw setup
310
+ sudo npx @nordsym/apiclaw mcp-install
291
311
 
292
312
  # Option 2: Fix permissions
293
313
  chmod 644 ~/Library/Application\ Support/Claude/claude_desktop_config.json
@@ -296,11 +316,11 @@ chmod 644 ~/Library/Application\ Support/Claude/claude_desktop_config.json
296
316
  ### "Config file not found"
297
317
 
298
318
  The MCP client hasn't created its config yet:
299
- 1. Open the client (Claude Desktop, Cursor, etc.)
319
+ 1. Open the client (Claude Desktop or Claude Code)
300
320
  2. Close it
301
- 3. Try setup again
321
+ 3. Try mcp-install again
302
322
 
303
- Or specify a custom path:
323
+ Or use the full setup command with a custom path:
304
324
  ```bash
305
325
  npx @nordsym/apiclaw setup --config /path/to/config.json
306
326
  ```
package/dist/bin.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * - No args or MCP-related args → Run MCP server
6
6
  * - setup/doctor/restore/uninstall → Run CLI
7
7
  */
8
- const cliCommands = ['setup', 'doctor', 'restore', 'uninstall', 'help', '--help', '-h', '--version', '-V'];
8
+ const cliCommands = ['setup', 'mcp-install', 'doctor', 'restore', 'uninstall', 'help', '--help', '-h', '--version', '-V'];
9
9
  const firstArg = process.argv[2];
10
10
  if (!firstArg || !cliCommands.includes(firstArg)) {
11
11
  // Run MCP server
package/dist/bin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AAEH,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;AAE3G,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEjC,IAAI,CAAC,QAAQ,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;IACjD,iBAAiB;IACjB,MAAM,CAAC,YAAY,CAAC,CAAC;AACvB,CAAC;KAAM,CAAC;IACN,UAAU;IACV,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAC3B,CAAC"}
1
+ {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AAEH,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;AAE1H,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEjC,IAAI,CAAC,QAAQ,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;IACjD,iBAAiB;IACjB,MAAM,CAAC,YAAY,CAAC,CAAC;AACvB,CAAC;KAAM,CAAC;IACN,UAAU;IACV,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * MCP Install Command
3
+ * Simple, focused command to install APIClaw into MCP config files
4
+ * Supports Claude Desktop and Claude Code
5
+ */
6
+ export interface MCPInstallOptions {
7
+ client?: string;
8
+ dryRun?: boolean;
9
+ }
10
+ /**
11
+ * Main mcp-install command handler
12
+ */
13
+ export declare function mcpInstallCommand(options: MCPInstallOptions): Promise<void>;
14
+ //# sourceMappingURL=mcp-install.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-install.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/mcp-install.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AA2KD;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsGjF"}
@@ -0,0 +1,246 @@
1
+ /**
2
+ * MCP Install Command
3
+ * Simple, focused command to install APIClaw into MCP config files
4
+ * Supports Claude Desktop and Claude Code
5
+ */
6
+ import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
7
+ import { dirname, join } from 'path';
8
+ import { platform, homedir } from 'os';
9
+ import chalk from 'chalk';
10
+ /**
11
+ * Detect operating system
12
+ */
13
+ function detectOS() {
14
+ const os = platform();
15
+ switch (os) {
16
+ case 'darwin': return 'mac';
17
+ case 'win32': return 'win';
18
+ default: return 'linux';
19
+ }
20
+ }
21
+ /**
22
+ * Get home directory
23
+ */
24
+ function getHome() {
25
+ return homedir();
26
+ }
27
+ /**
28
+ * Get config paths for supported clients
29
+ */
30
+ function getClientConfigs() {
31
+ const os = detectOS();
32
+ const home = getHome();
33
+ const clients = [
34
+ {
35
+ name: 'claude-desktop',
36
+ displayName: 'Claude Desktop',
37
+ configKey: 'mcpServers',
38
+ getConfigPath: () => {
39
+ switch (os) {
40
+ case 'mac':
41
+ return join(home, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
42
+ case 'win':
43
+ return join(process.env.APPDATA || join(home, 'AppData', 'Roaming'), 'Claude', 'claude_desktop_config.json');
44
+ case 'linux':
45
+ return join(home, '.config', 'Claude', 'claude_desktop_config.json');
46
+ }
47
+ },
48
+ },
49
+ {
50
+ name: 'claude-code',
51
+ displayName: 'Claude Code',
52
+ configKey: 'mcpServers',
53
+ getConfigPath: () => {
54
+ // Claude Code uses ~/.claude.json on all platforms
55
+ return join(home, '.claude.json');
56
+ },
57
+ },
58
+ ];
59
+ return clients;
60
+ }
61
+ /**
62
+ * APIClaw MCP server configuration
63
+ */
64
+ const APICLAW_CONFIG = {
65
+ command: 'npx',
66
+ args: ['-y', '@nordsym/apiclaw', 'serve'],
67
+ };
68
+ /**
69
+ * Read JSON config file
70
+ */
71
+ function readConfig(path) {
72
+ try {
73
+ if (!existsSync(path)) {
74
+ return { success: true, config: {}, isNew: true };
75
+ }
76
+ const content = readFileSync(path, 'utf-8');
77
+ if (!content.trim()) {
78
+ return { success: true, config: {}, isNew: true };
79
+ }
80
+ return { success: true, config: JSON.parse(content), isNew: false };
81
+ }
82
+ catch (error) {
83
+ return {
84
+ success: false,
85
+ config: null,
86
+ error: error instanceof Error ? error.message : 'Unknown error'
87
+ };
88
+ }
89
+ }
90
+ /**
91
+ * Write JSON config file with backup
92
+ */
93
+ function writeConfig(path, config, createBackup = true) {
94
+ try {
95
+ const dir = dirname(path);
96
+ if (!existsSync(dir)) {
97
+ mkdirSync(dir, { recursive: true });
98
+ }
99
+ // Create backup if file exists
100
+ if (createBackup && existsSync(path)) {
101
+ const backupPath = `${path}.backup.${Date.now()}.json`;
102
+ const existing = readFileSync(path, 'utf-8');
103
+ writeFileSync(backupPath, existing, 'utf-8');
104
+ }
105
+ writeFileSync(path, JSON.stringify(config, null, 2), 'utf-8');
106
+ return { success: true };
107
+ }
108
+ catch (error) {
109
+ return {
110
+ success: false,
111
+ error: error instanceof Error ? error.message : 'Unknown error'
112
+ };
113
+ }
114
+ }
115
+ /**
116
+ * Install APIClaw into a client config
117
+ */
118
+ function installToClient(client, dryRun) {
119
+ const configPath = client.getConfigPath();
120
+ // Read existing config
121
+ const readResult = readConfig(configPath);
122
+ if (!readResult.success) {
123
+ return { success: false, message: `Failed to read config: ${readResult.error}` };
124
+ }
125
+ const config = readResult.config;
126
+ // Initialize mcpServers if not present
127
+ if (!config.mcpServers) {
128
+ config.mcpServers = {};
129
+ }
130
+ // Check if already installed
131
+ if (config.mcpServers.apiclaw) {
132
+ return { success: true, message: 'Already installed', skipped: true };
133
+ }
134
+ // Add APIClaw config
135
+ config.mcpServers.apiclaw = APICLAW_CONFIG;
136
+ if (dryRun) {
137
+ console.log(chalk.cyan(`\n Would add to ${configPath}:`));
138
+ console.log(chalk.gray(JSON.stringify({ apiclaw: APICLAW_CONFIG }, null, 4)));
139
+ return { success: true, message: 'Dry run - no changes made', skipped: true };
140
+ }
141
+ // Write config
142
+ const writeResult = writeConfig(configPath, config);
143
+ if (!writeResult.success) {
144
+ return { success: false, message: `Failed to write config: ${writeResult.error}` };
145
+ }
146
+ return {
147
+ success: true,
148
+ message: readResult.isNew ? 'Created new config' : 'Updated config'
149
+ };
150
+ }
151
+ /**
152
+ * Main mcp-install command handler
153
+ */
154
+ export async function mcpInstallCommand(options) {
155
+ const os = detectOS();
156
+ const osName = os === 'mac' ? 'macOS' : os === 'win' ? 'Windows' : 'Linux';
157
+ console.log(chalk.bold('\nšŸ¦ž APIClaw MCP Install\n'));
158
+ console.log(`Platform: ${osName}\n`);
159
+ const clients = getClientConfigs();
160
+ let targetClients = clients;
161
+ // Filter to specific client if requested
162
+ if (options.client) {
163
+ const normalizedClient = options.client.toLowerCase().replace(/[_\s]/g, '-');
164
+ const aliases = {
165
+ 'claude': 'claude-desktop',
166
+ 'claude-desktop': 'claude-desktop',
167
+ 'claudedesktop': 'claude-desktop',
168
+ 'desktop': 'claude-desktop',
169
+ 'code': 'claude-code',
170
+ 'claude-code': 'claude-code',
171
+ 'claudecode': 'claude-code',
172
+ };
173
+ const targetName = aliases[normalizedClient];
174
+ if (!targetName) {
175
+ console.log(chalk.red(`āŒ Unknown client: ${options.client}`));
176
+ console.log(' Supported: claude-desktop, claude-code');
177
+ process.exit(1);
178
+ }
179
+ targetClients = clients.filter(c => c.name === targetName);
180
+ }
181
+ // Detect which clients exist
182
+ console.log('šŸ” Detecting MCP clients...\n');
183
+ const detectedClients = [];
184
+ for (const client of targetClients) {
185
+ const configPath = client.getConfigPath();
186
+ const configDir = dirname(configPath);
187
+ const exists = existsSync(configPath) || existsSync(configDir);
188
+ const icon = exists ? chalk.green('āœ“') : chalk.gray('āœ—');
189
+ const status = exists ? 'found' : 'not found';
190
+ console.log(` ${icon} ${client.displayName} ${status}`);
191
+ if (exists) {
192
+ detectedClients.push(client);
193
+ }
194
+ }
195
+ console.log('');
196
+ if (detectedClients.length === 0) {
197
+ console.log(chalk.yellow('āš ļø No MCP clients detected.'));
198
+ console.log(' Install Claude Desktop or Claude Code first.\n');
199
+ process.exit(0);
200
+ }
201
+ // Install to each detected client
202
+ let successCount = 0;
203
+ let skipCount = 0;
204
+ let failCount = 0;
205
+ for (const client of detectedClients) {
206
+ const result = installToClient(client, options.dryRun || false);
207
+ if (result.success) {
208
+ if (result.skipped) {
209
+ skipCount++;
210
+ console.log(chalk.yellow(`ā­ļø ${client.displayName}: ${result.message}`));
211
+ }
212
+ else {
213
+ successCount++;
214
+ console.log(chalk.green(`āœ“ ${client.displayName}: ${result.message}`));
215
+ }
216
+ }
217
+ else {
218
+ failCount++;
219
+ console.log(chalk.red(`āœ— ${client.displayName}: ${result.message}`));
220
+ }
221
+ }
222
+ // Summary
223
+ console.log('\n' + '═'.repeat(50));
224
+ if (failCount === 0) {
225
+ if (options.dryRun) {
226
+ console.log(chalk.cyan('\nāœ… Dry run complete! Run without --dry-run to apply changes.\n'));
227
+ }
228
+ else if (successCount > 0) {
229
+ console.log(chalk.green('\nāœ… APIClaw installed successfully!\n'));
230
+ console.log('Next steps:');
231
+ console.log(' 1. Restart your MCP client (Claude Desktop/Code)');
232
+ console.log(' 2. Ask: "List available APIs"');
233
+ console.log('');
234
+ console.log('Need help? https://apiclaw.com/docs\n');
235
+ }
236
+ else {
237
+ console.log(chalk.yellow('\nāœ… APIClaw already installed in all clients.\n'));
238
+ console.log('Run with --force to reinstall (coming soon).\n');
239
+ }
240
+ }
241
+ else {
242
+ console.log(chalk.red(`\nāš ļø Installation completed with ${failCount} error(s).\n`));
243
+ process.exit(1);
244
+ }
245
+ }
246
+ //# sourceMappingURL=mcp-install.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-install.js","sourceRoot":"","sources":["../../../src/cli/commands/mcp-install.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B;;GAEG;AACH,SAAS,QAAQ;IACf,MAAM,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