mcp-prompt-optimizer 1.3.2 → 1.3.3
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 +85 -0
- package/README.md +286 -130
- package/index.js +1092 -724
- package/lib/api-key-manager.js +538 -46
- package/lib/check-status.js +356 -111
- package/lib/clear-cache.js +113 -79
- package/lib/diagnose.js +252 -0
- package/lib/diagnose.js file.txt +252 -0
- package/lib/test-integration.js +250 -0
- package/lib/validate-key.js +171 -54
- package/package.json +224 -28
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-prompt-optimizer",
|
|
3
|
-
"version": "1.3.
|
|
4
|
-
"description": "Professional cloud-based MCP server for AI-powered prompt optimization with intelligent context detection, team collaboration, enterprise-grade features,
|
|
3
|
+
"version": "1.3.3",
|
|
4
|
+
"description": "Professional cloud-based MCP server for AI-powered prompt optimization with intelligent context detection, 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": {
|
|
7
7
|
"mcp-prompt-optimizer": "index.js"
|
|
@@ -9,10 +9,19 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"start": "node index.js",
|
|
11
11
|
"test": "node test-package.js",
|
|
12
|
+
"test:dev": "OPTIMIZER_DEV_MODE=true node test-package.js",
|
|
13
|
+
"test:offline": "OPTIMIZER_DEV_MODE=true OPTIMIZER_API_KEY=sk-dev-test-key node test-package.js",
|
|
12
14
|
"validate": "node validate-structure.js",
|
|
13
15
|
"check-status": "node lib/check-status.js",
|
|
14
16
|
"validate-key": "node lib/validate-key.js",
|
|
15
|
-
"clear-cache": "node lib/clear-cache.js"
|
|
17
|
+
"clear-cache": "node lib/clear-cache.js",
|
|
18
|
+
"test-integration": "node lib/test-integration.js",
|
|
19
|
+
"test-integration:dev": "OPTIMIZER_DEV_MODE=true node lib/test-integration.js",
|
|
20
|
+
"diagnose": "node lib/diagnose.js",
|
|
21
|
+
"dev": "OPTIMIZER_DEV_MODE=true OPTIMIZER_API_KEY=sk-dev-test-key node index.js",
|
|
22
|
+
"dev:mock": "NODE_ENV=development OPTIMIZER_DEV_MODE=true OPTIMIZER_API_KEY=sk-dev-mock-key node index.js",
|
|
23
|
+
"health-check": "node -e \"console.log('Package health check passed')\"",
|
|
24
|
+
"reset-cache": "node lib/clear-cache.js && echo 'Cache and health data cleared'"
|
|
16
25
|
},
|
|
17
26
|
"dependencies": {
|
|
18
27
|
"@modelcontextprotocol/sdk": "^1.15.1",
|
|
@@ -29,6 +38,9 @@
|
|
|
29
38
|
"ai",
|
|
30
39
|
"claude",
|
|
31
40
|
"anthropic",
|
|
41
|
+
"openrouter",
|
|
42
|
+
"model-configuration",
|
|
43
|
+
"personal-models",
|
|
32
44
|
"cursor",
|
|
33
45
|
"windsurf",
|
|
34
46
|
"cline",
|
|
@@ -48,7 +60,11 @@
|
|
|
48
60
|
"caching",
|
|
49
61
|
"robust-error-handling",
|
|
50
62
|
"cli-commands",
|
|
51
|
-
"professional-tooling"
|
|
63
|
+
"professional-tooling",
|
|
64
|
+
"network-resilience",
|
|
65
|
+
"production-ready",
|
|
66
|
+
"development-mode",
|
|
67
|
+
"fallback-support"
|
|
52
68
|
],
|
|
53
69
|
"author": "Prompt Optimizer Team <support@promptoptimizer.help>",
|
|
54
70
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -75,6 +91,11 @@
|
|
|
75
91
|
"cli_commands": true,
|
|
76
92
|
"caching_support": true,
|
|
77
93
|
"offline_fallback": true,
|
|
94
|
+
"backend_aligned": true,
|
|
95
|
+
"personal_model_configuration": true,
|
|
96
|
+
"production_ready": true,
|
|
97
|
+
"network_resilience": true,
|
|
98
|
+
"development_mode": true,
|
|
78
99
|
"capabilities": {
|
|
79
100
|
"tools": true,
|
|
80
101
|
"resources": false,
|
|
@@ -94,7 +115,13 @@
|
|
|
94
115
|
"api_key_management": true,
|
|
95
116
|
"offline_caching": true,
|
|
96
117
|
"robust_error_handling": true,
|
|
97
|
-
"professional_cli": true
|
|
118
|
+
"professional_cli": true,
|
|
119
|
+
"personal_model_selection": true,
|
|
120
|
+
"openrouter_integration": true,
|
|
121
|
+
"network_resilience": true,
|
|
122
|
+
"fallback_modes": true,
|
|
123
|
+
"development_support": true,
|
|
124
|
+
"mock_optimization": true
|
|
98
125
|
}
|
|
99
126
|
},
|
|
100
127
|
"cli": {
|
|
@@ -106,7 +133,8 @@
|
|
|
106
133
|
"quota_status",
|
|
107
134
|
"api_key_validation",
|
|
108
135
|
"plan_details",
|
|
109
|
-
"troubleshooting"
|
|
136
|
+
"troubleshooting",
|
|
137
|
+
"network_health"
|
|
110
138
|
]
|
|
111
139
|
},
|
|
112
140
|
"validate-key": {
|
|
@@ -115,25 +143,53 @@
|
|
|
115
143
|
"features": [
|
|
116
144
|
"backend_validation",
|
|
117
145
|
"format_checking",
|
|
118
|
-
"quota_testing"
|
|
146
|
+
"quota_testing",
|
|
147
|
+
"development_mode_support"
|
|
119
148
|
]
|
|
120
149
|
},
|
|
121
150
|
"clear-cache": {
|
|
122
|
-
"description": "Clear validation cache for fresh
|
|
151
|
+
"description": "Clear validation cache and network health data for fresh validation",
|
|
123
152
|
"usage": "mcp-prompt-optimizer clear-cache",
|
|
124
153
|
"features": [
|
|
125
154
|
"cache_clearing",
|
|
155
|
+
"health_data_reset",
|
|
126
156
|
"fresh_validation",
|
|
127
157
|
"troubleshooting"
|
|
128
158
|
]
|
|
129
159
|
},
|
|
160
|
+
"test": {
|
|
161
|
+
"description": "Test backend integration and API connectivity with resilience testing",
|
|
162
|
+
"usage": "mcp-prompt-optimizer test",
|
|
163
|
+
"features": [
|
|
164
|
+
"backend_connectivity",
|
|
165
|
+
"api_validation",
|
|
166
|
+
"response_testing",
|
|
167
|
+
"fallback_testing",
|
|
168
|
+
"development_mode_testing"
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
"diagnose": {
|
|
172
|
+
"description": "Run comprehensive diagnostic for troubleshooting with network analysis",
|
|
173
|
+
"usage": "mcp-prompt-optimizer diagnose",
|
|
174
|
+
"features": [
|
|
175
|
+
"system_check",
|
|
176
|
+
"cache_analysis",
|
|
177
|
+
"connectivity_test",
|
|
178
|
+
"configuration_validation",
|
|
179
|
+
"network_health_analysis",
|
|
180
|
+
"development_mode_detection"
|
|
181
|
+
]
|
|
182
|
+
},
|
|
130
183
|
"help": {
|
|
131
184
|
"description": "Show detailed help information and setup instructions",
|
|
132
185
|
"usage": "mcp-prompt-optimizer help",
|
|
133
186
|
"features": [
|
|
134
187
|
"setup_guide",
|
|
135
188
|
"pricing_info",
|
|
136
|
-
"client_configuration"
|
|
189
|
+
"client_configuration",
|
|
190
|
+
"model_configuration_guide",
|
|
191
|
+
"development_mode_guide",
|
|
192
|
+
"troubleshooting_guide"
|
|
137
193
|
]
|
|
138
194
|
},
|
|
139
195
|
"version": {
|
|
@@ -141,7 +197,18 @@
|
|
|
141
197
|
"usage": "mcp-prompt-optimizer version",
|
|
142
198
|
"features": [
|
|
143
199
|
"version_info",
|
|
144
|
-
"service_status"
|
|
200
|
+
"service_status",
|
|
201
|
+
"feature_summary"
|
|
202
|
+
]
|
|
203
|
+
},
|
|
204
|
+
"dev": {
|
|
205
|
+
"description": "Start in development mode with mock backend",
|
|
206
|
+
"usage": "npm run dev",
|
|
207
|
+
"features": [
|
|
208
|
+
"offline_operation",
|
|
209
|
+
"mock_optimization",
|
|
210
|
+
"no_backend_required",
|
|
211
|
+
"development_testing"
|
|
145
212
|
]
|
|
146
213
|
}
|
|
147
214
|
},
|
|
@@ -149,7 +216,12 @@
|
|
|
149
216
|
"mcp-prompt-optimizer check-status",
|
|
150
217
|
"mcp-prompt-optimizer validate-key",
|
|
151
218
|
"mcp-prompt-optimizer clear-cache",
|
|
152
|
-
"
|
|
219
|
+
"mcp-prompt-optimizer test",
|
|
220
|
+
"mcp-prompt-optimizer diagnose",
|
|
221
|
+
"OPTIMIZER_API_KEY=sk-opt-xxx mcp-prompt-optimizer check-status",
|
|
222
|
+
"OPTIMIZER_DEV_MODE=true mcp-prompt-optimizer test",
|
|
223
|
+
"npm run dev",
|
|
224
|
+
"npm run test:offline"
|
|
153
225
|
],
|
|
154
226
|
"troubleshooting": {
|
|
155
227
|
"common_issues": [
|
|
@@ -157,7 +229,12 @@
|
|
|
157
229
|
"Network connectivity testing",
|
|
158
230
|
"Cache management",
|
|
159
231
|
"Quota status checking",
|
|
160
|
-
"Backend validation errors"
|
|
232
|
+
"Backend validation errors",
|
|
233
|
+
"Model configuration guidance",
|
|
234
|
+
"Development mode setup",
|
|
235
|
+
"Fallback mode operation",
|
|
236
|
+
"DNS resolution issues",
|
|
237
|
+
"Firewall/proxy configuration"
|
|
161
238
|
],
|
|
162
239
|
"support_url": "https://promptoptimizer-blog.vercel.app/docs/troubleshooting"
|
|
163
240
|
}
|
|
@@ -168,7 +245,7 @@
|
|
|
168
245
|
"trial": {
|
|
169
246
|
"available": true,
|
|
170
247
|
"optimizations": 5,
|
|
171
|
-
"description": "Free trial with full feature access including CLI tools"
|
|
248
|
+
"description": "Free trial with full feature access including CLI tools and model configuration"
|
|
172
249
|
},
|
|
173
250
|
"plans": {
|
|
174
251
|
"explorer": {
|
|
@@ -181,11 +258,15 @@
|
|
|
181
258
|
"intelligent_optimization",
|
|
182
259
|
"template_management",
|
|
183
260
|
"web_ui_access",
|
|
261
|
+
"personal_model_configuration",
|
|
262
|
+
"openrouter_integration",
|
|
184
263
|
"community_support",
|
|
185
264
|
"cloud_processing",
|
|
186
265
|
"startup_validation",
|
|
187
266
|
"api_key_management",
|
|
188
|
-
"cli_tools"
|
|
267
|
+
"cli_tools",
|
|
268
|
+
"network_resilience",
|
|
269
|
+
"development_mode"
|
|
189
270
|
],
|
|
190
271
|
"description": "Perfect for individual developers and prompt engineers"
|
|
191
272
|
},
|
|
@@ -202,12 +283,16 @@
|
|
|
202
283
|
"optimization_insights",
|
|
203
284
|
"priority_processing",
|
|
204
285
|
"analytics_dashboard",
|
|
286
|
+
"personal_model_configuration",
|
|
287
|
+
"openrouter_integration",
|
|
205
288
|
"email_support",
|
|
206
289
|
"cloud_processing",
|
|
207
290
|
"startup_validation",
|
|
208
291
|
"api_key_management",
|
|
209
292
|
"offline_caching",
|
|
210
|
-
"advanced_cli_tools"
|
|
293
|
+
"advanced_cli_tools",
|
|
294
|
+
"network_resilience",
|
|
295
|
+
"development_mode"
|
|
211
296
|
],
|
|
212
297
|
"description": "For creators and small teams with professional workflows",
|
|
213
298
|
"popular": true
|
|
@@ -228,12 +313,18 @@
|
|
|
228
313
|
"team_management",
|
|
229
314
|
"priority_support",
|
|
230
315
|
"dedicated_support_channel",
|
|
316
|
+
"personal_model_configuration",
|
|
317
|
+
"openrouter_integration",
|
|
318
|
+
"premium_model_access",
|
|
231
319
|
"cloud_processing",
|
|
232
320
|
"startup_validation",
|
|
233
321
|
"api_key_management",
|
|
234
322
|
"offline_caching",
|
|
235
323
|
"enterprise_features",
|
|
236
|
-
"professional_cli_suite"
|
|
324
|
+
"professional_cli_suite",
|
|
325
|
+
"network_resilience",
|
|
326
|
+
"development_mode",
|
|
327
|
+
"fallback_guarantees"
|
|
237
328
|
],
|
|
238
329
|
"description": "For growing teams and agencies with high-volume needs"
|
|
239
330
|
}
|
|
@@ -280,9 +371,53 @@
|
|
|
280
371
|
"usage_tracking": true,
|
|
281
372
|
"startup_validation": true,
|
|
282
373
|
"api_key_management": true,
|
|
283
|
-
"professional_cli": true
|
|
374
|
+
"professional_cli": true,
|
|
375
|
+
"personal_model_selection": true,
|
|
376
|
+
"openrouter_integration": true,
|
|
377
|
+
"network_health_monitoring": true,
|
|
378
|
+
"intelligent_fallback": true,
|
|
379
|
+
"development_mode_support": true
|
|
284
380
|
}
|
|
285
381
|
},
|
|
382
|
+
"model_configuration": {
|
|
383
|
+
"supports_personal_models": true,
|
|
384
|
+
"configuration_method": "webui_dashboard",
|
|
385
|
+
"supported_providers": ["openrouter"],
|
|
386
|
+
"model_types": {
|
|
387
|
+
"optimization_model": {
|
|
388
|
+
"description": "Model used for prompt optimization",
|
|
389
|
+
"examples": [
|
|
390
|
+
"anthropic/claude-3-5-sonnet",
|
|
391
|
+
"openai/gpt-4o-mini",
|
|
392
|
+
"google/gemini-pro-1.5"
|
|
393
|
+
]
|
|
394
|
+
},
|
|
395
|
+
"evaluation_model": {
|
|
396
|
+
"description": "Model used for quality assessment",
|
|
397
|
+
"examples": [
|
|
398
|
+
"google/gemini-pro-1.5",
|
|
399
|
+
"openai/gpt-3.5-turbo",
|
|
400
|
+
"anthropic/claude-3-haiku"
|
|
401
|
+
]
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
"api_key_structure": {
|
|
405
|
+
"service_key": {
|
|
406
|
+
"format": "sk-opt-* or sk-team-*",
|
|
407
|
+
"purpose": "MCP service subscription access"
|
|
408
|
+
},
|
|
409
|
+
"development_key": {
|
|
410
|
+
"format": "sk-dev-* or sk-local-*",
|
|
411
|
+
"purpose": "Development and testing (no backend required)"
|
|
412
|
+
},
|
|
413
|
+
"openrouter_key": {
|
|
414
|
+
"format": "OpenRouter API key",
|
|
415
|
+
"purpose": "Personal model usage (configured in WebUI)",
|
|
416
|
+
"optional": true
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
"configuration_url": "https://promptoptimizer-blog.vercel.app/dashboard"
|
|
420
|
+
},
|
|
286
421
|
"compatibility": {
|
|
287
422
|
"mcp_clients": [
|
|
288
423
|
"Claude Desktop",
|
|
@@ -307,18 +442,25 @@
|
|
|
307
442
|
"macos": true,
|
|
308
443
|
"linux": true,
|
|
309
444
|
"wsl": true
|
|
445
|
+
},
|
|
446
|
+
"network_environments": {
|
|
447
|
+
"corporate_firewalls": true,
|
|
448
|
+
"proxy_servers": true,
|
|
449
|
+
"air_gapped": true,
|
|
450
|
+
"mobile_networks": true
|
|
310
451
|
}
|
|
311
452
|
},
|
|
312
453
|
"api_requirements": {
|
|
313
454
|
"required_keys": [
|
|
314
455
|
{
|
|
315
456
|
"name": "OPTIMIZER_API_KEY",
|
|
316
|
-
"format": "sk-opt
|
|
317
|
-
"description": "Cloud API key from promptoptimizer-blog.vercel.app/pricing",
|
|
457
|
+
"format": "sk-opt-*, sk-team-*, sk-dev-*, or sk-local-*",
|
|
458
|
+
"description": "Cloud API key from promptoptimizer-blog.vercel.app/pricing or development key for testing",
|
|
318
459
|
"required": true,
|
|
319
460
|
"validation": "startup_and_runtime",
|
|
320
|
-
"caching": "
|
|
321
|
-
"offline_fallback": true
|
|
461
|
+
"caching": "24_hours_normal_7_days_fallback",
|
|
462
|
+
"offline_fallback": true,
|
|
463
|
+
"development_support": true
|
|
322
464
|
}
|
|
323
465
|
],
|
|
324
466
|
"optional_keys": [
|
|
@@ -327,25 +469,76 @@
|
|
|
327
469
|
"description": "Custom backend URL (defaults to production)",
|
|
328
470
|
"required": false,
|
|
329
471
|
"default": "https://p01--project-optimizer--fvrdk8m9k9j.code.run"
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"name": "OPTIMIZER_DEV_MODE",
|
|
475
|
+
"description": "Enable development mode (true/false)",
|
|
476
|
+
"required": false,
|
|
477
|
+
"default": "false",
|
|
478
|
+
"development_feature": true
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
"name": "OPTIMIZER_REQUEST_TIMEOUT",
|
|
482
|
+
"description": "Request timeout in milliseconds",
|
|
483
|
+
"required": false,
|
|
484
|
+
"default": "30000"
|
|
330
485
|
}
|
|
331
|
-
]
|
|
486
|
+
],
|
|
487
|
+
"webui_configuration": {
|
|
488
|
+
"openrouter_api_key": {
|
|
489
|
+
"description": "Personal OpenRouter API key configured via WebUI dashboard",
|
|
490
|
+
"required": false,
|
|
491
|
+
"configuration_url": "https://promptoptimizer-blog.vercel.app/dashboard"
|
|
492
|
+
},
|
|
493
|
+
"model_preferences": {
|
|
494
|
+
"description": "Personal model selection configured via WebUI",
|
|
495
|
+
"automatic_inheritance": true
|
|
496
|
+
}
|
|
497
|
+
}
|
|
332
498
|
},
|
|
333
499
|
"architecture": {
|
|
334
500
|
"pattern": "cloud_based_mcp_server",
|
|
335
|
-
"alignment": "
|
|
501
|
+
"alignment": "backend_api_compliant",
|
|
336
502
|
"startup_validation": true,
|
|
337
503
|
"error_handling": "comprehensive",
|
|
338
|
-
"caching_strategy": "
|
|
504
|
+
"caching_strategy": "intelligent_multi_tier",
|
|
339
505
|
"offline_support": "graceful_degradation",
|
|
340
506
|
"cli_integration": "full_featured",
|
|
341
|
-
"backend_communication": "
|
|
507
|
+
"backend_communication": "resilient_with_fallback",
|
|
508
|
+
"model_configuration_flow": "webui_to_mcp_automatic",
|
|
509
|
+
"network_resilience": "production_grade",
|
|
510
|
+
"development_support": "comprehensive"
|
|
511
|
+
},
|
|
512
|
+
"resilience": {
|
|
513
|
+
"network_handling": {
|
|
514
|
+
"retry_strategy": "exponential_backoff_with_jitter",
|
|
515
|
+
"max_retries": 5,
|
|
516
|
+
"timeout_handling": "progressive",
|
|
517
|
+
"dns_failure_recovery": true,
|
|
518
|
+
"connection_pooling": false,
|
|
519
|
+
"circuit_breaker": false
|
|
520
|
+
},
|
|
521
|
+
"caching_strategy": {
|
|
522
|
+
"validation_cache": "24_hours",
|
|
523
|
+
"fallback_cache": "7_days",
|
|
524
|
+
"health_monitoring": "continuous",
|
|
525
|
+
"cache_invalidation": "intelligent"
|
|
526
|
+
},
|
|
527
|
+
"fallback_modes": {
|
|
528
|
+
"mock_responses": true,
|
|
529
|
+
"cached_validation": true,
|
|
530
|
+
"offline_operation": true,
|
|
531
|
+
"reduced_functionality": true
|
|
532
|
+
}
|
|
342
533
|
},
|
|
343
534
|
"quality": {
|
|
344
535
|
"error_handling": "enterprise_grade",
|
|
345
536
|
"user_experience": "professional",
|
|
346
537
|
"troubleshooting": "guided_resolution",
|
|
347
538
|
"documentation": "comprehensive",
|
|
348
|
-
"testing": "automated_validation"
|
|
539
|
+
"testing": "automated_validation",
|
|
540
|
+
"network_resilience": "production_ready",
|
|
541
|
+
"development_support": "full_featured"
|
|
349
542
|
},
|
|
350
543
|
"support": {
|
|
351
544
|
"email": "support@promptoptimizer.help",
|
|
@@ -355,6 +548,9 @@
|
|
|
355
548
|
"status_page": "https://status.promptoptimizer.help",
|
|
356
549
|
"community": "https://github.com/prompt-optimizer/mcp-prompt-optimizer/discussions",
|
|
357
550
|
"troubleshooting": "https://promptoptimizer-blog.vercel.app/docs/troubleshooting",
|
|
358
|
-
"cli_guide": "https://promptoptimizer-blog.vercel.app/docs/cli"
|
|
551
|
+
"cli_guide": "https://promptoptimizer-blog.vercel.app/docs/cli",
|
|
552
|
+
"model_configuration_guide": "https://promptoptimizer-blog.vercel.app/docs/model-configuration",
|
|
553
|
+
"development_guide": "https://promptoptimizer-blog.vercel.app/docs/development",
|
|
554
|
+
"network_troubleshooting": "https://promptoptimizer-blog.vercel.app/docs/network-issues"
|
|
359
555
|
}
|
|
360
|
-
}
|
|
556
|
+
}
|