返回顶部
热门问答 更多热门问答
技术文章 更多技术文章

Cherry Studio MCP Server验证-本地文件系统 访问本地数据库配置

[复制链接]
链载Ai 显示全部楼层 发表于 5 小时前 |阅读模式 打印 上一主题 下一主题

今天接着记录下对Cherry Studio工具来配置MCP Server的简单验证。对于Cherry Studio我在前面专门写过文章说明。简单理解它其实是一个可以适配底层多种大模型的外壳。
在腾讯ima没有出来前,如果你不想本地部署类似DeepSeek,那么通过CherryStudio提供的知识库管理功能来搭建个人AI智能知识库是一个不错的选择。而现在可以看到Cherry Studio也完成支持对MCP Server的配置,其实现思路实际和我上篇文章谈到的Claude Desktop类似。
但是Cherry Studio可以选择支持MCP协议的所有大模型。类似今天的演示更多的使用的是阿里QWen2.5-7B和QWen/QWQ-32B两个支持MCP协议的模型进行测试。
当然,对于Cherry Studio的MCP服务器配置,可以详细参考官网提供的一个在线使用教程,具体地址:
https://docs.cherry-ai.com/advanced-basic/mcp-1
首先通过设置-》MCP服务器,可以进入到详细设置界面。
注意在这个界面,我们既可以点击编辑Json文件直接对MCP服务器配置文件进行修改,也可以点击添加服务器按钮进行服务器的添加。
比如一个最简单的Fetch网页的MCP Server配置:
在添加完成后我们进入到对话界面。注意在大模型选择的时候我们需要选择支持MCP协议的大模型,同时将MCP Server状态打开。
比如我们让AI帮我总结百家号一篇标题为:快餐界「爱马仕」,被中产抛弃?的文章的内容。具体如下:
从图中可以清楚地看到调用了Fetch进行网页数据的获取。
同样对于文件服务的配置也很简单,见红框。
进一步验证,让其列出我桌面所有文件如下:
最后再测试和验证下Sqlite数据库的配置。同样的道理,需要提前做下面的安装和准备工作。

ingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">sqlite数据库需要的内容

ingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">访问https://github.com/modelcontextprotocol/servers下载代码。

ingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">代码解压缩放到本地目录

ingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">Sqlite的MCP Server配置如下地方进行替换

ingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">\\servers-main\\src\\sqlite

ingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">接着安装uv,运行如下命令:

pipinstalluvpipinstallhttpxmcp

ingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 17px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: 0.544px;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">注意在所有的准备工作做完后,进入到MCP服务器配置。重点是参数这个地方容易填错,具体参数如下:

--directory你自己的目录地址\sqliterunmcp-server-sqlite--db-path你自己的目录地址\scm.db

具体界面截图如下:

在这里要注意,点击确定的时候系统会自动进行检查。如果有异常最方便的检查方式就是先在命令行按截图中的参数运行 uv 命令。如果命令行运行没有问题,那么这个地方配置基本上没有问题。

配置好后还是做下简单测试如下:

在测试和验证过程中7B模型正常输出,我反而是在测试QWQ-32B的深度思考模式的时候,发现对于简单问题复杂化,并且循环思考的问题。而且深度思考时间也很长。

至少从简单的测试验证来看,还是上篇文章采用Claude 3.7大模型的时候配合Sqlite MCP Server往往对于自然语言查询的语义理解最准确。

对于自己编写python存放到本地目录并运行,还需要安装一个能够执行本地脚本或python文件的MCP Server,具体地址:

https://github.com/g0t4/mcp-server-commands

关键配置信息如下:

"mcp-server-commands":{"command":"npx","args":["mcp-server-commands"]},

由于Cherry Studio本身还可以接本地部署的大模型,因此如果企业开展MCP适配和接入方面的测试和验证,选择Cherry Studio是一个不错的选择。基于上一篇文章同样的思路,我们完全可以把企业已有的API能力作为MCP Server开放接入,把类似数据中台经过清洗后端的共享数据库作为MCP Server源接入。

当然实际查询的准确度如何还需要进一步验证。今天的简单分享就到这里,希望对大家有所启发。

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

链载AI是专业的生成式人工智能教程平台。提供Stable Diffusion、Midjourney AI绘画教程,Suno AI音乐生成指南,以及Runway、Pika等AI视频制作与动画生成实战案例。从提示词编写到参数调整,手把手助您从入门到精通。
  • 官方手机版

  • 微信公众号

  • 商务合作

  • Powered by Discuz! X3.5 | Copyright © 2025-2025. | 链载Ai
  • 桂ICP备2024021734号 | 营业执照 | |广西笔趣文化传媒有限公司|| QQ