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

玩转 MCP 黄金组合拳

[复制链接]
链载Ai 显示全部楼层 发表于 2 小时前 |阅读模式 打印 上一主题 下一主题
MCP作为 AI 大模型的标准化工具箱,类似于 “通用语言” 或 “万能插座”,能够帮助大模型访问和操作外部工具,完成具体任务。如果我们能够灵活运用其中的多个MCP去解决一些任务,可能会达到事半功倍的效果。

ingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: white;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;line-height: 1.7;">

ingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: white;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;font-size: 20px;border-left: 4px solid rgb(30, 136, 229);border-radius: 0px 4px 4px 0px;color: rgb(30, 136, 229);font-weight: bold;box-shadow: rgba(0, 0, 0, 0.03) 0px 1px 3px;">sequential-thinking 和 tavily

ingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: white;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;line-height: 1.7;">可能很多人都没听过sequential-thinking这个MCP服务,它能够让普通模型也能思考,而且不是一般的思考,它的最大价值在于,支持复杂问题的分步拆解、动态调整、分支推演和多方协作,适用于任何需要系统性思考、流程优化和创新探索的领域。其分支与反思机制,尤其适合面对不确定性高、路径多变、协作复杂的实际场景。

ingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: white;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;line-height: 1.7;">tavily是一个为大型语言模型(LLMs)和检索增强生成(RAG)优化的搜索引擎,旨在提供高效、快速且持久的搜索结果,而且每月1000次免费额度使用

ingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: white;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;border-left: 4px solid rgb(7, 193, 96);color: rgb(102, 102, 102);">

可到官网获取 API KEY 。https://app.tavily.com/


ingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: white;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;font-size: 18px;border-left: 3px solid rgb(156, 39, 176);border-radius: 0px 3px 3px 0px;color: rgb(156, 39, 176);font-weight: bold;">配置 MCP 服务器

ingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: white;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;line-height: 1.7;">配置sequential-thinking,如下图所示

配置tavily,如下图所示

ingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: white;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;font-size: 18px;border-left: 3px solid rgb(156, 39, 176);border-radius: 0px 3px 3px 0px;color: rgb(156, 39, 176);font-weight: bold;">测试效果

ingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: white;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;line-height: 1.7;">我们选择使用Gemini 2.5 Flash模型,然后配合上面添加的sequential-thinkingtavily,让它们帮我分析一下 "广东男篮在最新的CBA季后赛为什么表现不好" 的原因

ingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;font-size: 16px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: start;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: white;text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;line-height: 1.7;">从上图可以看到,模型先进行了一次sequential-thinking,然后就开始调用tavily进行搜索,最后又连续调用了三次的sequential-thinking,接着最终给到了我们分析的结果

从上图可以看到,sequential-thinking进行了问题的分步拆解,然后再进行总结分析

总结

凡是用 Workflow 的地方,都适合用 SequentialThinking。只要一个任务有 Workflow,我们都可以让 SequentialThinking 来分步拆解、规划、执行

它还能够配合很多不同的MCP,实现更加强大的工能。例如使用Sequential Thinking+Software Planning Tool,分别扮演项目经理和技术经理的角色,然后帮你生成完美的软件开发计划等等


markitdown 和 filesystem

markitdown其实是后台使用微软的MarkItdown库,它支持多种格式转换为markdown格式,例如常见的 Microsoft Office 文档(Word,PowerPoint,Excel)

不过它需要服务器托管一个 RESTful API,所以要使用这个MCP的话,我们需要额外先安装它

具体的安装方式可以参考官网的说明
https://github.com/Klavis-AI/klavis/tree/main/mcp_servers/markitdown

filesystem是一个允许工具去操作本地目录文件的MCP,使用起来也比较简单

配置 MCP 服务器

配置Markitdown,我们需要先启动 API 服务,我这边是使用conda虚拟环境来安装运行服务,端口是3003,这些信息稍后配置需要用到

Cherry Studio中的配置,如下图所示
配置filesystem需要填入一些允许访问的本地目录,如下图所示

测试效果

我们尝试将本地的PDF文件,转为markdown格式,并让模型进行总结

找来的是图灵奖得主Richard S. Sutton 苦涩的教训(the bitter lesson),这个 PDF 文件只有两页,如上图所示
开始前记得先勾选使用的MCP服务,然后就可以开始执行了
转换完成后,就可以看到Downloads目录下多了一个bitter_lesson.md文件,打开看一下效果
或者我们可以直接让它做一些总结


回复

使用道具 举报

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

本版积分规则

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

  • 微信公众号

  • 商务合作

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