
一、前言
說實話,當我看到使用 MCP 服務還需要手動複製貼上 JSON 的時候,包括現在很多 MCP 服務只有工具,沒有資源和提示時,我認為 MCP 還不太成熟。
隨著今年“智慧體”的大爆發,使用工具的訴求越來越強烈。隨著 MCP 服務市場、MCP 自動配置功能的出現,MCP 的使用門檻正在降低,越來越多的服務宣佈支援 MCP 協議,開始要爆發的趨勢。
網上也有很多介紹 MCP 的文章,但很多文章要麼太理論化,動輒就上一堆 Python 程式碼,對於非開發者來說比較枯燥,要麼就是直接介紹 MCP 如何配置使用,太偏實踐,知其然,不知其所以然。
本文將先儘量用相對通俗的語言和圖形介紹基本的理論,然後以 ModelScope 的 MCP 市場,Cherry Studio 客戶端為例,為大家展示 MCP 的過程,讓大家更加有體感,更好地理解和掌握 MCP ,最後分享一點資料和觀點。
二、理論基礎
RAG 是為了讓大模型獲取足夠的上下文,Function Calling 是為了讓模型使用工具,他們和 MCP 有或多或少的聯絡,因此,接下來,我先介紹前面兩個概念再介紹 MCP。
2.1 先看 RAG
RAG(Retrieval Augmented Generation ,檢索增強生成),我們不需要訓練和微調大模型,只需要提供和使用者提問相關的額外的資訊到提示詞中,從而可以獲得更高質量的回答。

圖片來源:https://www.dailydoseofds.com/16-techniques-to-supercharge-and-build-real-world-rag-systems-part-1/
通常,需要將資料透過嵌入模型生成服務轉化為向量,然後儲存到向量資料庫中。
當用戶提問時,將使用者的問題向量化從向量資料庫中進行相似度匹配出 TOP N 個片段,拼接成新的提示詞傳送給大模型,大模型就可以結合你的資料更好地回答問題了。
當然, RAG 還有很多變種,如Agentic RAG 、Modular RAG、Graph RAG 等多種高階形式,這裡就不展了。
2.2 再看 Function Calling
Function Calling(函式呼叫) 是一種允許大型語言模型(LLM)根據使用者輸入識別它需要的工具並決定何時呼叫該工具的機制。

圖片來源:ailydoseofds
基本工作原理如下:LLM 接收使用者的提示詞,LLM 決定它需要的工具,執行方法呼叫,後端服務執行實際的請求給出處理結果,大語言模型根據處理結果生成最終給使用者的回答。
不同的 API 需要封裝成不同的方法,通常需要編寫程式碼,很難在不同的平臺靈活複用。
參見百鍊函式呼叫文件:https://help.aliyun.com/zh/model-studio/tool-calling-overview/
2.3 來看 MCP
模型上下文協議(Model Context Protocol,簡稱MCP)是一個由 Anthropic 在 2024 年 11 月 25 日開源的新標準。MCP 是一個開放標準,旨在連線AI助手與資料所在的系統,包括內容儲存庫、業務工具和開發環境。其目標是幫助前沿模型產生更好、更相關的響應。

圖片來源:https://zhuanlan.zhihu.com/p/598749792
MCP 可以看作是 AI 應用程式的 "USB-C埠"。就像 USB-C 為連線裝置與各種外設提供了標準化方式,MCP為 AI 模型連線不同資料來源和工具提供了標準化方法。

圖片來源:ailydoseofds
2.3.1 MCP 的核心
從技術角度看,MCP 遵循客戶端-伺服器架構,其中主機應用可以連線到多個伺服器。
MCP 有三個關鍵元件:
-
主機(Host) -
客戶端(Client) -
伺服器(Server)
2.3.2 元件詳解
-
主機:代表任何提供 AI 互動環境的應用程式(如 Claude 桌面版、Cursor),它能訪問工具和資料,並執行 MCP 客戶端。
-
MCP 客戶端:在主機內執行,使其能與 MCP 伺服器通訊。
-
MCP 伺服器:暴露特定功能並提供資料訪問,例如:
-
工具:使 LLM 能透過伺服器執行操作 -
資源:向 LLM 公開伺服器中的資料和內容 -
提示:建立可重用的提示模板和工作流
2.3.3 MCP 相比傳統 API 的優勢
傳統 API :

圖片來源:ailydoseofds
-
如果 API 最初需要兩個引數(例如天氣服務的位置和日期),使用者整合應用程式會發送帶有這些確切引數的請求。
圖片來源:ailydoseofds
-
如果後來新增第三個必需引數(例如溫度單位,如攝氏度或華氏度),API的合約就會改變。 -
這意味著所有 API 使用者必須更新程式碼以包含新引數。如果不更新,請求可能失敗、返回錯誤或提供不完整結果。
MCP 的設計解決了這個問題:
-
MCP 引入了與傳統 API 截然不同的動態靈活方法。 -
當客戶端(如 Claude 桌面版)連線到 MCP 伺服器(如您的天氣服務)時,它傳送初始請求以瞭解伺服器的能力。
圖片來源:ailydoseofds
-
伺服器響應其可用工具、資源、提示和引數的詳細資訊。例如,如果您的天氣 API 最初支援位置和日期,伺服器會將這些作為其功能的一部分進行通訊。
圖片來源:ailydoseofds
-
如果您稍後新增單位引數,MCP 伺服器可以在下一次交換期間動態更新其功能描述。客戶端不需要硬編碼或預定義引數—只需查詢伺服器的當前功能並相應地適應。 -
這樣,客戶端可以及時調整其行為,使用更新的功能(例如在請求中包含單位),無需重寫或重新部署程式碼。

圖源:https://www.latent.space/p/why-mcp-won
其實,MCP 也是用了 “中間層”的思想,讓大模型使用工具標準化,讓大模型呼叫工具更方便,煥發出新的生機。
2.3.4 MCP 的過程

圖片來源:ailydoseofds
首先需要在主機上自動或手動配置 MCP 服務,當用戶輸入問題時, MCP 客戶端讓 大語言模型選擇 MCP 工具,大模型選擇好 MCP 工具以後, MCP 客戶端尋求使用者同意(很多產品支援配置自動同意),MCP 客戶端請求 MCP 伺服器, MCP 服務呼叫工具並將工具的結果返回給 MCP 客戶端, MCP 客戶端將模型呼叫結果和使用者的查詢傳送給大語言模型,大語言模型組織答案給使用者。
其實 RAG 、Function Call 和 MCP 本質上都是一樣,都是為了藉助外部工具幫助大模型完成更復雜的事情。
三、“看見” MCP 的過程
3.1 ModelScope

我們來到魔搭的 MCP 市場:https://modelscope.cn/mcp,這裡只是為了演示,其他的 MCP 廣場也是一樣的。

登入以後,我們選擇一個 MCP 服務,點選右側的“連線”按鈕,就可以 獲取 MCP服務的 SSE URL。
3.2 Cherry Studio
Cherry Studio 官網:https://cherry-ai.com/

在右上角點選開啟,就可以看到該 MCP 服務提供的工具、提示和資源。

可以單獨開啟和關閉每個可用的工具。

每個 MCP 服務手動配置太麻煩,大家也可以點選“同步伺服器”,配置 ModelScope 的 API 令牌,配置之後就可以一鍵同步 ModelScope 上開啟的 MCP 服務了。
3.3 開發者模式

輸入想要問的問題,開啟需要的 MCP 服務。
為了看見 MCP 的執行過程,我們還需要透過 Ctrl+Shift+I(Mac端:Command+Option+I)開啟開發者模式。

第一次請求,傳送系統提示詞,包括大模型可以選擇的工具和要求等,然後給出使用者的問題。

可以看到第二次呼叫,模型選擇使用 infoq 工具獲得資訊後組織語言展示給使用者。
index =0 的系統提示詞的內容:
{
"role": "system",
"content": "In this environment you have access to a set of tools you can use to answer the user's question. You can use one tool per message, and will receive the result of that tool use in the user's response. You use tools step-by-step to accomplish a given task, with each tool use informed by the result of the previous tool use.\n\n## Tool Use Formatting\n\nTool use is formatted using XML-style tags. The tool name is enclosed in opening and closing tags, and each parameter is similarly enclosed within its own set of tags. Here's the structure:\n\n<tool_use>\n <name>{tool_name}</name>\n <arguments>{json_arguments}</arguments>\n</tool_use>\n\nThe tool name should be the exact name of the tool you are using, and the arguments should be a JSON object containing the parameters required by that tool. For example:\n<tool_use>\n <name>python_interpreter</name>\n <arguments>{\"code\": \"5 + 3 + 1294.678\"}</arguments>\n</tool_use>\n\nThe user will respond with the result of the tool use, which should be formatted as follows:\n\n<tool_use_result>\n <name>{tool_name}</name>\n <result>{result}</result>\n</tool_use_result>\n\nThe result should be a string, which can represent a file or any other output type. You can use this result as input for the next action.\nFor example, if the result of the tool use is an image file, you can use it in the next action like this:\n\n<tool_use>\n <name>image_transformer</name>\n <arguments>{\"image\": \"image_1.jpg\"}</arguments>\n</tool_use>\n\nAlways adhere to this format for the tool use to ensure proper parsing and execution.\n\n## Tool Use Examples\n\nHere are a few examples using notional tools:\n---\nUser: Generate an image of the oldest person in this document.\n\nAssistant: I can use the document_qa tool to find out who the oldest person is in the document.\n<tool_use>\n <name>document_qa</name>\n <arguments>{\"document\": \"document.pdf\", \"question\": \"Who is the oldest person mentioned?\"}</arguments>\n</tool_use>\n\nUser: <tool_use_result>\n <name>document_qa</name>\n <result>John Doe, a 55 year old lumberjack living in Newfoundland.</result>\n</tool_use_result>\n\nAssistant: I can use the image_generator tool to create a portrait of John Doe.\n<tool_use>\n <name>image_generator</name>\n <arguments>{\"prompt\": \"A portrait of John Doe, a 55-year-old man living in Canada.\"}</arguments>\n</tool_use>\n\nUser: <tool_use_result>\n <name>image_generator</name>\n <result>image.png</result>\n</tool_use_result>\n\nAssistant: the image is generated as image.png\n\n---\nUser: \"What is the result of the following operation: 5 + 3 + 1294.678?\"\n\nAssistant: I can use the python_interpreter tool to calculate the result of the operation.\n<tool_use>\n <name>python_interpreter</name>\n <arguments>{\"code\": \"5 + 3 + 1294.678\"}</arguments>\n</tool_use>\n\nUser: <tool_use_result>\n <name>python_interpreter</name>\n <result>1302.678</result>\n</tool_use_result>\n\nAssistant: The result of the operation is 1302.678.\n\n---\nUser: \"Which city has the highest population , Guangzhou or Shanghai?\"\n\nAssistant: I can use the search tool to find the population of Guangzhou.\n<tool_use>\n <name>search</name>\n <arguments>{\"query\": \"Population Guangzhou\"}</arguments>\n</tool_use>\n\nUser: <tool_use_result>\n <name>search</name>\n <result>Guangzhou has a population of 15 million inhabitants as of 2021.</result>\n</tool_use_result>\n\nAssistant: I can use the search tool to find the population of Shanghai.\n<tool_use>\n <name>search</name>\n <arguments>{\"query\": \"Population Shanghai\"}</arguments>\n</tool_use>\n\nUser: <tool_use_result>\n <name>search</name>\n <result>26 million (2019)</result>\n</tool_use_result>\nAssistant: The population of Shanghai is 26 million, while Guangzhou has a population of 15 million. Therefore, Shanghai has the highest population.\n\n\n## Tool Use Available Tools\nAbove example were using notional tools that might not exist for you. You only have access to these tools:\n<tools>\n\n<tool>\n <name>f_u-LsDUyQWsNFAUjL-_Vi</name>\n <description>獲取 36 氪熱榜,提供創業、商業、科技領域的熱門資訊,包含投融資動態、新興產業分析和商業模式創新資訊</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{\"type\":{\"anyOf\":[{\"type\":\"string\",\"const\":\"hot\",\"description\":\"人氣榜\"},{\"type\":\"string\",\"const\":\"video\",\"description\":\"影片榜\"},{\"type\":\"string\",\"const\":\"comment\",\"description\":\"熱議榜\"},{\"type\":\"string\",\"const\":\"collect\",\"description\":\"收藏榜\"}],\"default\":\"hot\",\"description\":\"分類\"}},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>fyQ3DOUpLJDGPLCjslT6P1</name>\n <description>獲取 9to5Mac 蘋果相關新聞,包含蘋果產品釋出、iOS 更新、Mac 硬體、應用推薦及蘋果公司動態的英文資訊</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>fBOukVLVbqIh69earzcYca</name>\n <description>獲取 BBC 新聞,提供全球新聞、英國新聞、商業、政治、健康、教育、科技、娛樂等資訊</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{\"category\":{\"anyOf\":[{\"type\":\"string\",\"const\":\"\",\"description\":\"熱門新聞\"},{\"type\":\"string\",\"const\":\"world\",\"description\":\"國際\"},{\"type\":\"string\",\"const\":\"uk\",\"description\":\"英國\"},{\"type\":\"string\",\"const\":\"business\",\"description\":\"商業\"},{\"type\":\"string\",\"const\":\"politics\",\"description\":\"政治\"},{\"type\":\"string\",\"const\":\"health\",\"description\":\"健康\"},{\"type\":\"string\",\"const\":\"education\",\"description\":\"教育\"},{\"type\":\"string\",\"const\":\"science_and_environment\",\"description\":\"科學與環境\"},{\"type\":\"string\",\"const\":\"technology\",\"description\":\"科技\"},{\"type\":\"string\",\"const\":\"entertainment_and_arts\",\"description\":\"娛樂與藝術\"}],\"default\":\"\"},\"edition\":{\"anyOf\":[{\"type\":\"string\",\"const\":\"\"},{\"type\":\"string\",\"const\":\"uk\",\"description\":\"UK\"},{\"type\":\"string\",\"const\":\"us\",\"description\":\"US & Canada\"},{\"type\":\"string\",\"const\":\"int\",\"description\":\"Rest of the world\"}],\"default\":\"\",\"description\":\"版本,僅對 `category` 為空有效\"}},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>fTU2iCLtmsEWljy_HbEhCa</name>\n <description>獲取嗶哩嗶哩影片排行榜,包含全站、動畫、音樂、遊戲等多個分割槽的熱門影片,反映當下年輕人的內容消費趨勢</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{\"type\":{\"anyOf\":[{\"type\":\"number\",\"const\":0,\"description\":\"全站\"},{\"type\":\"number\",\"const\":1,\"description\":\"動畫\"},{\"type\":\"number\",\"const\":3,\"description\":\"音樂\"},{\"type\":\"number\",\"const\":4,\"description\":\"遊戲\"},{\"type\":\"number\",\"const\":5,\"description\":\"娛樂\"},{\"type\":\"number\",\"const\":188,\"description\":\"科技\"},{\"type\":\"number\",\"const\":119,\"description\":\"鬼畜\"},{\"type\":\"number\",\"const\":129,\"description\":\"舞蹈\"},{\"type\":\"number\",\"const\":155,\"description\":\"時尚\"},{\"type\":\"number\",\"const\":160,\"description\":\"生活\"},{\"type\":\"number\",\"const\":168,\"description\":\"國創相關\"},{\"type\":\"number\",\"const\":181,\"description\":\"影視\"}],\"default\":0,\"description\":\"排行榜分割槽\"}},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>f_OULD1Qnu5wPblKHFTzYw</name>\n <description>獲取豆瓣即時熱門榜單,提供當前熱門的圖書、電影、電視劇、綜藝等作品資訊,包含評分和熱度資料</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{\"type\":{\"anyOf\":[{\"type\":\"string\",\"const\":\"subject\",\"description\":\"圖書、電影、電視劇、綜藝等\"},{\"type\":\"string\",\"const\":\"movie\",\"description\":\"電影\"},{\"type\":\"string\",\"const\":\"tv\",\"description\":\"電視劇\"}],\"default\":\"subject\"},\"start\":{\"type\":\"integer\",\"default\":0},\"count\":{\"type\":\"integer\",\"default\":10}},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>fL5c-CwZ3bUckaatY_MC8Z</name>\n <description>獲取抖音熱搜榜單,展示當下最熱門的社會話題、娛樂事件、網路熱點和流行趨勢</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>flPxhdB8Wyw8DDuban0pMa</name>\n <description>獲取機核網遊戲相關資訊,包含電子遊戲評測、玩家文化、遊戲開發和遊戲周邊產品的深度內容</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>fdj1bDLATGns6ZdclA68UF</name>\n <description>獲取愛範兒科技快訊,包含最新的科技產品、數碼裝置、網際網路動態等前沿科技資訊</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{\"limit\":{\"type\":\"integer\",\"default\":20},\"offset\":{\"type\":\"integer\",\"default\":0}},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>f0Uk75Pbfsx0rfdD725CYI</name>\n <description>獲取 InfoQ 技術資訊,包含軟體開發、架構設計、雲計算、AI等企業級技術內容和前沿開發者動態</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{\"region\":{\"type\":\"string\",\"enum\":[\"cn\",\"global\"],\"default\":\"cn\"}},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>fu70DSpIpWTVlq11tEKJZd</name>\n <description>獲取掘金文章榜,包含前端開發、後端技術、人工智慧、移動開發及技術架構等領域的高質量中文技術文章和教程</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{\"category_id\":{\"anyOf\":[{\"type\":\"string\",\"const\":\"6809637769959178254\",\"description\":\"後端\"},{\"type\":\"string\",\"const\":\"6809637767543259144\",\"description\":\"前端\"},{\"type\":\"string\",\"const\":\"6809635626879549454\",\"description\":\"Android\"},{\"type\":\"string\",\"const\":\"6809635626661445640\",\"description\":\"iOS\"},{\"type\":\"string\",\"const\":\"6809637773935378440\",\"description\":\"人工智慧\"},{\"type\":\"string\",\"const\":\"6809637771511070734\",\"description\":\"開發工具\"},{\"type\":\"string\",\"const\":\"6809637776263217160\",\"description\":\"程式碼人生\"},{\"type\":\"string\",\"const\":\"6809637772874219534\",\"description\":\"閱讀\"}],\"default\":\"6809637769959178254\"}},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>fZMjSXkog94GRA7VoZpJtw</name>\n <description>獲取網易新聞熱點榜,包含時政要聞、社會事件、財經資訊、科技動態及娛樂體育的全方位中文新聞資訊</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>f5s3U6zXATp3L6wpAwNcn4</name>\n <description>獲取紐約時報新聞,包含國際政治、經濟金融、社會文化、科學技術及藝術評論的高質量英文或中文國際新聞資訊</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{\"region\":{\"anyOf\":[{\"type\":\"string\",\"const\":\"cn\",\"description\":\"中文\"},{\"type\":\"string\",\"const\":\"global\",\"description\":\"全球\"}],\"default\":\"cn\"},\"section\":{\"type\":\"string\",\"default\":\"HomePage\",\"description\":\"分類,當 `region` 為 `cn` 時無效。可選值: Africa, Americas, ArtandDesign, Arts, AsiaPacific, Automobiles, Baseball, Books/Review, Business, Climate, CollegeBasketball, CollegeFootball, Dance, Dealbook, DiningandWine, Economy, Education, EnergyEnvironment, Europe, FashionandStyle, Golf, Health, Hockey, HomePage, Jobs, Lens, MediaandAdvertising, MiddleEast, MostEmailed, MostShared, MostViewed, Movies, Music, NYRegion, Obituaries, PersonalTech, Politics, ProBasketball, ProFootball, RealEstate, Science, SmallBusiness, Soccer, Space, Sports, SundayBookReview, Sunday-Review, Technology, Television, Tennis, Theater, TMagazine, Travel, Upshot, US, Weddings, Well, World, YourMoney\"}},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>fSodMRu-GB5-mpBxBvxc2D</name>\n <description>獲取什麼值得買熱門,包含商品推薦、優惠資訊、購物攻略、產品評測及消費經驗分享的實用中文消費類資訊</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{\"unit\":{\"anyOf\":[{\"type\":\"number\",\"const\":1,\"description\":\"今日熱門\"},{\"type\":\"number\",\"const\":7,\"description\":\"周熱門\"},{\"type\":\"number\",\"const\":30,\"description\":\"月熱門\"}],\"default\":1}},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>fnY78eScFYQ-6xtUUQg8fB</name>\n <description>獲取少數派熱榜,包含數碼產品評測、軟體應用推薦、生活方式指南及效率工作技巧的優質中文科技生活類內容</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{\"tag\":{\"type\":\"string\",\"enum\":[\"熱門文章\",\"應用推薦\",\"生活方式\",\"效率技巧\",\"少數派播客\"],\"default\":\"熱門文章\",\"description\":\"分類\"},\"limit\":{\"type\":\"integer\",\"default\":40}},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>fFlnyuBJfPLifqYRkW94Lh</name>\n <description>獲取騰訊新聞熱點榜,包含國內外時事、社會熱點、財經資訊、娛樂動態及體育賽事的綜合性中文新聞資訊</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{\"page_size\":{\"type\":\"integer\",\"default\":20}},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>f0YfISsRrFbNGGwO3XVCFY</name>\n <description>獲取澎湃新聞熱榜,包含時政要聞、財經動態、社會事件、文化教育及深度報道的高質量中文新聞資訊</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>fIKw7RiYt2oAptPSBtelf-</name>\n <description>獲取 The Verge 新聞,包含科技創新、數碼產品評測、網際網路趨勢及科技公司動態的英文科技資訊</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>fH1Xj1bmY_qWxS6b8BoSCK</name>\n <description>獲取今日頭條熱榜,包含時政要聞、社會事件、國際新聞、科技發展及娛樂八卦等多領域的熱門中文資訊</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>fIoNHXnzDif1o8sJSRpVBu</name>\n <description>獲取微博熱搜榜,包含時事熱點、社會現象、娛樂新聞、明星動態及網路熱議話題的即時熱門中文資訊</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>fX_nTem-9mBD-9Th_ZVRdA</name>\n <description>獲取微信讀書排行榜,包含熱門小說、暢銷書籍、新書推薦及各類文學作品的閱讀資料和排名資訊</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{\"category\":{\"anyOf\":[{\"type\":\"string\",\"const\":\"rising\",\"description\":\"飆升榜\"},{\"type\":\"string\",\"const\":\"hot_search\",\"description\":\"熱搜榜\"},{\"type\":\"string\",\"const\":\"newbook\",\"description\":\"新書榜\"},{\"type\":\"string\",\"const\":\"general_novel_rising\",\"description\":\"小說榜\"},{\"type\":\"string\",\"const\":\"all\",\"description\":\"總榜\"}],\"default\":\"rising\",\"description\":\"排行榜分割槽\"}},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n\n<tool>\n <name>fzIq8ORLIZHJLRU6pJt3O5</name>\n <description>獲取知乎熱榜,包含時事熱點、社會話題、科技動態、娛樂八卦等多領域的熱門問答和討論的中文資訊</description>\n <arguments>\n {\"type\":\"object\",\"properties\":{\"limit\":{\"type\":\"number\",\"default\":50}},\"additionalProperties\":false,\"$schema\":\"http://json-schema.org/draft-07/schema#\"}\n </arguments>\n</tool>\n\n</tools>\n\n## Tool Use Rules\nHere are the rules you should always follow to solve your task:\n1. Always use the right arguments for the tools. Never use variable names as the action arguments, use the value instead.\n2. Call a tool only when needed: do not call the search agent if you do not need information, try to solve the task yourself.\n3. If no tool call is needed, just answer the question directly.\n4. Never re-do a tool call that you previously did with the exact same parameters.\n5. For tool use, MARK SURE use XML tag format as shown in the examples above. Do not use any other format.\n\n# User Instructions\n\n\nNow Begin! If you solve the task correctly, you will receive a reward of $1,000,000.\n"
}
主要包括:
-
工具使用格式 – 使用XML風格的標籤來呼叫工具,包括工具名稱和JSON格式的引數; -
工具使用示例 – 展示瞭如何使用各種假設工具的例子,如文件問答、影像生成、Python直譯器等; -
可用工具列表 – 提供了多個實際可用的資訊獲取工具,主要是各種中英文新聞和內容平臺的熱門榜單; -
工具使用規則 – 強調了正確使用引數、僅在需要時呼叫工具、不重複呼叫等規則; -
最後,提示詞以一個有趣的激勵結束,表示如果任務正確完成,將獲得一百萬美元獎勵。
index =1 的使用者的內容
{
"role":"user",
"content":"幫我搜索 模型上下文協議 MCP 相關的最新技術文章"
}
index =2 的助手的內容
{
"role": "assistant",
"content": "為了找到關於模型上下文協議(MCP)的最新技術文章,我將使用一些可用的工具來搜尋相關資訊。首先,我可以從InfoQ開始,因為它經常釋出企業級技術內容和前沿開發者動態。\n\n<tool_use>\n <name>f0Uk75Pbfsx0rfdD725CYI</name>\n <arguments>{\"region\":\"global\"}</arguments>\n</tool_use>"
}
index =3 的 使用者的內容
{
"role": "user",
"content": [
{
"type": "text",
"text": "Here is the result of tool call f0Uk75Pbfsx0rfdD725CYI:"
},
{
"type": "text",
"text": "[{\"type\":\"text\",\"text\":\"<title>Docker Desktop 4.40 Introduces Model Runner to Run LLMs Locally Expanding its AI Capabilities</title>\\n<description> 省略其他}]"
}
]
}

第三次呼叫主要是為了給話題起標題。
大家,可以多開啟幾個工具或者多問幾次,結合理論部分的講解,會對 MCP 的過程會有更深刻的體會。
四、MCP 市場和 MCP 學習經驗
4.1 MCP 市場
MCP 市場有很多,國內常見的有 ModelScope 和 阿里雲百鍊。

ModelScope:https://modelscope.cn/mcp

百鍊 MCP 市場:https://bailian.console.aliyun.com/?tab=mcp#/mcp-market
4.2 MCP 學習技巧

大家還可以使用 Qwen (https://chat.qwen.ai)深入研究功能來系統學習 MCP。

我們感興趣可以 Clone Cherry Studio 的原始碼,使用通義靈碼、 Cursor 等 AI 程式設計工具,開啟倉庫:https://github.com/CherryHQ/cherry-studio直接對你關心的問題進行提問,學習效果更好。

大家還可以透過我們之前分享的“通俗講解專家智慧體”,先用生活化的例子快速 GET 到意思,然後專業講解,再給出易記的方法,最後透過 SVG 圖解的方式幫助我們更直觀理解知識。詳情參見:《我是如何基於 DeepSeek-R1 構建出高效學習Agent的?》
五、觀點
5.1 我發現的一些問題
問題1:MCP 服務的配置、開關通常需要手動操作,使用方式還不夠智慧。這有點和 ChatGPT 的外掛功能很相似,使用者需要手動選擇想要開啟的外掛,AI 還不能自動選擇。在大模型上下文和能力沒有完全解決之前, MCP 下一步應該需要支援場景化(劇本式)開啟和關閉,而不是全域性的手動開啟和關閉,開啟太多 Tokens消耗大,開啟太少可能影響功能的使用,某個場景在特定環節能夠用到的 MCP 是相對確定的,需要類似工作流編排的形式來解決。
問題2:如果開啟大量的 MCP 服務,客戶端如果第一次將所有工具資訊都發給大模型讓大模型來抉擇,會浪費大量 Tokens。未來這部分可能需要用本地模型來實現。
問題3:MCP 只是解決了協議的問題,工具的穩定性很重要,呼叫工具時服務不可用非常影響使用者體驗。應該有個工具可用性檢測機制,不可用時及時下線。
問題4:現在 MCP 服務的封裝主流還是前端框架和 Python,Java 來封裝 MCP 似乎不太方便或者說上手門檻略高,未來可能需要再增加一箇中間層來吃掉這個複雜度。
問題5:現在很多模型使用 MCP 的能力還不太強,有些場景哪怕適合呼叫某個 MCP 服務,有些模型也只會在需要明確告知使用 MCP 才會選擇使用 MCP。
5.2 關於 MCP 只是一種“過渡”的說法
很多人認為 MCP 只是一個過渡,因為目前 MCP 設計存在一些侷限性,而且,儘管 MCP 獲得了 OpenAI、Google 等大廠的支援,但其成為永久行業標準仍存在不確定性。
我認為,MCP 確實存在一些缺點,但,MCP 確實為大模型更好地呼叫工具提供了一個非常好的協議。大模型想要做更復雜發揮出更大價值必然要學會使用工具,模型上下文協議非常有必要,只是未必一定是 Anthropic 這個版本。
MCP 可能是一個過渡,但這不是問題。其實 RAG 也存在諸多問題,可能也是一個過渡。其實,從更大尺度來看,我們以前用的電話、功能機、現在用的這些傳統軟體都是一種過渡。人,總是有時代侷限性,比如我們手動擋的汽車和現在的自動駕駛沒法比,也是一種過渡,但不妨礙它能夠真正幫助到我們。
5.3 展望
當前,大模型現在還很難透過 MCP 實現人類一樣的操作。比如 PPT 製作、影片剪輯,大模型還不能透過 MCP 實現類似真正和人類一樣的智慧的 “RPA”操作。
隨著越來越多的服務支援 MCP,隨著模型的服務不斷增強,面向 MCP 的業務流程編排會或許成為主流。隨著 AI 使用工具的能力不斷增強,未來,能夠帶來的幫助也會更大。

圖源:https://www.dailydoseofds.com/p/a-visual-guide-to-agent2agent-a2a-protocol/
MCP 試圖在解決模型使用工具的問題(就像人可以使用扳手、可以開車、可以使用的電腦等)。但是,想要完成非常複雜的事情,智慧體之間必然需要協同(就像上下級之間的管理和執行,同事之間分工合作),智慧體之間的標準協議非常重要。谷歌最近釋出的 A2A 協議則試圖解決智慧體之間通訊的協議問題。正如上圖所示,兩者可以結合使用,MCP 使用者服務的註冊和發現, A2A 使用者智慧體之間的通訊。
AI 技術的發展比想象地要更快,正如 ChatGPT 剛出來時,很多人說它永遠不會取代我們,它的知識不會更新,現在 AI 搜尋、RAG 已經成為常態。
現在,模型雖然存在速度慢的問題,存在上下文長度限制問題,存在幻覺的問題,存在好用模型價格高的問題等,這些都將逐漸得到解決。 AI 將會更好地使用工具,Agent 也將更加智慧, Agent 之間的協同也將更加通暢。
關聯文章:《一行程式碼不用改!搞定 HSF 轉 MCP Server》
通義千問和LangChain搭建對話服務
結合通義千問和LangChain技術構建高效的對話模型,該模型基於自然語言處理技術提升語義理解和使用者互動體驗。
點選閱讀原文檢視詳情。