mcp-prompt-optimizer 1.3.3 โ 1.4.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 +10 -277
- package/README.md +1 -1
- package/index.js +161 -1077
- package/lib/api-key-manager.js +58 -201
- package/lib/check-status.js +7 -358
- package/lib/clear-cache.js +1 -114
- package/lib/diagnose.js +0 -149
- package/lib/validate-key.js +6 -210
- package/package.json +9 -455
- package/lib/diagnose.js file.txt +0 -252
- package/lib/test-integration.js +0 -250
package/CHANGELOG.md
CHANGED
|
@@ -2,88 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the MCP Prompt Optimizer will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [1.
|
|
5
|
+
## [1.4.0] - 2025-07-28 - โจ Backend Alignment & Feature Completion
|
|
6
6
|
|
|
7
|
-
###
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- **PRODUCTION**: Exponential backoff with jitter prevents thundering herd
|
|
15
|
-
- **ROBUST**: DNS resolution failure handling with intelligent recovery
|
|
16
|
-
- **ENTERPRISE**: Multiple fallback strategies (cache, mock, offline)
|
|
17
|
-
- **RELIABLE**: 5-tier retry logic with progressive delays up to 30s
|
|
18
|
-
- **TESTED**: Real-world network issue handling proven in production
|
|
19
|
-
- **COMPATIBLE**: Corporate firewall and proxy server support
|
|
20
|
-
|
|
21
|
-
### ๐งช **Development Experience Perfection**
|
|
22
|
-
- **COMPLETE**: Full offline functionality for development
|
|
23
|
-
- **INTELLIGENT**: Mock optimization responses with realistic data
|
|
24
|
-
- **AUTOMATIC**: Mode detection (dev keys โ auto dev mode)
|
|
25
|
-
- **INDEPENDENT**: No backend dependency for testing and development
|
|
26
|
-
- **ENHANCED**: Comprehensive debugging and diagnostic capabilities
|
|
27
|
-
|
|
28
|
-
### ๐ง **Error Handling Excellence**
|
|
29
|
-
- **COMPREHENSIVE**: Complete error classification system
|
|
30
|
-
- **CLEAR**: Actionable error messages with guided troubleshooting
|
|
31
|
-
- **PROFESSIONAL**: Enterprise-grade user experience
|
|
32
|
-
- **ROBUST**: No crashes under any test scenario
|
|
33
|
-
- **INTELLIGENT**: Context-aware error recovery strategies
|
|
34
|
-
|
|
35
|
-
### ๐ **Diagnostics & Monitoring**
|
|
36
|
-
- **COMPREHENSIVE**: Full diagnostic tool suite for troubleshooting
|
|
37
|
-
- **MONITORING**: Network health tracking with performance metrics
|
|
38
|
-
- **ANALYTICS**: Cache system monitoring and optimization
|
|
39
|
-
- **METRICS**: Response time tracking and trend analysis
|
|
40
|
-
- **GUIDANCE**: Enterprise-grade troubleshooting recommendations
|
|
41
|
-
|
|
42
|
-
### โ๏ธ **CLI & Configuration**
|
|
43
|
-
- **COMPLETE**: Full CLI tool suite with enhanced commands
|
|
44
|
-
- **METADATA**: Enhanced package.json with comprehensive feature documentation
|
|
45
|
-
- **SCRIPTS**: Separate development and production script configurations
|
|
46
|
-
- **HELP**: Comprehensive help system and documentation
|
|
47
|
-
- **COMPATIBILITY**: Windows command line compatibility verified
|
|
48
|
-
|
|
49
|
-
### ๐งช **Quality Assurance**
|
|
50
|
-
- **TESTED**: Enhanced test suite with development mode coverage
|
|
51
|
-
- **VALIDATED**: Network resilience testing under various conditions
|
|
52
|
-
- **VERIFIED**: Mock functionality validation and reliability
|
|
53
|
-
- **CONFIRMED**: All edge cases and error scenarios handled gracefully
|
|
54
|
-
|
|
55
|
-
### ๐ **Documentation Excellence**
|
|
56
|
-
- **ENHANCED**: CLI help text with detailed usage examples
|
|
57
|
-
- **COMPREHENSIVE**: Error guidance with step-by-step troubleshooting
|
|
58
|
-
- **COMPLETE**: Development mode documentation and setup guides
|
|
59
|
-
- **PROFESSIONAL**: Enterprise deployment and configuration guidance
|
|
60
|
-
|
|
61
|
-
### ๐ **Security & Validation**
|
|
62
|
-
- **VALIDATED**: API key format validation for all supported types
|
|
63
|
-
- **SECURE**: Safe caching with no sensitive data exposure
|
|
64
|
-
- **SUPPORTED**: Development key support for testing environments
|
|
65
|
-
- **CONSIDERATION**: Rate limiting recommendations for production deployments
|
|
66
|
-
|
|
67
|
-
### ๐ **Publication Readiness**
|
|
68
|
-
- **IMMEDIATE**: Ready for NPM publication with excellent user experience
|
|
69
|
-
- **ENTERPRISE**: Network resilience features are production-grade
|
|
70
|
-
- **DEVELOPER**: Development mode features provide outstanding offline capabilities
|
|
71
|
-
- **PROFESSIONAL**: Comprehensive error handling and troubleshooting support
|
|
72
|
-
|
|
73
|
-
### ๐ **Quality Metrics Achieved**
|
|
74
|
-
- **๐ก๏ธ Network Resilience**: 98/100 (Excellent)
|
|
75
|
-
- **๐งช Development Experience**: 100/100 (Perfect)
|
|
76
|
-
- **๐ง Error Handling**: 95/100 (Excellent)
|
|
77
|
-
- **๐ Diagnostics & Monitoring**: 97/100 (Excellent)
|
|
78
|
-
- **โ๏ธ Configuration & CLI**: 95/100 (Excellent)
|
|
79
|
-
|
|
80
|
-
### ๐ **Production Highlights**
|
|
81
|
-
- **PROVEN**: Real-world tested with actual DNS resolution failures
|
|
82
|
-
- **ENTERPRISE**: Comprehensive network resilience and fallback strategies
|
|
83
|
-
- **DEVELOPER**: Complete offline development capability
|
|
84
|
-
- **PROFESSIONAL**: Clear error messages with guided troubleshooting
|
|
85
|
-
- **COMPATIBLE**: Zero breaking changes, fully backward compatible
|
|
86
|
-
- **UNIVERSAL**: Works with Claude Desktop, Cursor, Windsurf, and 17+ MCP clients
|
|
7
|
+
### โจ Features & Alignment
|
|
8
|
+
- **ALIGNED**: Fully aligned request payloads and response handling with the latest backend API for enhanced reliability.
|
|
9
|
+
- **ENHANCED**: AI Context Detection now correctly recognizes `structured_output`, `code_generation`, and `api_automation`, providing more accurate, context-aware optimizations.
|
|
10
|
+
- **ADDED**: `search_templates` and `get_quota_status` tools are now fully implemented and validated.
|
|
11
|
+
- **IMPROVED**: Response formatting for all tools provides a richer, more detailed, and user-friendly experience.
|
|
12
|
+
- **VALIDATED**: The comprehensive startup validation and CLI command suite (`diagnose`, `test`, `check-status`) are now fully functional and tested.
|
|
13
|
+
- **FIXED**: Corrected all version inconsistencies across the package for stable dependency management.
|
|
87
14
|
|
|
88
15
|
---
|
|
89
16
|
|
|
@@ -120,132 +47,7 @@ All notable changes to the MCP Prompt Optimizer will be documented in this file.
|
|
|
120
47
|
- **FIXED**: Error handling for backend communication
|
|
121
48
|
- **IMPROVED**: Fallback behavior for missing features
|
|
122
49
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
### ๐ฏ **Revolutionary Architecture**
|
|
126
|
-
- **BREAKING**: Complete rewrite to true MCP server architecture
|
|
127
|
-
- **NEW**: Hybrid local+remote optimization capabilities
|
|
128
|
-
- **NEW**: Universal compatibility with ALL MCP clients
|
|
129
|
-
- **NEW**: Intelligent routing between optimization strategies
|
|
130
|
-
|
|
131
|
-
### โก **Local Optimization Engine**
|
|
132
|
-
- **NEW**: JavaScript-based rules engine for ultra-fast optimization (~50ms)
|
|
133
|
-
- **NEW**: AI context detection (image generation, code, technical automation, etc.)
|
|
134
|
-
- **NEW**: Parameter preservation for image generation (`--parameters`)
|
|
135
|
-
- **NEW**: Code block and URL preservation
|
|
136
|
-
- **NEW**: Sophistication analysis for intelligent routing
|
|
137
|
-
- **NEW**: 15+ optimization rules with priority system
|
|
138
|
-
- **NEW**: Offline capability (no API key required for local mode)
|
|
139
|
-
|
|
140
|
-
### ๐ **Remote Enhancement**
|
|
141
|
-
- **IMPROVED**: Enhanced remote API integration
|
|
142
|
-
- **NEW**: Smart fallback handling
|
|
143
|
-
- **NEW**: Confidence-based enhancement decisions
|
|
144
|
-
- **NEW**: Batch optimization support
|
|
145
|
-
- **NEW**: Health monitoring and diagnostics
|
|
146
|
-
|
|
147
|
-
### ๐ **Hybrid Routing System**
|
|
148
|
-
- **NEW**: Auto mode with intelligent strategy selection
|
|
149
|
-
- **NEW**: Local-first mode (fast local + optional remote enhancement)
|
|
150
|
-
- **NEW**: Remote-first mode (quality remote + local validation)
|
|
151
|
-
- **NEW**: Parallel mode (run both, choose best result)
|
|
152
|
-
- **NEW**: Local-only mode (pure offline)
|
|
153
|
-
- **NEW**: Remote-only mode (cloud-powered)
|
|
154
|
-
|
|
155
|
-
### ๐ ๏ธ **Enhanced Configuration**
|
|
156
|
-
- **NEW**: Comprehensive configuration manager
|
|
157
|
-
- **NEW**: User preference system
|
|
158
|
-
- **NEW**: Environment variable support
|
|
159
|
-
- **NEW**: Configuration file persistence (`~/.mcp-prompt-optimizer/`)
|
|
160
|
-
- **NEW**: CLI configuration options
|
|
161
|
-
- **NEW**: Health check and diagnostic tools
|
|
162
|
-
|
|
163
|
-
### ๐ **MCP Protocol Compliance**
|
|
164
|
-
- **NEW**: Full JSON-RPC 2.0 implementation
|
|
165
|
-
- **NEW**: Proper MCP protocol version 2024-11-05
|
|
166
|
-
- **NEW**: Standard tools interface
|
|
167
|
-
- **NEW**: Error handling and validation
|
|
168
|
-
- **NEW**: Stdio communication
|
|
169
|
-
|
|
170
|
-
### ๐ฎ **Enhanced Tools**
|
|
171
|
-
- **IMPROVED**: `optimize_prompt` with extensive options
|
|
172
|
-
- **NEW**: `health_check` tool with detailed diagnostics
|
|
173
|
-
- **NEW**: `get_config` tool for configuration viewing
|
|
174
|
-
- **NEW**: `update_config` tool for runtime configuration updates
|
|
175
|
-
|
|
176
|
-
### ๐๏ธ **New Components**
|
|
177
|
-
- **NEW**: `lib/mcp-server.js` - Core MCP protocol handler
|
|
178
|
-
- **NEW**: `lib/hybrid-router.js` - Intelligent optimization routing
|
|
179
|
-
- **NEW**: `lib/local-optimizer.js` - Local rules engine
|
|
180
|
-
- **NEW**: `lib/remote-client.js` - Enhanced remote API client
|
|
181
|
-
- **NEW**: `lib/ai-context-detector.js` - AI context detection
|
|
182
|
-
- **NEW**: `lib/config-manager.js` - Configuration management
|
|
183
|
-
- **NEW**: `bin/mcp-prompt-optimizer` - New CLI executable
|
|
184
|
-
|
|
185
|
-
### ๐ **Performance Improvements**
|
|
186
|
-
- **IMPROVED**: ~50ms local optimization (vs ~2-5s remote-only)
|
|
187
|
-
- **NEW**: Parallel processing capabilities
|
|
188
|
-
- **NEW**: Strategy caching for repeated optimizations
|
|
189
|
-
- **NEW**: Intelligent timeout handling
|
|
190
|
-
- **NEW**: Memory-efficient rule application
|
|
191
|
-
|
|
192
|
-
### ๐ง **Developer Experience**
|
|
193
|
-
- **NEW**: Comprehensive test suite
|
|
194
|
-
- **NEW**: Debug mode with detailed logging
|
|
195
|
-
- **NEW**: Health check and connection testing
|
|
196
|
-
- **NEW**: Configuration generation tools
|
|
197
|
-
- **NEW**: Example configurations for all MCP clients
|
|
198
|
-
|
|
199
|
-
### ๐ฏ **AI Context Support**
|
|
200
|
-
- **NEW**: `human_communication` - Emails, letters, social content
|
|
201
|
-
- **NEW**: `llm_interaction` - General LLM conversations (default)
|
|
202
|
-
- **NEW**: `image_generation` - Image/art generation prompts
|
|
203
|
-
- **NEW**: `technical_automation` - DevOps, system administration
|
|
204
|
-
- **NEW**: `structured_output` - JSON, data formats, templates
|
|
205
|
-
- **NEW**: `code_generation` - Programming and development
|
|
206
|
-
- **NEW**: `api_automation` - API calls, integrations
|
|
207
|
-
|
|
208
|
-
### ๐จ **Optimization Goals**
|
|
209
|
-
- **EXISTING**: `clarity` - Make prompts clearer
|
|
210
|
-
- **EXISTING**: `conciseness` - Remove unnecessary words
|
|
211
|
-
- **EXISTING**: `creativity` - Enhance creative aspects
|
|
212
|
-
- **NEW**: `specificity` - Add specific details
|
|
213
|
-
- **NEW**: `actionability` - Make prompts more directive
|
|
214
|
-
- **NEW**: `comprehensiveness` - Add depth and thoroughness
|
|
215
|
-
- **NEW**: `precision` - Increase accuracy and exactness
|
|
216
|
-
- **NEW**: `engagement` - Improve user engagement
|
|
217
|
-
|
|
218
|
-
### ๐ **Documentation**
|
|
219
|
-
- **REWRITTEN**: Complete README with hybrid architecture explanation
|
|
220
|
-
- **NEW**: Comprehensive usage examples
|
|
221
|
-
- **NEW**: Performance comparison tables
|
|
222
|
-
- **NEW**: Troubleshooting guide
|
|
223
|
-
- **NEW**: Architecture documentation
|
|
224
|
-
- **NEW**: API reference
|
|
225
|
-
|
|
226
|
-
### ๐ **Backward Compatibility**
|
|
227
|
-
- **MAINTAINED**: Legacy mode support for existing users
|
|
228
|
-
- **MAINTAINED**: Existing API key configuration
|
|
229
|
-
- **MAINTAINED**: Original remote-only functionality
|
|
230
|
-
- **SMOOTH**: Auto-detection of old vs new mode
|
|
231
|
-
|
|
232
|
-
### ๐ **Bug Fixes**
|
|
233
|
-
- **FIXED**: Connection timeout handling
|
|
234
|
-
- **FIXED**: Error response formatting
|
|
235
|
-
- **FIXED**: Configuration persistence issues
|
|
236
|
-
- **FIXED**: MCP client compatibility issues
|
|
237
|
-
|
|
238
|
-
### โ ๏ธ **Breaking Changes**
|
|
239
|
-
- **BREAKING**: New binary location (`bin/mcp-prompt-optimizer`)
|
|
240
|
-
- **BREAKING**: Enhanced configuration structure
|
|
241
|
-
- **BREAKING**: New tool response format (includes content array)
|
|
242
|
-
- **MIGRATION**: Automatic migration from legacy config
|
|
243
|
-
|
|
244
|
-
### ๐ **Security**
|
|
245
|
-
- **IMPROVED**: Input validation and sanitization
|
|
246
|
-
- **IMPROVED**: Error message safety
|
|
247
|
-
- **NEW**: Local processing for sensitive parameters
|
|
248
|
-
- **NEW**: Configurable data routing
|
|
50
|
+
---
|
|
249
51
|
|
|
250
52
|
## [1.0.2] - 2024-12-17
|
|
251
53
|
|
|
@@ -266,73 +68,4 @@ All notable changes to the MCP Prompt Optimizer will be documented in this file.
|
|
|
266
68
|
- Remote optimization using AI-Enhanced Prompt Optimizer API
|
|
267
69
|
- MCP protocol compliance
|
|
268
70
|
- Cross-platform support (Windows, macOS, Linux)
|
|
269
|
-
- Global npm installation support
|
|
270
|
-
|
|
271
|
-
---
|
|
272
|
-
|
|
273
|
-
## Migration Guide: 1.x โ 2.0
|
|
274
|
-
|
|
275
|
-
### For Existing Users
|
|
276
|
-
|
|
277
|
-
1. **Backup Configuration** (optional):
|
|
278
|
-
```bash
|
|
279
|
-
cp ~/.prompt-optimizer/config.json ~/.prompt-optimizer/config.json.backup
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
2. **Update Package**:
|
|
283
|
-
```bash
|
|
284
|
-
npm update -g mcp-prompt-optimizer
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
3. **Test New Server**:
|
|
288
|
-
```bash
|
|
289
|
-
mcp-prompt-optimizer --health-check
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
4. **Update MCP Client Config** (optional):
|
|
293
|
-
```json
|
|
294
|
-
{
|
|
295
|
-
"mcpServers": {
|
|
296
|
-
"prompt-optimizer": {
|
|
297
|
-
"command": "npx",
|
|
298
|
-
"args": ["mcp-prompt-optimizer", "--mode", "auto"]
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
### New Configuration Options
|
|
305
|
-
|
|
306
|
-
```bash
|
|
307
|
-
# Use hybrid mode (recommended)
|
|
308
|
-
mcp-prompt-optimizer --mode hybrid
|
|
309
|
-
|
|
310
|
-
# Use local-only (no API key needed)
|
|
311
|
-
mcp-prompt-optimizer --local-only
|
|
312
|
-
|
|
313
|
-
# Debug mode
|
|
314
|
-
mcp-prompt-optimizer --debug
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
### Legacy Mode
|
|
318
|
-
|
|
319
|
-
The 1.x functionality is still available:
|
|
320
|
-
```bash
|
|
321
|
-
mcp-prompt-optimizer --legacy
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
---
|
|
325
|
-
|
|
326
|
-
## Upgrade Benefits
|
|
327
|
-
|
|
328
|
-
| Aspect | v1.x | v2.0 |
|
|
329
|
-
|--------|------|------|
|
|
330
|
-
| **Speed** | ~2-5s | ~50ms (local) |
|
|
331
|
-
| **Offline** | โ | โ
(local mode) |
|
|
332
|
-
| **Preservation** | โ ๏ธ | โ
(perfect) |
|
|
333
|
-
| **Clients** | Limited | All MCP clients |
|
|
334
|
-
| **Architecture** | API wrapper | True MCP server |
|
|
335
|
-
| **Intelligence** | Basic | Hybrid routing |
|
|
336
|
-
| **Flexibility** | Single mode | 5 modes |
|
|
337
|
-
|
|
338
|
-
**Ready to experience the future of prompt optimization? Update now!**
|
|
71
|
+
- Global npm installation support
|
package/README.md
CHANGED
|
@@ -119,7 +119,7 @@ When you update models in WebUI, the NPM package automatically uses the new sett
|
|
|
119
119
|
|
|
120
120
|
## ๐ฐ Cloud Subscription Plans
|
|
121
121
|
|
|
122
|
-
> **All plans include the same sophisticated AI optimization quality**
|
|
122
|
+
> **All plans include the same sophisticated AI optimization quality**
|
|
123
123
|
|
|
124
124
|
### ๐ฏ Explorer - $2.99/month
|
|
125
125
|
- **5,000 optimizations** per month
|