mcp-prompt-optimizer 1.3.2 → 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 +14 -196
- package/README.md +286 -130
- package/index.js +247 -795
- package/lib/api-key-manager.js +423 -74
- package/lib/check-status.js +23 -129
- package/lib/clear-cache.js +11 -90
- package/lib/diagnose.js +103 -0
- package/lib/validate-key.js +6 -93
- package/package.json +29 -279
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the MCP Prompt Optimizer will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.4.0] - 2025-07-28 - ✨ Backend Alignment & Feature Completion
|
|
6
|
+
|
|
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.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
5
17
|
## [1.1.0] - 2025-07-05
|
|
6
18
|
|
|
7
19
|
### 🎯 Smart Tier-Aware Features
|
|
@@ -35,132 +47,7 @@ All notable changes to the MCP Prompt Optimizer will be documented in this file.
|
|
|
35
47
|
- **FIXED**: Error handling for backend communication
|
|
36
48
|
- **IMPROVED**: Fallback behavior for missing features
|
|
37
49
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
### 🎯 **Revolutionary Architecture**
|
|
41
|
-
- **BREAKING**: Complete rewrite to true MCP server architecture
|
|
42
|
-
- **NEW**: Hybrid local+remote optimization capabilities
|
|
43
|
-
- **NEW**: Universal compatibility with ALL MCP clients
|
|
44
|
-
- **NEW**: Intelligent routing between optimization strategies
|
|
45
|
-
|
|
46
|
-
### ⚡ **Local Optimization Engine**
|
|
47
|
-
- **NEW**: JavaScript-based rules engine for ultra-fast optimization (~50ms)
|
|
48
|
-
- **NEW**: AI context detection (image generation, code, technical automation, etc.)
|
|
49
|
-
- **NEW**: Parameter preservation for image generation (`--parameters`)
|
|
50
|
-
- **NEW**: Code block and URL preservation
|
|
51
|
-
- **NEW**: Sophistication analysis for intelligent routing
|
|
52
|
-
- **NEW**: 15+ optimization rules with priority system
|
|
53
|
-
- **NEW**: Offline capability (no API key required for local mode)
|
|
54
|
-
|
|
55
|
-
### 🌐 **Remote Enhancement**
|
|
56
|
-
- **IMPROVED**: Enhanced remote API integration
|
|
57
|
-
- **NEW**: Smart fallback handling
|
|
58
|
-
- **NEW**: Confidence-based enhancement decisions
|
|
59
|
-
- **NEW**: Batch optimization support
|
|
60
|
-
- **NEW**: Health monitoring and diagnostics
|
|
61
|
-
|
|
62
|
-
### 🔄 **Hybrid Routing System**
|
|
63
|
-
- **NEW**: Auto mode with intelligent strategy selection
|
|
64
|
-
- **NEW**: Local-first mode (fast local + optional remote enhancement)
|
|
65
|
-
- **NEW**: Remote-first mode (quality remote + local validation)
|
|
66
|
-
- **NEW**: Parallel mode (run both, choose best result)
|
|
67
|
-
- **NEW**: Local-only mode (pure offline)
|
|
68
|
-
- **NEW**: Remote-only mode (cloud-powered)
|
|
69
|
-
|
|
70
|
-
### 🛠️ **Enhanced Configuration**
|
|
71
|
-
- **NEW**: Comprehensive configuration manager
|
|
72
|
-
- **NEW**: User preference system
|
|
73
|
-
- **NEW**: Environment variable support
|
|
74
|
-
- **NEW**: Configuration file persistence (`~/.mcp-prompt-optimizer/`)
|
|
75
|
-
- **NEW**: CLI configuration options
|
|
76
|
-
- **NEW**: Health check and diagnostic tools
|
|
77
|
-
|
|
78
|
-
### 📋 **MCP Protocol Compliance**
|
|
79
|
-
- **NEW**: Full JSON-RPC 2.0 implementation
|
|
80
|
-
- **NEW**: Proper MCP protocol version 2024-11-05
|
|
81
|
-
- **NEW**: Standard tools interface
|
|
82
|
-
- **NEW**: Error handling and validation
|
|
83
|
-
- **NEW**: Stdio communication
|
|
84
|
-
|
|
85
|
-
### 🎮 **Enhanced Tools**
|
|
86
|
-
- **IMPROVED**: `optimize_prompt` with extensive options
|
|
87
|
-
- **NEW**: `health_check` tool with detailed diagnostics
|
|
88
|
-
- **NEW**: `get_config` tool for configuration viewing
|
|
89
|
-
- **NEW**: `update_config` tool for runtime configuration updates
|
|
90
|
-
|
|
91
|
-
### 🏗️ **New Components**
|
|
92
|
-
- **NEW**: `lib/mcp-server.js` - Core MCP protocol handler
|
|
93
|
-
- **NEW**: `lib/hybrid-router.js` - Intelligent optimization routing
|
|
94
|
-
- **NEW**: `lib/local-optimizer.js` - Local rules engine
|
|
95
|
-
- **NEW**: `lib/remote-client.js` - Enhanced remote API client
|
|
96
|
-
- **NEW**: `lib/ai-context-detector.js` - AI context detection
|
|
97
|
-
- **NEW**: `lib/config-manager.js` - Configuration management
|
|
98
|
-
- **NEW**: `bin/mcp-prompt-optimizer` - New CLI executable
|
|
99
|
-
|
|
100
|
-
### 📊 **Performance Improvements**
|
|
101
|
-
- **IMPROVED**: ~50ms local optimization (vs ~2-5s remote-only)
|
|
102
|
-
- **NEW**: Parallel processing capabilities
|
|
103
|
-
- **NEW**: Strategy caching for repeated optimizations
|
|
104
|
-
- **NEW**: Intelligent timeout handling
|
|
105
|
-
- **NEW**: Memory-efficient rule application
|
|
106
|
-
|
|
107
|
-
### 🔧 **Developer Experience**
|
|
108
|
-
- **NEW**: Comprehensive test suite
|
|
109
|
-
- **NEW**: Debug mode with detailed logging
|
|
110
|
-
- **NEW**: Health check and connection testing
|
|
111
|
-
- **NEW**: Configuration generation tools
|
|
112
|
-
- **NEW**: Example configurations for all MCP clients
|
|
113
|
-
|
|
114
|
-
### 🎯 **AI Context Support**
|
|
115
|
-
- **NEW**: `human_communication` - Emails, letters, social content
|
|
116
|
-
- **NEW**: `llm_interaction` - General LLM conversations (default)
|
|
117
|
-
- **NEW**: `image_generation` - Image/art generation prompts
|
|
118
|
-
- **NEW**: `technical_automation` - DevOps, system administration
|
|
119
|
-
- **NEW**: `structured_output` - JSON, data formats, templates
|
|
120
|
-
- **NEW**: `code_generation` - Programming and development
|
|
121
|
-
- **NEW**: `api_automation` - API calls, integrations
|
|
122
|
-
|
|
123
|
-
### 🎨 **Optimization Goals**
|
|
124
|
-
- **EXISTING**: `clarity` - Make prompts clearer
|
|
125
|
-
- **EXISTING**: `conciseness` - Remove unnecessary words
|
|
126
|
-
- **EXISTING**: `creativity` - Enhance creative aspects
|
|
127
|
-
- **NEW**: `specificity` - Add specific details
|
|
128
|
-
- **NEW**: `actionability` - Make prompts more directive
|
|
129
|
-
- **NEW**: `comprehensiveness` - Add depth and thoroughness
|
|
130
|
-
- **NEW**: `precision` - Increase accuracy and exactness
|
|
131
|
-
- **NEW**: `engagement` - Improve user engagement
|
|
132
|
-
|
|
133
|
-
### 📚 **Documentation**
|
|
134
|
-
- **REWRITTEN**: Complete README with hybrid architecture explanation
|
|
135
|
-
- **NEW**: Comprehensive usage examples
|
|
136
|
-
- **NEW**: Performance comparison tables
|
|
137
|
-
- **NEW**: Troubleshooting guide
|
|
138
|
-
- **NEW**: Architecture documentation
|
|
139
|
-
- **NEW**: API reference
|
|
140
|
-
|
|
141
|
-
### 🔄 **Backward Compatibility**
|
|
142
|
-
- **MAINTAINED**: Legacy mode support for existing users
|
|
143
|
-
- **MAINTAINED**: Existing API key configuration
|
|
144
|
-
- **MAINTAINED**: Original remote-only functionality
|
|
145
|
-
- **SMOOTH**: Auto-detection of old vs new mode
|
|
146
|
-
|
|
147
|
-
### 🐛 **Bug Fixes**
|
|
148
|
-
- **FIXED**: Connection timeout handling
|
|
149
|
-
- **FIXED**: Error response formatting
|
|
150
|
-
- **FIXED**: Configuration persistence issues
|
|
151
|
-
- **FIXED**: MCP client compatibility issues
|
|
152
|
-
|
|
153
|
-
### ⚠️ **Breaking Changes**
|
|
154
|
-
- **BREAKING**: New binary location (`bin/mcp-prompt-optimizer`)
|
|
155
|
-
- **BREAKING**: Enhanced configuration structure
|
|
156
|
-
- **BREAKING**: New tool response format (includes content array)
|
|
157
|
-
- **MIGRATION**: Automatic migration from legacy config
|
|
158
|
-
|
|
159
|
-
### 🔒 **Security**
|
|
160
|
-
- **IMPROVED**: Input validation and sanitization
|
|
161
|
-
- **IMPROVED**: Error message safety
|
|
162
|
-
- **NEW**: Local processing for sensitive parameters
|
|
163
|
-
- **NEW**: Configurable data routing
|
|
50
|
+
---
|
|
164
51
|
|
|
165
52
|
## [1.0.2] - 2024-12-17
|
|
166
53
|
|
|
@@ -181,73 +68,4 @@ All notable changes to the MCP Prompt Optimizer will be documented in this file.
|
|
|
181
68
|
- Remote optimization using AI-Enhanced Prompt Optimizer API
|
|
182
69
|
- MCP protocol compliance
|
|
183
70
|
- Cross-platform support (Windows, macOS, Linux)
|
|
184
|
-
- Global npm installation support
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
## Migration Guide: 1.x → 2.0
|
|
189
|
-
|
|
190
|
-
### For Existing Users
|
|
191
|
-
|
|
192
|
-
1. **Backup Configuration** (optional):
|
|
193
|
-
```bash
|
|
194
|
-
cp ~/.prompt-optimizer/config.json ~/.prompt-optimizer/config.json.backup
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
2. **Update Package**:
|
|
198
|
-
```bash
|
|
199
|
-
npm update -g mcp-prompt-optimizer
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
3. **Test New Server**:
|
|
203
|
-
```bash
|
|
204
|
-
mcp-prompt-optimizer --health-check
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
4. **Update MCP Client Config** (optional):
|
|
208
|
-
```json
|
|
209
|
-
{
|
|
210
|
-
"mcpServers": {
|
|
211
|
-
"prompt-optimizer": {
|
|
212
|
-
"command": "npx",
|
|
213
|
-
"args": ["mcp-prompt-optimizer", "--mode", "auto"]
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
### New Configuration Options
|
|
220
|
-
|
|
221
|
-
```bash
|
|
222
|
-
# Use hybrid mode (recommended)
|
|
223
|
-
mcp-prompt-optimizer --mode hybrid
|
|
224
|
-
|
|
225
|
-
# Use local-only (no API key needed)
|
|
226
|
-
mcp-prompt-optimizer --local-only
|
|
227
|
-
|
|
228
|
-
# Debug mode
|
|
229
|
-
mcp-prompt-optimizer --debug
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
### Legacy Mode
|
|
233
|
-
|
|
234
|
-
The 1.x functionality is still available:
|
|
235
|
-
```bash
|
|
236
|
-
mcp-prompt-optimizer --legacy
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
---
|
|
240
|
-
|
|
241
|
-
## Upgrade Benefits
|
|
242
|
-
|
|
243
|
-
| Aspect | v1.x | v2.0 |
|
|
244
|
-
|--------|------|------|
|
|
245
|
-
| **Speed** | ~2-5s | ~50ms (local) |
|
|
246
|
-
| **Offline** | ❌ | ✅ (local mode) |
|
|
247
|
-
| **Preservation** | ⚠️ | ✅ (perfect) |
|
|
248
|
-
| **Clients** | Limited | All MCP clients |
|
|
249
|
-
| **Architecture** | API wrapper | True MCP server |
|
|
250
|
-
| **Intelligence** | Basic | Hybrid routing |
|
|
251
|
-
| **Flexibility** | Single mode | 5 modes |
|
|
252
|
-
|
|
253
|
-
**Ready to experience the future of prompt optimization? Update now!**
|
|
71
|
+
- Global npm installation support
|