feedbackbasket-mcp-server 1.0.0 → 1.0.1

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/dist/index.js +30 -19
  2. package/package.json +2 -3
package/dist/index.js CHANGED
@@ -2,26 +2,38 @@
2
2
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
3
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
4
  import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
5
- import { program } from 'commander';
6
5
  import { FeedbackBasketClient } from './client.js';
7
- // Parse command line arguments
8
- program
9
- .option('--api-key <key>', 'FeedbackBasket API key')
10
- .option('--base-url <url>', 'Base URL for FeedbackBasket API', 'https://feedbackbasket.com')
11
- .parse();
12
- const options = program.opts();
6
+ // Parse command line arguments manually (like Stripe does)
7
+ function parseArgs(args) {
8
+ const options = {};
9
+ args.forEach((arg) => {
10
+ if (arg.startsWith('--')) {
11
+ const [key, value] = arg.slice(2).split('=');
12
+ if (key === 'api-key' && value) {
13
+ options.apiKey = value;
14
+ }
15
+ else if (key === 'base-url' && value) {
16
+ options.baseUrl = value;
17
+ }
18
+ }
19
+ });
20
+ return options;
21
+ }
22
+ const options = parseArgs(process.argv.slice(2));
13
23
  const apiKey = options.apiKey || process.env.FEEDBACKBASKET_API_KEY;
24
+ const baseUrl = options.baseUrl || 'https://feedbackbasket.com';
14
25
  if (!apiKey) {
15
26
  console.error('Error: API key required.');
16
27
  console.error('Usage: Use --api-key option or set FEEDBACKBASKET_API_KEY environment variable');
17
28
  process.exit(1);
18
29
  }
19
30
  // Validate API key format
20
- if (!/^fb_key_[a-f0-9]{64}$/.test(apiKey)) {
21
- console.error('Error: Invalid API key format. API keys should start with "fb_key_" followed by 64 hexadecimal characters.');
31
+ if (!apiKey.startsWith('fb_key_')) {
32
+ console.error('Error: Invalid API key format. API keys should start with "fb_key_".');
22
33
  process.exit(1);
23
34
  }
24
- const client = new FeedbackBasketClient(apiKey, options.baseUrl);
35
+ console.log('API key format accepted:', apiKey.substring(0, 20) + '...');
36
+ const client = new FeedbackBasketClient(apiKey, baseUrl);
25
37
  // Create MCP server
26
38
  const server = new Server({
27
39
  name: 'feedbackbasket-mcp',
@@ -205,11 +217,11 @@ async function main() {
205
217
  try {
206
218
  const transport = new StdioServerTransport();
207
219
  await server.connect(transport);
208
- // Server is now running and will handle requests via stdio
209
- console.error('FeedbackBasket MCP server started successfully');
220
+ // We use console.error instead of console.log since console.log will output to stdio, which will confuse the MCP server
221
+ console.error('FeedbackBasket MCP server started successfully');
210
222
  }
211
223
  catch (error) {
212
- console.error('Failed to start MCP server:', error);
224
+ console.error('🚨 Failed to start MCP server:', error);
213
225
  process.exit(1);
214
226
  }
215
227
  }
@@ -222,9 +234,8 @@ process.on('SIGTERM', () => {
222
234
  console.error('Received SIGTERM, shutting down gracefully...');
223
235
  process.exit(0);
224
236
  });
225
- if (import.meta.url === `file://${process.argv[1]}`) {
226
- main().catch((error) => {
227
- console.error('Fatal error:', error);
228
- process.exit(1);
229
- });
230
- }
237
+ // Only run if this file is the main module
238
+ main().catch((error) => {
239
+ console.error('🚨 Fatal error:', error);
240
+ process.exit(1);
241
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feedbackbasket-mcp-server",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "MCP server for FeedbackBasket project data access",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -34,8 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@modelcontextprotocol/sdk": "^0.4.0",
37
- "axios": "^1.6.0",
38
- "commander": "^11.0.0"
37
+ "axios": "^1.6.0"
39
38
  },
40
39
  "devDependencies": {
41
40
  "@types/node": "^20.0.0",