mcp-prompt-optimizer 1.0.2 → 1.0.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 CHANGED
@@ -5,6 +5,25 @@ All notable changes to the MCP Prompt Optimizer package will be documented in th
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
+ ## [1.0.3] - 2025-06-18
9
+
10
+ ### Fixed
11
+ - **CRITICAL**: Fixed binary execution issue on Windows systems
12
+ - Changed binary configuration to point directly to index.js instead of bin/start-server
13
+ - Resolved issue where global installation commands (--help, --version) failed silently
14
+ - Improved version detection for global installations
15
+ - Fixed Windows batch file generation issues
16
+
17
+ ### Improved
18
+ - Enhanced binary path resolution for global installations
19
+ - Added fallback version detection when package.json path resolution fails
20
+ - Better error handling in binary execution
21
+
22
+ ### Notes
23
+ - This fix resolves the issue where `mcp-prompt-optimizer --help` and `mcp-prompt-optimizer --version` returned no output
24
+ - Existing functionality remains unchanged
25
+ - No breaking changes to API or configuration
26
+
8
27
  ## [1.0.2] - 2025-06-18
9
28
 
10
29
  ### Fixed
@@ -88,12 +107,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
107
 
89
108
  | Package Version | Backend API Version | Deployment URL |
90
109
  |-----------------|--------------------|--------------------|
110
+ | 1.0.3 | v0.2.2+ | https://p01--project-optimizer--fvrdk8m9k9j.code.run |
91
111
  | 1.0.2 | v0.2.2+ | https://p01--project-optimizer--fvrdk8m9k9j.code.run |
92
112
  | 1.0.1 | v0.2.2+ | https://p01--project-optimizer--fvrdk8m9k9j.code.run |
93
113
  | 1.0.0 | v0.2.0+ | Placeholder URL (manual configuration required) |
94
114
 
95
115
  ## Migration Guide
96
116
 
117
+ ### From 1.0.2 to 1.0.3
118
+
119
+ No breaking changes. This update fixes binary execution issues on Windows systems.
120
+
121
+ **Update process:**
122
+ ```bash
123
+ # Update the package
124
+ npm update -g mcp-prompt-optimizer
125
+
126
+ # Verify new version and functionality
127
+ mcp-prompt-optimizer --version
128
+ mcp-prompt-optimizer --help
129
+
130
+ # No configuration changes needed
131
+ ```
132
+
97
133
  ### From 1.0.1 to 1.0.2
98
134
 
99
135
  No breaking changes. This is a documentation-only update.
@@ -131,11 +167,15 @@ npm test
131
167
 
132
168
  ## Known Issues
133
169
 
134
- ### 1.0.2
170
+ ### 1.0.3
135
171
  - None known at release time
136
172
 
173
+ ### 1.0.2
174
+ - Binary execution issues on Windows (fixed in 1.0.3)
175
+
137
176
  ### 1.0.1
138
177
  - Pricing documentation inconsistency (fixed in 1.0.2)
178
+ - Binary execution issues on Windows (fixed in 1.0.3)
139
179
 
140
180
  ### 1.0.0
141
181
  - Required manual backend URL configuration
package/bin/start-server CHANGED
@@ -1,2 +1,22 @@
1
1
  #!/usr/bin/env node
2
- require('../index.js');
2
+
3
+ // More robust binary that handles global installation better
4
+ const path = require('path');
5
+
6
+ // Determine the correct path to index.js
7
+ let indexPath;
8
+ if (__dirname.includes('node_modules')) {
9
+ // Running from global installation
10
+ indexPath = path.join(__dirname, '..', 'index.js');
11
+ } else {
12
+ // Running from local development
13
+ indexPath = path.join(__dirname, '..', 'index.js');
14
+ }
15
+
16
+ try {
17
+ require(indexPath);
18
+ } catch (error) {
19
+ console.error('Failed to start MCP Prompt Optimizer:', error.message);
20
+ console.error('Please try: npm install -g mcp-prompt-optimizer@latest');
21
+ process.exit(1);
22
+ }
package/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  const MCPServer = require('./lib/mcp-protocol');
4
4
  const Config = require('./lib/config');
5
+ const path = require('path');
5
6
 
6
7
  async function setup() {
7
8
  const readline = require('readline');
@@ -158,8 +159,32 @@ async function showHelp() {
158
159
  }
159
160
 
160
161
  async function showVersion() {
161
- const packageJson = require('./package.json');
162
- console.log(`mcp-prompt-optimizer v${packageJson.version}`);
162
+ try {
163
+ // Try multiple paths to find package.json when installed globally
164
+ let packageJson;
165
+ const possiblePaths = [
166
+ path.join(__dirname, 'package.json'), // Local development
167
+ path.join(__dirname, '..', 'package.json'), // When run from bin/
168
+ path.join(process.cwd(), 'package.json'), // Current directory
169
+ ];
170
+
171
+ for (const packagePath of possiblePaths) {
172
+ try {
173
+ packageJson = require(packagePath);
174
+ break;
175
+ } catch (e) {
176
+ continue;
177
+ }
178
+ }
179
+
180
+ if (packageJson && packageJson.version) {
181
+ console.log(`mcp-prompt-optimizer v${packageJson.version}`);
182
+ } else {
183
+ console.log('mcp-prompt-optimizer v1.0.2 (version detection failed)');
184
+ }
185
+ } catch (error) {
186
+ console.log('mcp-prompt-optimizer v1.0.2 (version detection failed)');
187
+ }
163
188
  }
164
189
 
165
190
  // Main execution
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "mcp-prompt-optimizer",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Local MCP server for Prompt Optimizer API",
5
5
  "main": "index.js",
6
6
  "preferGlobal": true,
7
7
  "bin": {
8
- "mcp-prompt-optimizer": "./bin/start-server"
8
+ "mcp-prompt-optimizer": "index.js"
9
9
  },
10
10
  "scripts": {
11
11
  "start": "node index.js",