@deepqtech/mcp-server-js 1.0.4 → 1.0.5

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/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "src/",
9
9
  "tools-manifest.json"
10
10
  ],
11
- "version": "1.0.4",
11
+ "version": "1.0.5",
12
12
  "main": "index.js",
13
13
  "type": "module",
14
14
  "scripts": {
@@ -1,6 +1,7 @@
1
1
  import axios from 'axios';
2
2
  import {compile, match} from 'path-to-regexp';
3
3
  import _ from 'lodash';
4
+ import https from 'https';
4
5
 
5
6
  export async function callApi(toolMeta, args) {
6
7
  const {baseUrl, path, method, authorizationEnvKey} = toolMeta;
@@ -35,6 +36,11 @@ export async function callApi(toolMeta, args) {
35
36
  url,
36
37
  headers,
37
38
  [paramKey]: otherParams,
39
+ httpsAgent: new https.Agent({
40
+ // 如果是自簽名憑證或測試環境,可設為 false;生產環境建議保持 true
41
+ rejectUnauthorized: false
42
+ }),
43
+ proxy: false
38
44
  });
39
45
 
40
46
  return response.data;
@@ -105,6 +105,7 @@ export const startMcpServer = async (toolDefinitions) => {
105
105
  structuredContent: result,
106
106
  };
107
107
  } catch (error) {
108
+ console.error(error);
108
109
  return {
109
110
  content: [{type: 'text', text: `Error calling API: ${error.message}`}],
110
111
  isError: true,