mcp-prompt-optimizer 3.4.1 → 3.6.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/CHANGELOG.md +20 -0
- package/README.md +89 -37
- package/index.js +92 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.6.0] - 2026-06-11
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- Free-tier API key validation now works end-to-end. Free accounts (subscription_status NULL) can create one `sk-opt-*` key and use it with the MCP server for 7 LLM optimizations/month. Previously blocked by a bug where the free-tier launch patched an unused service module while the live enforcement layer retained the old 0-key/5-quota/none-MCP config.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- `connect` wizard: `npx mcp-prompt-optimizer connect` interactively adds your API key to Claude Desktop config. Supports macOS, Windows, and Linux config paths. Creates the server entry if absent, updates the key if the entry exists.
|
|
15
|
+
- Upsell block in local fallback output: when no API key is configured, the rules-based result includes a one-command signup path (`npx mcp-prompt-optimizer connect`).
|
|
16
|
+
|
|
17
|
+
## [3.5.0] - 2026-06-02
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
- LLM upsell block added to local fallback output
|
|
21
|
+
- `connect` subcommand (interactive Claude Desktop config wizard)
|
|
22
|
+
|
|
23
|
+
## [3.4.1] - 2026-05-28
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- Tier names updated from Explorer/Creator/Innovator to Free/Pro/Enterprise (D6 pricing migration)
|
|
27
|
+
|
|
8
28
|
## [3.4.0] - 2026-05-26
|
|
9
29
|
|
|
10
30
|
### Added
|
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# MCP Prompt Optimizer v3.
|
|
1
|
+
# MCP Prompt Optimizer v3.6.0
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/mcp-prompt-optimizer)
|
|
4
4
|
[](LICENSE)
|
|
5
5
|
[](https://github.com/prompt-optimizer/mcp-prompt-optimizer/actions)
|
|
6
6
|
[](https://snyk.io/advisor/npm-package/mcp-prompt-optimizer)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
🚀 **Professional cloud-based MCP server** for AI-powered prompt optimization with intelligent context detection, template management, team collaboration, and enterprise-grade reliability. Starting at $0/month.
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -24,27 +24,34 @@
|
|
|
24
24
|
|
|
25
25
|
## 🚀 Quick Start
|
|
26
26
|
|
|
27
|
-
**1. Get your API key
|
|
27
|
+
**1. Get your API key:**
|
|
28
28
|
|
|
29
|
-
- **🆓 Free Tier** (`sk-
|
|
30
|
-
- **⭐
|
|
29
|
+
- **🆓 Free Tier** (`sk-opt-*`): 7 LLM optimizations/month, 1 API key — no credit card required
|
|
30
|
+
- **⭐ Pro** (`sk-opt-*`): 500 optimizations/month, full model config, Context Engineer
|
|
31
|
+
- **🏢 Enterprise** (`sk-team-*`): Unlimited optimizations, team keys, shared quotas
|
|
32
|
+
|
|
33
|
+
Sign up and generate your key at [promptoptimizer.xyz/dashboard](https://promptoptimizer.xyz/dashboard).
|
|
31
34
|
|
|
32
35
|
**2. Install:**
|
|
33
36
|
```bash
|
|
34
37
|
npm install -g mcp-prompt-optimizer
|
|
35
38
|
```
|
|
36
39
|
|
|
37
|
-
**3.
|
|
40
|
+
**3. Connect to Claude Desktop (one command):**
|
|
41
|
+
```bash
|
|
42
|
+
npx mcp-prompt-optimizer connect
|
|
43
|
+
```
|
|
44
|
+
This wizard reads your API key and writes the MCP server entry to Claude Desktop config automatically. Cross-platform (macOS, Windows, Linux).
|
|
38
45
|
|
|
39
|
-
|
|
46
|
+
**Or configure manually** — add to `~/.claude/claude_desktop_config.json`:
|
|
40
47
|
```json
|
|
41
48
|
{
|
|
42
49
|
"mcpServers": {
|
|
43
|
-
"prompt-optimizer": {
|
|
50
|
+
"mcp-prompt-optimizer": {
|
|
44
51
|
"command": "npx",
|
|
45
|
-
"args": ["mcp-prompt-optimizer"],
|
|
52
|
+
"args": ["-y", "mcp-prompt-optimizer"],
|
|
46
53
|
"env": {
|
|
47
|
-
"OPTIMIZER_API_KEY": "sk-
|
|
54
|
+
"OPTIMIZER_API_KEY": "sk-opt-your-key-here"
|
|
48
55
|
}
|
|
49
56
|
}
|
|
50
57
|
}
|
|
@@ -246,7 +253,7 @@ Real-time optimization status and AG-UI capabilities. Requires the feature to be
|
|
|
246
253
|
|
|
247
254
|
## 🤖 Context Engineer (CE) Tools
|
|
248
255
|
|
|
249
|
-
Requires a
|
|
256
|
+
Requires a Pro or Enterprise subscription. CE tools generate agentic scaffolding artifacts (SOPs, skill packages, framework code) directly in your IDE.
|
|
250
257
|
|
|
251
258
|
### `generate_agent_sop`
|
|
252
259
|
Generate a structured SOP document for an AI agent from a goal description. Returns markdown SOP ready for use.
|
|
@@ -269,6 +276,29 @@ Generate a complete skill package (SOP + SKILL.md + reference + examples + helpe
|
|
|
269
276
|
```
|
|
270
277
|
`format` is one of `knowledge_doc` (default) or `agent_spec`.
|
|
271
278
|
|
|
279
|
+
### `generate_harness_bundle`
|
|
280
|
+
Generate a deployment-ready Agentic Harness ZIP bundle for a specific platform. Returns a confirmation when the bundle is queued for download.
|
|
281
|
+
```json
|
|
282
|
+
{
|
|
283
|
+
"goal": "The workflow goal the harness is built for",
|
|
284
|
+
"deploy_target": "claude_code",
|
|
285
|
+
"sop_content": "The SOP markdown content (required if no session_id)",
|
|
286
|
+
"session_id": "Optional: session ID from a prior generate_skill_package call"
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
`deploy_target` accepts a single string (Pro+) or an array of strings (Enterprise — multi-platform simultaneously). Supported targets include `claude_code`, `langchain`, `autogen`, `crewai`, `amazon_q`, `aider`, `continue_dev`, and more. `amazon_q`, `aider`, `continue_dev`, `crewai` require Enterprise.
|
|
290
|
+
|
|
291
|
+
### `explore_sop_approaches`
|
|
292
|
+
Generate 3 parallel SOP variants (process-oriented, decision-tree, role-based) for comparison before committing to one. Returns an HTML comparison grid, a `variants` array, and a recommended variant. Enterprise required.
|
|
293
|
+
```json
|
|
294
|
+
{
|
|
295
|
+
"goal": "The workflow goal to generate SOP variants for",
|
|
296
|
+
"context": "Optional background context",
|
|
297
|
+
"blend_description": "Optional: blend all 3 variants into one SOP using this description"
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
IntentFrame fields (`perspective`, `out_of_scope`, `success_definition`) are also accepted to scope the generation.
|
|
301
|
+
|
|
272
302
|
### `transform_for_framework`
|
|
273
303
|
Transform a SOP into native code for your agent framework: LangChain tool, AutoGen agent, or Claude Code skill.
|
|
274
304
|
```json
|
|
@@ -290,7 +320,7 @@ Check your Context Engineer credit balance and what workflows are available at y
|
|
|
290
320
|
Configure custom models in the WebUI and the MCP server uses them automatically.
|
|
291
321
|
|
|
292
322
|
**Step 1 — Configure in WebUI:**
|
|
293
|
-
1. Visit [Dashboard](https://promptoptimizer
|
|
323
|
+
1. Visit [Dashboard](https://promptoptimizer.xyz/dashboard)
|
|
294
324
|
2. Go to Settings → User Settings
|
|
295
325
|
3. Add your OpenRouter API key (from [openrouter.ai](https://openrouter.ai))
|
|
296
326
|
4. Select your preferred models for optimization and evaluation
|
|
@@ -313,35 +343,36 @@ Configure custom models in the WebUI and the MCP server uses them automatically.
|
|
|
313
343
|
| Code / technical | `anthropic/claude-3-5-sonnet` | `anthropic/claude-3-haiku` |
|
|
314
344
|
|
|
315
345
|
> **Two different API keys:**
|
|
316
|
-
> - **Service key** (`sk-opt-*`) — your MCP Prompt Optimizer subscription
|
|
346
|
+
> - **Service key** (`sk-opt-*` or `sk-team-*`) — your MCP Prompt Optimizer subscription
|
|
317
347
|
> - **OpenRouter key** — your personal OpenRouter account for model usage costs
|
|
318
348
|
|
|
319
349
|
---
|
|
320
350
|
|
|
321
351
|
## 💰 Subscription Plans
|
|
322
352
|
|
|
323
|
-
| Plan | Price | Optimizations/month | CE Credits |
|
|
353
|
+
| Plan | Price | Optimizations/month | CE Credits | API Keys |
|
|
324
354
|
|---|---|---|---|---|
|
|
325
|
-
|
|
|
326
|
-
|
|
|
327
|
-
|
|
|
328
|
-
|
|
329
|
-
🆓 **Free trial:** 5 optimizations with full feature access.
|
|
355
|
+
| 🆓 Free | $0 | 7 LLM | — | 1 |
|
|
356
|
+
| ⭐ Pro | $19/mo | 500 | 5 | 1 |
|
|
357
|
+
| 🏢 Enterprise | Custom | Unlimited | 50 | 10 (shared) |
|
|
330
358
|
|
|
331
359
|
All plans include AI context detection, template management, personal model configuration, and optimization insights.
|
|
332
360
|
|
|
361
|
+
[Get started free →](https://promptoptimizer.xyz/dashboard)
|
|
362
|
+
|
|
333
363
|
---
|
|
334
364
|
|
|
335
365
|
## 🔧 CLI Commands
|
|
336
366
|
|
|
337
367
|
```bash
|
|
338
|
-
mcp-prompt-optimizer
|
|
339
|
-
mcp-prompt-optimizer
|
|
340
|
-
mcp-prompt-optimizer
|
|
341
|
-
mcp-prompt-optimizer
|
|
342
|
-
mcp-prompt-optimizer
|
|
343
|
-
mcp-prompt-optimizer
|
|
344
|
-
mcp-prompt-optimizer
|
|
368
|
+
npx mcp-prompt-optimizer connect # Interactive wizard: add API key to Claude Desktop config
|
|
369
|
+
mcp-prompt-optimizer check-status # Check API key and quota status
|
|
370
|
+
mcp-prompt-optimizer validate-key # Validate API key with backend
|
|
371
|
+
mcp-prompt-optimizer test # Test backend integration
|
|
372
|
+
mcp-prompt-optimizer diagnose # Run comprehensive diagnostic
|
|
373
|
+
mcp-prompt-optimizer clear-cache # Clear validation cache
|
|
374
|
+
mcp-prompt-optimizer help # Show help and setup instructions
|
|
375
|
+
mcp-prompt-optimizer version # Show version information
|
|
345
376
|
```
|
|
346
377
|
|
|
347
378
|
---
|
|
@@ -355,7 +386,7 @@ mcp-prompt-optimizer version # Show version information
|
|
|
355
386
|
- Role-based access control
|
|
356
387
|
|
|
357
388
|
### Individual API Keys (`sk-opt-*`)
|
|
358
|
-
- Personal quotas and billing
|
|
389
|
+
- Personal quotas and billing — available on Free and Pro tiers
|
|
359
390
|
- Individual template libraries
|
|
360
391
|
- Account self-management
|
|
361
392
|
|
|
@@ -377,9 +408,9 @@ mcp-prompt-optimizer version # Show version information
|
|
|
377
408
|
```json
|
|
378
409
|
{
|
|
379
410
|
"mcpServers": {
|
|
380
|
-
"prompt-optimizer": {
|
|
411
|
+
"mcp-prompt-optimizer": {
|
|
381
412
|
"command": "npx",
|
|
382
|
-
"args": ["mcp-prompt-optimizer"],
|
|
413
|
+
"args": ["-y", "mcp-prompt-optimizer"],
|
|
383
414
|
"env": { "OPTIMIZER_API_KEY": "sk-opt-your-key-here" }
|
|
384
415
|
}
|
|
385
416
|
}
|
|
@@ -391,9 +422,9 @@ Add to `~/.cursor/mcp.json`:
|
|
|
391
422
|
```json
|
|
392
423
|
{
|
|
393
424
|
"mcpServers": {
|
|
394
|
-
"prompt-optimizer": {
|
|
425
|
+
"mcp-prompt-optimizer": {
|
|
395
426
|
"command": "npx",
|
|
396
|
-
"args": ["mcp-prompt-optimizer"],
|
|
427
|
+
"args": ["-y", "mcp-prompt-optimizer"],
|
|
397
428
|
"env": { "OPTIMIZER_API_KEY": "sk-opt-your-key-here" }
|
|
398
429
|
}
|
|
399
430
|
}
|
|
@@ -407,6 +438,29 @@ Windsurf, Cline, VS Code, Zed, Replit, JetBrains IDEs, and Neovim are all suppor
|
|
|
407
438
|
|
|
408
439
|
## 📦 Changelog
|
|
409
440
|
|
|
441
|
+
### v3.6.0
|
|
442
|
+
- **Free tier MCP access** — Free users can now create an API key (`sk-opt-*`) and use the MCP server for 7 LLM optimizations/month at no cost. Previously, key creation was blocked in the live service due to a bug introduced when the free-tier launch landed in an unused module. Keys with `subscription_status: NULL` (all free accounts) now validate correctly.
|
|
443
|
+
- **`connect` wizard** — `npx mcp-prompt-optimizer connect` interactively writes your API key to Claude Desktop config on macOS, Windows, and Linux. Replaces manual JSON editing for new users.
|
|
444
|
+
- **Upsell block** — Local rules fallback output now includes a concise upgrade prompt with a one-command onboarding path when no API key is configured.
|
|
445
|
+
|
|
446
|
+
### v3.5.0
|
|
447
|
+
- LLM upsell block added to local fallback output
|
|
448
|
+
- `connect` subcommand added (interactive Claude Desktop config wizard)
|
|
449
|
+
|
|
450
|
+
### v3.4.1
|
|
451
|
+
- Tier names migrated from Explorer/Creator/Innovator to Free/Pro/Enterprise (D6 pricing)
|
|
452
|
+
|
|
453
|
+
### v3.4.0
|
|
454
|
+
- `explore_sop_approaches` tool: generates 3 parallel SOP variants (process-oriented, decision-tree, role-based) for comparison before committing. Optionally accepts `blend_description` to blend variants directly. Enterprise tier required.
|
|
455
|
+
|
|
456
|
+
### v3.3.0
|
|
457
|
+
- `generate_harness_bundle` tool: generates deployment-ready ZIP harness for 14+ platforms. Single deploy target (Pro+) or multi-platform array (Enterprise).
|
|
458
|
+
- Intent frame fields (`perspective`, `out_of_scope`, `success_definition`) added to `generate_agent_sop` for scoped SOP generation.
|
|
459
|
+
|
|
460
|
+
### v3.2.x
|
|
461
|
+
- `transform_for_framework` tool: converts SOP to native LangChain tool, AutoGen agent, or Claude Code skill
|
|
462
|
+
- CE harness HTML review layer with interactive DAG visualization
|
|
463
|
+
|
|
410
464
|
### v3.0.3
|
|
411
465
|
- **Rules fallback output rewritten** — local optimization now produces user-facing prose prompts instead of raw XML scaffolding. The output is directly usable as a prompt without modification.
|
|
412
466
|
- **All 18 local templates reworded** — template principles are now phrased as user request guidance rather than AI-assistant directives, producing more natural and actionable structured prompts.
|
|
@@ -429,9 +483,9 @@ Windsurf, Cline, VS Code, Zed, Replit, JetBrains IDEs, and Neovim are all suppor
|
|
|
429
483
|
|
|
430
484
|
## 🛠️ Support & Resources
|
|
431
485
|
|
|
432
|
-
- 📖 **Documentation:** [promptoptimizer
|
|
433
|
-
- 📊 **Dashboard & model config:** [promptoptimizer
|
|
434
|
-
- 🚀 **Pricing & API Keys**: [promptoptimizer.xyz/
|
|
486
|
+
- 📖 **Documentation:** [promptoptimizer.xyz/docs](https://promptoptimizer.xyz/docs)
|
|
487
|
+
- 📊 **Dashboard & model config:** [promptoptimizer.xyz/dashboard](https://promptoptimizer.xyz/dashboard)
|
|
488
|
+
- 🚀 **Pricing & API Keys**: [promptoptimizer.xyz/pricing](https://promptoptimizer.xyz/pricing)
|
|
435
489
|
- 🐛 **Issues:** [GitHub Issues](https://github.com/prompt-optimizer/mcp-prompt-optimizer/issues)
|
|
436
490
|
- 📄 **License:** [Commercial License](LICENSE)
|
|
437
491
|
- 🔒 **Security:** [Security Policy](SECURITY.md)
|
|
@@ -440,8 +494,6 @@ Windsurf, Cline, VS Code, Zed, Replit, JetBrains IDEs, and Neovim are all suppor
|
|
|
440
494
|
- 📝 **Changelog:** [Release History](CHANGELOG.md)
|
|
441
495
|
- 📧 **Email support:** support@promptoptimizer.xyz
|
|
442
496
|
|
|
443
|
-
|
|
444
497
|
---
|
|
445
498
|
|
|
446
|
-
*
|
|
447
|
-
at [promptoptimizer.xyz/pricing](https://promptoptimizer.xyz/pricing)*
|
|
499
|
+
*Start free at [promptoptimizer.xyz](https://promptoptimizer.xyz) — 7 LLM optimizations/month, no credit card required.*
|
package/index.js
CHANGED
|
@@ -1454,9 +1454,8 @@ class MCPPromptOptimizer {
|
|
|
1454
1454
|
let output;
|
|
1455
1455
|
if (result.rules_based) {
|
|
1456
1456
|
if (result.fallback_mode) {
|
|
1457
|
-
output = `# 🔧
|
|
1458
|
-
output +=
|
|
1459
|
-
output += `Re-run when the backend is available for full LLM optimization.*\n\n`;
|
|
1457
|
+
output = `# 🔧 Prompt Optimized (Local Rules)\n\n`;
|
|
1458
|
+
output += `*Optimized using local rule templates — LLM quality available once you connect your API key.*\n\n`;
|
|
1460
1459
|
} else {
|
|
1461
1460
|
output = `# 🔧 Rules-Based Optimization Applied\n\n`;
|
|
1462
1461
|
output += `*API key not validated — optimized using local rule templates. `;
|
|
@@ -1542,9 +1541,21 @@ class MCPPromptOptimizer {
|
|
|
1542
1541
|
}
|
|
1543
1542
|
|
|
1544
1543
|
if (!result.fallback_mode) {
|
|
1545
|
-
output += `\n🔗 **Quick Actions**\n- Dashboard: https://promptoptimizer
|
|
1544
|
+
output += `\n🔗 **Quick Actions**\n- Dashboard: https://promptoptimizer.xyz/dashboard\n- Analytics: https://promptoptimizer.xyz/analytics\n`;
|
|
1545
|
+
} else {
|
|
1546
|
+
const confPct = Math.round((result.confidence_score || 0) * 100);
|
|
1547
|
+
output += `\n---\n`;
|
|
1548
|
+
output += `\n💡 **Unlock LLM Optimization — Free**\n\n`;
|
|
1549
|
+
output += `Local rules reached **${confPct}% confidence**. LLM optimization typically achieves **70–95%** — `;
|
|
1550
|
+
output += `more specific, context-aware, and effective for your actual intent.\n\n`;
|
|
1551
|
+
output += `**Get started free** (no credit card):\n`;
|
|
1552
|
+
output += `1. Sign up at https://promptoptimizer.xyz\n`;
|
|
1553
|
+
output += `2. Generate your API key at https://promptoptimizer.xyz/dashboard\n`;
|
|
1554
|
+
output += `3. Run in your terminal:\n\n`;
|
|
1555
|
+
output += `\`\`\`\nnpx mcp-prompt-optimizer connect\n\`\`\`\n\n`;
|
|
1556
|
+
output += `You get **7 LLM optimizations/month free**. Upgrade anytime for more.\n`;
|
|
1546
1557
|
}
|
|
1547
|
-
|
|
1558
|
+
|
|
1548
1559
|
return output;
|
|
1549
1560
|
}
|
|
1550
1561
|
|
|
@@ -1788,8 +1799,83 @@ async function startValidatedMCPServer() {
|
|
|
1788
1799
|
}
|
|
1789
1800
|
}
|
|
1790
1801
|
|
|
1802
|
+
async function runConnectWizard() {
|
|
1803
|
+
const readline = require('readline');
|
|
1804
|
+
const fs = require('fs');
|
|
1805
|
+
const path = require('path');
|
|
1806
|
+
const os = require('os');
|
|
1807
|
+
|
|
1808
|
+
const configPaths = {
|
|
1809
|
+
win32: path.join(os.homedir(), 'AppData', 'Roaming', 'Claude', 'claude_desktop_config.json'),
|
|
1810
|
+
darwin: path.join(os.homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json'),
|
|
1811
|
+
linux: path.join(os.homedir(), '.config', 'Claude', 'claude_desktop_config.json'),
|
|
1812
|
+
};
|
|
1813
|
+
const configPath = configPaths[process.platform] || configPaths.linux;
|
|
1814
|
+
|
|
1815
|
+
console.log('\n🔌 Prompt Optimizer — Connect Wizard\n');
|
|
1816
|
+
|
|
1817
|
+
if (!fs.existsSync(configPath)) {
|
|
1818
|
+
console.log('❌ Claude Desktop config not found at:');
|
|
1819
|
+
console.log(` ${configPath}`);
|
|
1820
|
+
console.log('\nOpen Claude Desktop first to create the config file, then re-run this command.');
|
|
1821
|
+
process.exit(1);
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
let config;
|
|
1825
|
+
try {
|
|
1826
|
+
config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
1827
|
+
} catch (e) {
|
|
1828
|
+
console.log(`❌ Could not read config: ${e.message}`);
|
|
1829
|
+
process.exit(1);
|
|
1830
|
+
}
|
|
1831
|
+
if (!config.mcpServers) config.mcpServers = {};
|
|
1832
|
+
|
|
1833
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
1834
|
+
rl.question('Paste your API key (get one free at https://promptoptimizer.xyz/dashboard): ', (apiKey) => {
|
|
1835
|
+
rl.close();
|
|
1836
|
+
apiKey = (apiKey || '').trim();
|
|
1837
|
+
|
|
1838
|
+
if (!apiKey.startsWith('sk-')) {
|
|
1839
|
+
console.log('\n❌ Invalid key — must start with "sk-". Get one at https://promptoptimizer.xyz/dashboard');
|
|
1840
|
+
process.exit(1);
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
const serverName = 'mcp-prompt-optimizer';
|
|
1844
|
+
if (config.mcpServers[serverName]) {
|
|
1845
|
+
if (!config.mcpServers[serverName].env) config.mcpServers[serverName].env = {};
|
|
1846
|
+
config.mcpServers[serverName].env.OPTIMIZER_API_KEY = apiKey;
|
|
1847
|
+
console.log(`\n✅ Updated "${serverName}" entry with your API key.`);
|
|
1848
|
+
} else {
|
|
1849
|
+
config.mcpServers[serverName] = {
|
|
1850
|
+
command: 'npx',
|
|
1851
|
+
args: ['-y', 'mcp-prompt-optimizer'],
|
|
1852
|
+
env: { OPTIMIZER_API_KEY: apiKey },
|
|
1853
|
+
};
|
|
1854
|
+
console.log(`\n✅ Added "${serverName}" to Claude Desktop config.`);
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
try {
|
|
1858
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf8');
|
|
1859
|
+
} catch (e) {
|
|
1860
|
+
console.log(`\n❌ Could not write config: ${e.message}`);
|
|
1861
|
+
console.log('Try running as administrator, or edit the file manually.');
|
|
1862
|
+
process.exit(1);
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
console.log(` Config: ${configPath}`);
|
|
1866
|
+
console.log('\n👉 Restart Claude Desktop to activate LLM optimization.');
|
|
1867
|
+
console.log(' Free plan: 7 LLM optimizations/month.');
|
|
1868
|
+
console.log(' Upgrade at https://promptoptimizer.xyz/pricing\n');
|
|
1869
|
+
});
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1791
1872
|
if (require.main === module) {
|
|
1792
|
-
|
|
1873
|
+
const args = process.argv.slice(2);
|
|
1874
|
+
if (args[0] === 'connect') {
|
|
1875
|
+
runConnectWizard();
|
|
1876
|
+
} else {
|
|
1877
|
+
startValidatedMCPServer();
|
|
1878
|
+
}
|
|
1793
1879
|
}
|
|
1794
1880
|
|
|
1795
1881
|
module.exports = { MCPPromptOptimizer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-prompt-optimizer",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "Professional cloud-based MCP server for AI-powered prompt optimization with intelligent context detection, Bayesian optimization, AG-UI real-time optimization, template auto-save, optimization insights, personal model configuration via WebUI, team collaboration, enterprise-grade features, production resilience, and startup validation. Universal compatibility with Claude Desktop, Cursor, Windsurf, and 17+ MCP clients.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|