update mcp server (#5076)

* update mcp server

* fix: action

* fix: dockerfile

* fix: dockerfile

* fix: dockerfile

* fix: dockerfile

* fix: dockerfile

* fix: dockerfile
This commit is contained in:
Archer
2025-06-22 14:36:56 +08:00
committed by GitHub
parent 3ed3f2ad01
commit 02dfbda1f8
11 changed files with 243 additions and 235 deletions

View File

@@ -7,6 +7,16 @@ toc: true
weight: 787
---
## 更新指南
### 1. 更新镜像:
- 更新 FastGPT 镜像 tag: v4.9.13
- 更新 FastGPT 商业版镜像 tag: v4.9.13
- mcp_server 无需更新
- Sandbox 无需更新
- AIProxy 无需更新
## 🚀 新增内容

View File

@@ -4,7 +4,7 @@ description: 'FastGPT V4.9.14 更新说明'
icon: 'upgrade'
draft: false
toc: true
weight: 787
weight: 786
---

183
pnpm-lock.yaml generated
View File

@@ -697,12 +697,12 @@ importers:
projects/mcp_server:
dependencies:
'@fastgpt/global':
specifier: workspace:*
version: link:../../packages/global
'@modelcontextprotocol/sdk':
specifier: ^1.12.1
version: 1.12.2
axios:
specifier: ^1.8.2
version: 1.8.4
chalk:
specifier: ^5.3.0
version: 5.4.1
@@ -719,15 +719,6 @@ importers:
'@types/express':
specifier: ^5.0.1
version: 5.0.1
nodemon:
specifier: ^3.1.9
version: 3.1.9
shx:
specifier: ^0.3.4
version: 0.3.4
typescript:
specifier: ^5.6.2
version: 5.8.2
projects/sandbox:
dependencies:
@@ -5994,9 +5985,6 @@ packages:
ieee754@1.2.1:
resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}
ignore-by-default@1.0.1:
resolution: {integrity: sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==}
ignore@5.3.2:
resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==}
engines: {node: '>= 4'}
@@ -6070,10 +6058,6 @@ packages:
resolution: {integrity: sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==}
engines: {node: '>=12'}
interpret@1.4.0:
resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==}
engines: {node: '>= 0.10'}
intersection-observer@0.12.2:
resolution: {integrity: sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg==}
@@ -7535,11 +7519,6 @@ packages:
resolution: {integrity: sha512-SQ3wZCExjeSatLE/HBaXS5vqUOQk6GtBdIIKxiFdmm01mOQZX/POJkO3SUX1wDiYcwUOJwT23scFSC9fY2H8IA==}
engines: {node: '>=6.0.0'}
nodemon@3.1.9:
resolution: {integrity: sha512-hdr1oIb2p6ZSxu3PB2JWWYS7ZQ0qvaZsc3hK8DR8f02kRzc8rjYmxAIvdz+aYC+8F2IjNaB7HMcSDg8nQpJxyg==}
engines: {node: '>=10'}
hasBin: true
non-layered-tidy-tree-layout@2.0.2:
resolution: {integrity: sha512-gkXMxRzUH+PB0ax9dUN0yYF0S25BqeAYqhgMaLUFmpXLEk7Fcu8f4emJuOAY0V8kjDICxROIKsTAKsV/v355xw==}
@@ -8055,9 +8034,6 @@ packages:
proxy-from-env@1.1.0:
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
pstree.remy@1.1.8:
resolution: {integrity: sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==}
pump@3.0.2:
resolution: {integrity: sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==}
@@ -8306,10 +8282,6 @@ packages:
react: ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
react-dom: ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
rechoir@0.6.2:
resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==}
engines: {node: '>= 0.10'}
redis-errors@1.2.0:
resolution: {integrity: sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==}
engines: {node: '>=4'}
@@ -8651,16 +8623,6 @@ packages:
resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
engines: {node: '>=8'}
shelljs@0.8.5:
resolution: {integrity: sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==}
engines: {node: '>=4'}
hasBin: true
shx@0.3.4:
resolution: {integrity: sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==}
engines: {node: '>=6'}
hasBin: true
side-channel-list@1.0.0:
resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==}
engines: {node: '>= 0.4'}
@@ -8699,10 +8661,6 @@ packages:
simple-swizzle@0.2.2:
resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==}
simple-update-notifier@2.0.0:
resolution: {integrity: sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==}
engines: {node: '>=10'}
sisteransi@1.0.5:
resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==}
@@ -9127,10 +9085,6 @@ packages:
resolution: {integrity: sha512-lbDrTLVsHhOMljPscd0yitpozq7Ga2M5Cvez5AjGg8GASBjtt6iERCAJ93yommPmz62fb45oFIXHEZ3u9bfJEA==}
engines: {node: '>=14.16'}
touch@3.1.1:
resolution: {integrity: sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==}
hasBin: true
tr46@0.0.3:
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
@@ -9333,9 +9287,6 @@ packages:
unbzip2-stream@1.4.3:
resolution: {integrity: sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==}
undefsafe@2.0.5:
resolution: {integrity: sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==}
underscore@1.13.7:
resolution: {integrity: sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==}
@@ -10167,7 +10118,7 @@ snapshots:
'@babel/traverse': 7.26.10
'@babel/types': 7.26.10
convert-source-map: 2.0.0
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
gensync: 1.0.0-beta.2
json5: 2.2.3
semver: 6.3.1
@@ -10219,7 +10170,7 @@ snapshots:
'@babel/core': 7.26.10
'@babel/helper-compilation-targets': 7.26.5
'@babel/helper-plugin-utils': 7.26.5
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
lodash.debounce: 4.0.8
resolve: 1.22.10
transitivePeerDependencies:
@@ -10923,7 +10874,7 @@ snapshots:
'@babel/parser': 7.26.10
'@babel/template': 7.26.9
'@babel/types': 7.26.10
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
globals: 11.12.0
transitivePeerDependencies:
- supports-color
@@ -11394,7 +11345,7 @@ snapshots:
'@eslint/eslintrc@2.1.4':
dependencies:
ajv: 6.12.6
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
espree: 9.6.1
globals: 13.24.0
ignore: 5.3.2
@@ -11482,7 +11433,7 @@ snapshots:
'@humanwhocodes/config-array@0.11.14':
dependencies:
'@humanwhocodes/object-schema': 2.0.3
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
minimatch: 3.1.2
transitivePeerDependencies:
- supports-color
@@ -11490,7 +11441,7 @@ snapshots:
'@humanwhocodes/config-array@0.13.0':
dependencies:
'@humanwhocodes/object-schema': 2.0.3
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
minimatch: 3.1.2
transitivePeerDependencies:
- supports-color
@@ -13051,7 +13002,7 @@ snapshots:
'@typescript-eslint/type-utils': 6.21.0(eslint@8.56.0)(typescript@5.8.2)
'@typescript-eslint/utils': 6.21.0(eslint@8.56.0)(typescript@5.8.2)
'@typescript-eslint/visitor-keys': 6.21.0
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
eslint: 8.56.0
graphemer: 1.4.0
ignore: 5.3.2
@@ -13071,7 +13022,7 @@ snapshots:
'@typescript-eslint/type-utils': 6.21.0(eslint@8.57.1)(typescript@5.8.2)
'@typescript-eslint/utils': 6.21.0(eslint@8.57.1)(typescript@5.8.2)
'@typescript-eslint/visitor-keys': 6.21.0
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
eslint: 8.57.1
graphemer: 1.4.0
ignore: 5.3.2
@@ -13089,7 +13040,7 @@ snapshots:
'@typescript-eslint/types': 6.21.0
'@typescript-eslint/typescript-estree': 6.21.0(typescript@5.8.2)
'@typescript-eslint/visitor-keys': 6.21.0
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
eslint: 8.56.0
optionalDependencies:
typescript: 5.8.2
@@ -13102,7 +13053,7 @@ snapshots:
'@typescript-eslint/types': 6.21.0
'@typescript-eslint/typescript-estree': 6.21.0(typescript@5.8.2)
'@typescript-eslint/visitor-keys': 6.21.0
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
eslint: 8.57.1
optionalDependencies:
typescript: 5.8.2
@@ -13118,7 +13069,7 @@ snapshots:
dependencies:
'@typescript-eslint/typescript-estree': 6.21.0(typescript@5.8.2)
'@typescript-eslint/utils': 6.21.0(eslint@8.56.0)(typescript@5.8.2)
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
eslint: 8.56.0
ts-api-utils: 1.4.3(typescript@5.8.2)
optionalDependencies:
@@ -13130,7 +13081,7 @@ snapshots:
dependencies:
'@typescript-eslint/typescript-estree': 6.21.0(typescript@5.8.2)
'@typescript-eslint/utils': 6.21.0(eslint@8.57.1)(typescript@5.8.2)
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
eslint: 8.57.1
ts-api-utils: 1.4.3(typescript@5.8.2)
optionalDependencies:
@@ -13144,7 +13095,7 @@ snapshots:
dependencies:
'@typescript-eslint/types': 6.21.0
'@typescript-eslint/visitor-keys': 6.21.0
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
globby: 11.1.0
is-glob: 4.0.3
minimatch: 9.0.3
@@ -13194,7 +13145,7 @@ snapshots:
dependencies:
'@ampproject/remapping': 2.3.0
'@bcoe/v8-coverage': 1.0.2
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
istanbul-lib-coverage: 3.2.2
istanbul-lib-report: 3.0.1
istanbul-lib-source-maps: 5.0.6
@@ -13842,7 +13793,7 @@ snapshots:
dependencies:
bytes: 3.1.2
content-type: 1.0.5
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
http-errors: 2.0.0
iconv-lite: 0.6.3
on-finished: 2.4.1
@@ -14627,11 +14578,9 @@ snapshots:
dependencies:
ms: 2.1.2
debug@4.4.0(supports-color@5.5.0):
debug@4.4.0:
dependencies:
ms: 2.1.3
optionalDependencies:
supports-color: 5.5.0
decamelize@1.2.0: {}
@@ -15133,7 +15082,7 @@ snapshots:
eslint-import-resolver-typescript@3.9.0(eslint-plugin-import@2.31.0)(eslint@8.56.0):
dependencies:
'@nolyfill/is-core-module': 1.0.39
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
eslint: 8.56.0
get-tsconfig: 4.10.0
is-bun-module: 1.3.0
@@ -15148,7 +15097,7 @@ snapshots:
eslint-import-resolver-typescript@3.9.0(eslint-plugin-import@2.31.0)(eslint@8.57.1):
dependencies:
'@nolyfill/is-core-module': 1.0.39
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
eslint: 8.57.1
get-tsconfig: 4.10.0
is-bun-module: 1.3.0
@@ -15355,7 +15304,7 @@ snapshots:
ajv: 6.12.6
chalk: 4.1.2
cross-spawn: 7.0.6
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
doctrine: 3.0.0
escape-string-regexp: 4.0.0
eslint-scope: 7.2.2
@@ -15398,7 +15347,7 @@ snapshots:
ajv: 6.12.6
chalk: 4.1.2
cross-spawn: 7.0.6
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
doctrine: 3.0.0
escape-string-regexp: 4.0.0
eslint-scope: 7.2.2
@@ -15576,7 +15525,7 @@ snapshots:
content-type: 1.0.5
cookie: 0.7.2
cookie-signature: 1.2.2
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
encodeurl: 2.0.0
escape-html: 1.0.3
etag: 1.8.1
@@ -15757,7 +15706,7 @@ snapshots:
finalhandler@2.1.0:
dependencies:
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
encodeurl: 2.0.0
escape-html: 1.0.3
on-finished: 2.4.1
@@ -15806,7 +15755,7 @@ snapshots:
follow-redirects@1.15.9(debug@4.4.0):
optionalDependencies:
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
for-each@0.3.5:
dependencies:
@@ -16213,7 +16162,7 @@ snapshots:
http-proxy-agent@7.0.2:
dependencies:
agent-base: 7.1.3
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
transitivePeerDependencies:
- supports-color
@@ -16225,7 +16174,7 @@ snapshots:
https-proxy-agent@7.0.6:
dependencies:
agent-base: 7.1.3
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
transitivePeerDependencies:
- supports-color
@@ -16261,8 +16210,6 @@ snapshots:
ieee754@1.2.1: {}
ignore-by-default@1.0.1: {}
ignore@5.3.2: {}
immediate@3.0.6: {}
@@ -16350,15 +16297,13 @@ snapshots:
internmap@2.0.3: {}
interpret@1.4.0: {}
intersection-observer@0.12.2: {}
ioredis@5.6.0:
dependencies:
'@ioredis/commands': 1.2.0
cluster-key-slot: 1.1.2
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
denque: 2.1.0
lodash.defaults: 4.2.0
lodash.isarguments: 3.1.0
@@ -16629,7 +16574,7 @@ snapshots:
istanbul-lib-source-maps@4.0.1:
dependencies:
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
istanbul-lib-coverage: 3.2.2
source-map: 0.6.1
transitivePeerDependencies:
@@ -16638,7 +16583,7 @@ snapshots:
istanbul-lib-source-maps@5.0.6:
dependencies:
'@jridgewell/trace-mapping': 0.3.25
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
istanbul-lib-coverage: 3.2.2
transitivePeerDependencies:
- supports-color
@@ -17931,7 +17876,7 @@ snapshots:
micromark@3.2.0:
dependencies:
'@types/debug': 4.1.12
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
decode-named-character-reference: 1.1.0
micromark-core-commonmark: 1.1.0
micromark-factory-space: 1.1.0
@@ -17953,7 +17898,7 @@ snapshots:
micromark@4.0.2:
dependencies:
'@types/debug': 4.1.12
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
decode-named-character-reference: 1.1.0
devlop: 1.1.0
micromark-core-commonmark: 2.0.3
@@ -18093,7 +18038,7 @@ snapshots:
dependencies:
async-mutex: 0.5.0
camelcase: 6.3.0
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
find-cache-dir: 3.3.2
follow-redirects: 1.15.9(debug@4.4.0)
https-proxy-agent: 7.0.6
@@ -18158,7 +18103,7 @@ snapshots:
mquery@5.0.0:
dependencies:
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
transitivePeerDependencies:
- supports-color
@@ -18190,7 +18135,7 @@ snapshots:
dependencies:
'@tediousjs/connection-string': 0.5.0
commander: 11.1.0
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
rfdc: 1.4.1
tarn: 3.0.2
tedious: 18.6.1
@@ -18252,7 +18197,7 @@ snapshots:
new-find-package-json@2.0.0:
dependencies:
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
transitivePeerDependencies:
- supports-color
@@ -18358,19 +18303,6 @@ snapshots:
nodemailer@6.10.0: {}
nodemon@3.1.9:
dependencies:
chokidar: 3.6.0
debug: 4.4.0(supports-color@5.5.0)
ignore-by-default: 1.0.1
minimatch: 3.1.2
pstree.remy: 1.1.8
semver: 7.7.1
simple-update-notifier: 2.0.0
supports-color: 5.5.0
touch: 3.1.1
undefsafe: 2.0.5
non-layered-tidy-tree-layout@2.0.2: {}
nopt@7.2.1:
@@ -18919,8 +18851,6 @@ snapshots:
proxy-from-env@1.1.0: {}
pstree.remy@1.1.8: {}
pump@3.0.2:
dependencies:
end-of-stream: 1.4.4
@@ -19216,10 +19146,6 @@ snapshots:
tiny-invariant: 1.3.3
victory-vendor: 36.9.2
rechoir@0.6.2:
dependencies:
resolve: 1.22.10
redis-errors@1.2.0: {}
redis-parser@3.0.0:
@@ -19477,7 +19403,7 @@ snapshots:
router@2.2.0:
dependencies:
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
depd: 2.0.0
is-promise: 4.0.0
parseurl: 1.3.3
@@ -19605,7 +19531,7 @@ snapshots:
send@1.2.0:
dependencies:
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
encodeurl: 2.0.0
escape-html: 1.0.3
etag: 1.8.1
@@ -19679,17 +19605,6 @@ snapshots:
shebang-regex@3.0.0: {}
shelljs@0.8.5:
dependencies:
glob: 7.2.3
interpret: 1.4.0
rechoir: 0.6.2
shx@0.3.4:
dependencies:
minimist: 1.2.8
shelljs: 0.8.5
side-channel-list@1.0.0:
dependencies:
es-errors: 1.3.0
@@ -19738,10 +19653,6 @@ snapshots:
dependencies:
is-arrayish: 0.3.2
simple-update-notifier@2.0.0:
dependencies:
semver: 7.7.1
sisteransi@1.0.5: {}
slash@3.0.0: {}
@@ -19756,7 +19667,7 @@ snapshots:
socks-proxy-agent@8.0.5:
dependencies:
agent-base: 7.1.3
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
socks: 2.8.4
transitivePeerDependencies:
- supports-color
@@ -19989,7 +19900,7 @@ snapshots:
dependencies:
component-emitter: 1.3.1
cookiejar: 2.1.4
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
fast-safe-stringify: 2.1.1
form-data: 4.0.2
formidable: 2.1.2
@@ -20186,8 +20097,6 @@ snapshots:
'@tokenizer/token': 0.3.0
ieee754: 1.2.1
touch@3.1.1: {}
tr46@0.0.3: {}
tr46@5.1.0:
@@ -20387,8 +20296,6 @@ snapshots:
buffer: 5.7.1
through: 2.3.8
undefsafe@2.0.5: {}
underscore@1.13.7: {}
undici-types@5.26.5: {}
@@ -20651,7 +20558,7 @@ snapshots:
vite-node@1.6.1(@types/node@20.17.24)(sass@1.85.1)(terser@5.39.0):
dependencies:
cac: 6.7.14
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
pathe: 1.1.2
picocolors: 1.1.1
vite: 5.4.14(@types/node@20.17.24)(sass@1.85.1)(terser@5.39.0)
@@ -20669,7 +20576,7 @@ snapshots:
vite-node@3.1.1(@types/node@20.17.24)(sass@1.85.1)(terser@5.39.0):
dependencies:
cac: 6.7.14
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
es-module-lexer: 1.6.0
pathe: 2.0.3
vite: 6.2.2(@types/node@20.17.24)(sass@1.85.1)(terser@5.39.0)
@@ -20718,7 +20625,7 @@ snapshots:
'@vitest/utils': 1.6.1
acorn-walk: 8.3.4
chai: 4.5.0
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
execa: 8.0.1
local-pkg: 0.5.1
magic-string: 0.30.17
@@ -20753,7 +20660,7 @@ snapshots:
'@vitest/spy': 3.1.1
'@vitest/utils': 3.1.1
chai: 5.2.0
debug: 4.4.0(supports-color@5.5.0)
debug: 4.4.0
expect-type: 1.2.0
magic-string: 0.30.17
pathe: 2.0.3

View File

@@ -6,6 +6,7 @@ RUN npm install -g pnpm@9.4.0
# 复制package.json
COPY pnpm-lock.yaml pnpm-workspace.yaml ./
COPY packages/global ./packages/global
COPY projects/mcp_server/package.json ./projects/mcp_server/package.json
RUN apk add --no-cache\
@@ -14,18 +15,30 @@ RUN apk add --no-cache\
# 安装依赖
RUN [ -f pnpm-lock.yaml ] || (echo "Lockfile not found." && exit 1)
RUN pnpm i
# if proxy exists, set proxy
RUN if [ -z "$proxy" ]; then \
pnpm i; \
else \
pnpm i --registry=https://registry.npmmirror.com; \
fi
# --------- builder -----------
FROM node:20.14.0-alpine AS builder
WORKDIR /app
COPY package.json pnpm-workspace.yaml /app/
COPY package.json pnpm-workspace.yaml .npmrc tsconfig.json ./
COPY ./projects/mcp_server /app/projects/mcp_server
COPY --from=install /app/packages /app/packages
COPY --from=install /app/node_modules /app/node_modules
COPY --from=install /app/projects/mcp_server/node_modules /app/projects/mcp_server/node_modules
RUN npm install -g pnpm@9.4.0
RUN [ -z "$proxy" ] || sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk add --no-cache libc6-compat curl bash && npm install -g pnpm@9.4.0
# Install curl and bash, then install bun
RUN curl -fsSL https://bun.sh/install | bash
ENV PATH="/root/.bun/bin:$PATH"
RUN pnpm --filter=mcp_server build
# runner

View File

@@ -8,23 +8,20 @@
],
"type": "module",
"scripts": {
"build": "tsc && shx chmod +x dist/*.js",
"dev": "nodemon --watch src --ext ts,json --exec \"npm run dev:run\"",
"dev:run": "tsc && node dist/index.js",
"build": "bun build src/index.ts --outdir=dist --target=node && chmod +x dist/index.js",
"dev": "bun --watch src/index.ts",
"start": "bun src/index.ts",
"mcp_test": "npx @modelcontextprotocol/inspector"
},
"dependencies": {
"@fastgpt/global": "workspace:*",
"@modelcontextprotocol/sdk": "^1.12.1",
"axios": "^1.8.2",
"chalk": "^5.3.0",
"dayjs": "^1.11.7",
"dotenv": "^16.5.0",
"express": "^4.21.2"
},
"devDependencies": {
"@types/express": "^5.0.1",
"nodemon": "^3.1.9",
"shx": "^0.3.4",
"typescript": "^5.6.2"
"@types/express": "^5.0.1"
}
}

View File

@@ -1,5 +1,5 @@
import type { Tool } from '@modelcontextprotocol/sdk/types.js';
import { GET, POST } from './request.js';
import { GET, POST } from './request';
export const getTools = (key: string) => GET<Tool[]>('/support/mcp/server/toolList', { key });

View File

@@ -1,29 +1,16 @@
import type { Method, InternalAxiosRequestConfig, AxiosResponse } from 'axios';
import axios from 'axios';
import { addLog } from '../utils/log';
type ConfigType = {
headers?: Record<string, string>;
timeout?: number;
};
type ConfigType = {};
type ResponseDataType = {
code: number;
message: string;
data: any;
};
/**
* 请求开始
*/
function startInterceptors(config: InternalAxiosRequestConfig): InternalAxiosRequestConfig {
if (config.headers) {
}
return config;
}
/**
* 请求成功,检查请求头
*/
function responseSuccess(response: AxiosResponse<ResponseDataType>) {
return response;
}
/**
* 响应数据检查
*/
@@ -38,10 +25,10 @@ function checkRes(data: ResponseDataType) {
}
/**
* 响应错误
* 响应错误处理
*/
function responseError(err: any) {
console.log('error->', '请求错误', err);
addLog.error(`Fetch request error`, err);
const data = err?.response?.data || err;
if (!err) {
@@ -51,62 +38,175 @@ function responseError(err: any) {
return Promise.reject({ message: err });
}
if (typeof data === 'string') {
return Promise.reject(data);
}
}
/* 创建请求实例 */
const instance = axios.create({
baseURL: `${process.env.FASTGPT_ENDPOINT}/api`,
timeout: 600000, // 超时时间
headers: {
'content-type': 'application/json'
}
});
/* 请求拦截 */
instance.interceptors.request.use(startInterceptors, (err) => Promise.reject(err));
/* 响应拦截 */
instance.interceptors.response.use(responseSuccess, (err) => Promise.reject(err));
function request(url: string, data: any, config: ConfigType, method: Method): any {
/* 去空 */
for (const key in data) {
if (data[key] === undefined) {
delete data[key];
}
return Promise.reject({ message: data });
}
return instance
.request({
url,
method,
data: ['POST', 'PUT'].includes(method) ? data : undefined,
params: !['POST', 'PUT'].includes(method) ? data : undefined
})
.then((res) => checkRes(res.data))
.catch((err) => responseError(err));
// Handle fetch-specific errors
if (err.name === 'AbortError') {
return Promise.reject({ message: '请求超时' });
}
if (err.name === 'TypeError' && err.message.includes('fetch')) {
return Promise.reject({ message: '网络连接失败' });
}
return Promise.reject(data || err);
}
/**
* api请求方式
* @param {String} url
* @param {Any} params
* @param {Object} config
* @returns
* 构建查询参数
*/
function buildQueryString(params: Record<string, any>): string {
const searchParams = new URLSearchParams();
Object.keys(params).forEach((key) => {
const value = params[key];
if (value !== undefined && value !== null) {
if (Array.isArray(value)) {
value.forEach((item) => searchParams.append(key, String(item)));
} else {
searchParams.append(key, String(value));
}
}
});
return searchParams.toString();
}
/**
* 发送请求
*/
async function request(url: string, data: any, config: ConfigType, method: string): Promise<any> {
// Remove undefined values
const cleanData = { ...data };
for (const key in cleanData) {
if (cleanData[key] === undefined) {
delete cleanData[key];
}
}
const baseURL = `${process.env.FASTGPT_ENDPOINT}/api`;
let fullUrl = `${baseURL}${url}`;
// Default timeout from config or 600 seconds
const timeout = config.timeout || 600000;
const options: RequestInit = {
method,
headers: {
'content-type': 'application/json',
...config.headers
},
signal: AbortSignal.timeout(timeout)
};
// Handle request body and query parameters
if (['POST', 'PUT', 'PATCH'].includes(method)) {
if (Object.keys(cleanData).length > 0) {
options.body = JSON.stringify(cleanData);
}
} else if (Object.keys(cleanData).length > 0) {
const queryString = buildQueryString(cleanData);
if (queryString) {
fullUrl += `?${queryString}`;
}
}
try {
const response = await fetch(fullUrl, options);
// Handle non-2xx responses
if (!response.ok) {
let errorData;
try {
errorData = await response.json();
} catch {
errorData = {
code: response.status,
message: response.statusText || `HTTP ${response.status}`,
data: null
};
}
throw errorData;
}
// Parse response
let result;
const contentType = response.headers.get('content-type');
if (contentType && contentType.includes('application/json')) {
result = await response.json();
} else {
// Handle non-JSON responses
const text = await response.text();
try {
result = JSON.parse(text);
} catch {
// If it's not JSON, wrap it in the expected format
result = {
code: response.status,
message: 'success',
data: text
};
}
}
return checkRes(result);
} catch (err) {
return responseError(err);
}
}
/**
* GET 请求
* @param {String} url - 请求路径
* @param {Object} params - 查询参数
* @param {Object} config - 请求配置
* @returns {Promise<T>}
*/
export function GET<T = undefined>(url: string, params = {}, config: ConfigType = {}): Promise<T> {
return request(url, params, config, 'GET');
}
/**
* POST 请求
* @param {String} url - 请求路径
* @param {Object} data - 请求体数据
* @param {Object} config - 请求配置
* @returns {Promise<T>}
*/
export function POST<T = undefined>(url: string, data = {}, config: ConfigType = {}): Promise<T> {
return request(url, data, config, 'POST');
}
/**
* PUT 请求
* @param {String} url - 请求路径
* @param {Object} data - 请求体数据
* @param {Object} config - 请求配置
* @returns {Promise<T>}
*/
export function PUT<T = undefined>(url: string, data = {}, config: ConfigType = {}): Promise<T> {
return request(url, data, config, 'PUT');
}
/**
* DELETE 请求
* @param {String} url - 请求路径
* @param {Object} data - 请求体数据
* @param {Object} config - 请求配置
* @returns {Promise<T>}
*/
export function DELETE<T = undefined>(url: string, data = {}, config: ConfigType = {}): Promise<T> {
return request(url, data, config, 'DELETE');
}
/**
* PATCH 请求
* @param {String} url - 请求路径
* @param {Object} data - 请求体数据
* @param {Object} config - 请求配置
* @returns {Promise<T>}
*/
export function PATCH<T = undefined>(url: string, data = {}, config: ConfigType = {}): Promise<T> {
return request(url, data, config, 'PATCH');
}

View File

@@ -1,14 +1,14 @@
#!/usr/bin/env node
import './init.js';
import './init';
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
import express from 'express';
import { callTool, getTools } from './api/fastgpt.js';
import { addLog } from './utils/log.js';
import { getErrText } from './utils/error.js';
import { callTool, getTools } from './api/fastgpt';
import { addLog } from './utils/log';
import { getErrText } from '@fastgpt/global/common/error/utils';
const app = express();

View File

@@ -1,10 +0,0 @@
import { replaceSensitiveText } from './string.js';
export const getErrText = (err: any, def = ''): any => {
const msg: string =
typeof err === 'string'
? err
: err?.response?.data?.message || err?.response?.message || err?.message || def;
// msg && console.log('error =>', msg);
return replaceSensitiveText(msg);
};

View File

@@ -1,8 +0,0 @@
export const replaceSensitiveText = (text: string) => {
// 1. http link
text = text.replace(/(?<=https?:\/\/)[^\s]+/g, 'xxx');
// 2. nx-xxx 全部替换成xxx
text = text.replace(/ns-[\w-]+/g, 'xxx');
return text;
};

View File

@@ -1,9 +1,8 @@
{
"include": ["src"],
"exclude": ["node_modules"],
"extends": "../../tsconfig.json",
"compilerOptions": {
"target": "ES2022",
"module": "esnext",
"module": "ESNext",
"moduleResolution": "node",
"strict": true,
"esModuleInterop": true,