From ea059d5517461c3d30f2170120782e095b79af7c Mon Sep 17 00:00:00 2001 From: LiuVaayne <10231735+vaayne@users.noreply.github.com> Date: Sat, 5 Apr 2025 14:17:56 +0800 Subject: [PATCH] feat(mcp): add in-memory MCP server support and configuration management (#4359) --- .github/ISSUE_TEMPLATE/0_bug_report.yml | 4 +- .yarn/releases/yarn-4.6.0.cjs | Bin 2764946 -> 2764947 bytes README.md | 2 +- package.json | 6 + resources/cherry-studio/license.html | 221 +- resources/cherry-studio/releases.html | 332 +- .../integration/nutstore/sso/lib/index.d.ts | 8 +- .../integration/nutstore/sso/lib/index.js | 134464 ++++++++++++++- src/main/ipc.ts | 3 +- src/main/mcpServers/brave-search.ts | 374 + src/main/mcpServers/everything.ts | 588 + src/main/mcpServers/factory.ts | 36 + src/main/mcpServers/fetch.ts | 236 + src/main/mcpServers/filesystem.ts | 655 + src/main/mcpServers/memory.ts | 490 + src/main/mcpServers/sequentialthinking.ts | 289 + src/main/services/MCPService.ts | 20 +- src/main/utils/file.ts | 5 + src/renderer/index.html | 70 +- src/renderer/src/assets/styles/markdown.scss | 16 +- src/renderer/src/i18n/locales/en-us.json | 3 + src/renderer/src/i18n/locales/ja-jp.json | 3 + src/renderer/src/i18n/locales/ru-ru.json | 3 + src/renderer/src/i18n/locales/zh-cn.json | 3 + src/renderer/src/i18n/locales/zh-tw.json | 3 + .../pages/home/Inputbar/MCPToolsButton.tsx | 13 +- .../settings/MCPSettings/McpSettings.tsx | 41 +- .../src/pages/settings/MCPSettings/index.tsx | 8 + src/renderer/src/store/mcp.ts | 95 +- src/renderer/src/types/index.ts | 2 + src/renderer/src/utils/mcp-tools.ts | 20 - src/renderer/src/windows/menu/menu.html | 260 +- yarn.lock | 508 +- 33 files changed, 138249 insertions(+), 532 deletions(-) create mode 100644 src/main/mcpServers/brave-search.ts create mode 100644 src/main/mcpServers/everything.ts create mode 100644 src/main/mcpServers/factory.ts create mode 100644 src/main/mcpServers/fetch.ts create mode 100644 src/main/mcpServers/filesystem.ts create mode 100644 src/main/mcpServers/memory.ts create mode 100644 src/main/mcpServers/sequentialthinking.ts diff --git a/.github/ISSUE_TEMPLATE/0_bug_report.yml b/.github/ISSUE_TEMPLATE/0_bug_report.yml index 6054aa2a21..006279bb5d 100644 --- a/.github/ISSUE_TEMPLATE/0_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/0_bug_report.yml @@ -6,8 +6,8 @@ body: - type: markdown attributes: value: | - Thank you for taking the time to fill out this bug report! - Before submitting this issue, please make sure that you have understood the [FAQ](https://docs.cherry-ai.com/question-contact/questions) and [Knowledge Science](https://docs.cherry-ai.com/question-contact/knowledge) + Thank you for taking the time to fill out this bug report! + Before submitting this issue, please make sure that you have understood the [FAQ](https://docs.cherry-ai.com/question-contact/questions) and [Knowledge Science](https://docs.cherry-ai.com/question-contact/knowledge) - type: checkboxes id: checklist diff --git a/.yarn/releases/yarn-4.6.0.cjs b/.yarn/releases/yarn-4.6.0.cjs index fe63e51e6b231ccc13ac85a60bb6cc78e06d1529..3e7773b1edc6a2f0ca7442aa700193f437015e25 100755 GIT binary patch delta 142 zcmWN=$q~U|0D#f?EwM!G1hH=kC-<)q_2lr~4NYi3K|0~hyyy2FUjGjQB@(0}RjEl` zB56odTGEzSI+93NdeWDH3}qx^naEU9naNxhlF3q5vX+f(WhZ+%$WcymmRt(Ce7N3k EKlTDCy8r+H delta 140 zcmWN=$q~T-06@`6Y_StT>_M!j-1GZTkHfzkn$UoPbi$i?ukSl}{y)k)5=bZ&sY*@i z(vV1+(vr4xq$@q?%Rq(_%SaL#%S5J<%1q|6kfp3-EgQ*XD?8asE(bZvNzQWlaJ>~j D*oP^q diff --git a/README.md b/README.md index 5335146c9c..bcb34205a8 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ https://docs.cherry-ai.com # 🌈 Theme -- Theme Gallery: https://cherrycss.com +- Theme Gallery: https://cherrycss.com - Aero Theme: https://github.com/hakadao/CherryStudio-Aero - PaperMaterial Theme: https://github.com/rainoffallingstar/CherryStudio-PaperMaterial diff --git a/package.json b/package.json index c4a683230a..e0f9353cb1 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,7 @@ "@types/react-infinite-scroll-component": "^5.0.0", "@xyflow/react": "^12.4.4", "adm-zip": "^0.5.16", + "diff": "^7.0.0", "docx": "^9.0.2", "electron-log": "^5.1.5", "electron-store": "^8.2.0", @@ -79,10 +80,14 @@ "fast-xml-parser": "^5.0.9", "fetch-socks": "^1.3.2", "fs-extra": "^11.2.0", + "got-scraping": "^4.1.1", + "jsdom": "^26.0.0", "markdown-it": "^14.1.0", "officeparser": "^4.1.1", "proxy-agent": "^6.5.0", "tar": "^7.4.3", + "turndown": "^7.2.0", + "turndown-plugin-gfm": "^1.0.2", "undici": "^7.4.0", "webdav": "^5.8.0", "zipread": "^1.3.3" @@ -109,6 +114,7 @@ "@tavily/core": "patch:@tavily/core@npm%3A0.3.1#~/.yarn/patches/@tavily-core-npm-0.3.1-fe69bf2bea.patch", "@tryfabric/martian": "^1.2.4", "@types/adm-zip": "^0", + "@types/diff": "^7", "@types/fs-extra": "^11", "@types/lodash": "^4.17.5", "@types/markdown-it": "^14", diff --git a/resources/cherry-studio/license.html b/resources/cherry-studio/license.html index 3cf4361262..38df70a9f7 100644 --- a/resources/cherry-studio/license.html +++ b/resources/cherry-studio/license.html @@ -1,118 +1,111 @@ +
+ + +- 本软件采用 Apache License 2.0 许可。除 Apache License 2.0 规定的条款外,您在使用 Cherry - Studio 时还应遵守以下附加条款: -
-如有任何问题或需申请商业授权,请联系 Cherry Studio 开发团队。
-- 除上述特定条件外,其他所有权利和限制均遵循 Apache License 2.0。有关 Apache License 2.0 的详细信息,请访问 - http://www.apache.org/licenses/LICENSE-2.0 -
+ ++ 本软件采用 Apache License 2.0 许可。除 Apache License 2.0 规定的条款外,您在使用 Cherry + Studio 时还应遵守以下附加条款: +
+如有任何问题或需申请商业授权,请联系 Cherry Studio 开发团队。
++ 除上述特定条件外,其他所有权利和限制均遵循 Apache License 2.0。有关 Apache License 2.0 的详细信息,请访问 + http://www.apache.org/licenses/LICENSE-2.0 +
++ This software is licensed under the Apache License 2.0. In addition to the terms of the + Apache License 2.0, the following additional terms apply to the use of Cherry Studio: +
++ For any questions or to request a commercial license, please contact the Cherry Studio development team. +
++ Apart from the specific conditions mentioned above, all other rights and restrictions follow the Apache + License 2.0. Detailed information about the Apache License 2.0 can be found at + http://www.apache.org/licenses/LICENSE-2.0 +
+- This software is licensed under the Apache License 2.0. In addition to the terms of the - Apache License 2.0, the following additional terms apply to the use of Cherry Studio: -
-- For any questions or to request a commercial license, please contact the Cherry Studio development team. -
-- Apart from the specific conditions mentioned above, all other rights and restrictions follow the Apache - License 2.0. Detailed information about the Apache License 2.0 can be found at - http://www.apache.org/licenses/LICENSE-2.0 -
-