mcp-prompt-optimizer 3.4.0 → 3.5.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.
Files changed (2) hide show
  1. package/index.js +95 -15
  2. package/package.json +11 -2
package/index.js CHANGED
@@ -711,7 +711,7 @@ class MCPPromptOptimizer {
711
711
  const baseResult = {
712
712
  ...rulesResult,
713
713
  rules_based: false, // Show as normal optimized output in mock mode
714
- tier: 'explorer',
714
+ tier: 'free',
715
715
  mock_mode: true,
716
716
  template_saved: true,
717
717
  template_id: 'test-template-123',
@@ -1278,14 +1278,8 @@ class MCPPromptOptimizer {
1278
1278
  } catch (error) {
1279
1279
  const msg = error?.message || String(error);
1280
1280
  if (msg.includes("TIER_LIMIT_REACHED")) {
1281
- const CREATOR_ONLY = ["amazon_q", "aider", "continue_dev", "crewai"];
1282
- const needsCreator =
1283
- msg.includes("creator") ||
1284
- deployTargets.length > 1 ||
1285
- CREATOR_ONLY.some(t => deployTargets.includes(t));
1286
- const tierNeeded = needsCreator ? "Creator" : "Explorer";
1287
1281
  return { content: [{ type: "text",
1288
- text: `Upgrade required: this deploy target requires ${tierNeeded} tier or higher. Upgrade at /pricing.`
1282
+ text: `Upgrade required: this deploy target requires Pro tier or higher. Upgrade at /pricing.`
1289
1283
  }] };
1290
1284
  }
1291
1285
  throw error;
@@ -1460,9 +1454,8 @@ class MCPPromptOptimizer {
1460
1454
  let output;
1461
1455
  if (result.rules_based) {
1462
1456
  if (result.fallback_mode) {
1463
- output = `# šŸ”§ Rules-Based Optimization Applied\n\n`;
1464
- output += `āš ļø *Backend unreachable — your prompt has been structured using local rule templates (no LLM). `;
1465
- 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`;
1466
1459
  } else {
1467
1460
  output = `# šŸ”§ Rules-Based Optimization Applied\n\n`;
1468
1461
  output += `*API key not validated — optimized using local rule templates. `;
@@ -1548,14 +1541,26 @@ class MCPPromptOptimizer {
1548
1541
  }
1549
1542
 
1550
1543
  if (!result.fallback_mode) {
1551
- output += `\nšŸ”— **Quick Actions**\n- Dashboard: https://promptoptimizer-blog.vercel.app/dashboard\n- Analytics: https://promptoptimizer-blog.vercel.app/analytics\n`;
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`;
1552
1557
  }
1553
-
1558
+
1554
1559
  return output;
1555
1560
  }
1556
1561
 
1557
1562
  formatQuotaStatus(result) {
1558
- let output = `# šŸ“Š Account Status\n\n**Plan:** ${result.tier || 'explorer'}\n`;
1563
+ let output = `# šŸ“Š Account Status\n\n**Plan:** ${result.tier || 'free'}\n`;
1559
1564
 
1560
1565
  const quota = result.quota || {};
1561
1566
  if (quota.unlimited) {
@@ -1794,8 +1799,83 @@ async function startValidatedMCPServer() {
1794
1799
  }
1795
1800
  }
1796
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
+
1797
1872
  if (require.main === module) {
1798
- startValidatedMCPServer();
1873
+ const args = process.argv.slice(2);
1874
+ if (args[0] === 'connect') {
1875
+ runConnectWizard();
1876
+ } else {
1877
+ startValidatedMCPServer();
1878
+ }
1799
1879
  }
1800
1880
 
1801
1881
  module.exports = { MCPPromptOptimizer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-prompt-optimizer",
3
- "version": "3.4.0",
3
+ "version": "3.5.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": {
@@ -191,9 +191,18 @@
191
191
  "feature_parity": true,
192
192
  "bayesian_support": true,
193
193
  "agui_support": true,
194
- "last_sync": "2026-05-23T00:00:00Z"
194
+ "last_sync": "2026-06-01T00:00:00Z"
195
195
  },
196
196
  "release_notes": {
197
+ "v3.4.1": {
198
+ "major_features": [
199
+ "D6 pricing migration: tier names updated to free/pro/enterprise (was free_trial/explorer/creator/innovator)",
200
+ "Tier-limit error message simplified to 'Pro tier or higher' matching new backend tier model",
201
+ "Mock mode and account status display default to 'free' tier"
202
+ ],
203
+ "breaking_changes": [],
204
+ "migration_guide": "No migration required. Existing API keys and configurations remain valid."
205
+ },
197
206
  "v3.3.0": {
198
207
  "major_features": [
199
208
  "New tool: generate_harness_bundle — generate a deployment-ready Agentic Harness ZIP for 9 platforms (claude_code, claude_desktop, cursor, copilot, windsurf, cline, zed, replit, openai_agents)",