
纯 MATLAB 代码中的 MCP 客户端
概览
在 MATLABQQ 中创建 MCP 客户端, 在 LLM 工作流程中调用外部工具 模式上下文协议(MCP)是AI代理商与外部工具之间的交流框架. 一般情况下,一个大型语言模型(LLM)应用程序会设置一个或多个MCP客户端,每个客户端连接到一个MCP服务器. MCP服务器提供LLM应用程序可以使用的上下文和工具. 此添加允许您: - 创建 MCP 客户端连接到 MATLAB 可流的 HTTP 服务器 。 - 调用外部工具。 - 使用带有MATLAB加载的大语言模型的外部工具。 使用此加法需要MATLAB R2025a或更新. 要生成并执行 MATLAB 的工具调用,您还需要4. 6.0 版本或更新的大语言模型(LLMs),并添加 MATLAB. 建议在已安装的 MATLAB 版本中使用添加的方法是使用 Add-On Explorer. 1. 在MATLAB中,请到分页,在一节中点击图标。 2. 在添加-On 探索器中,搜索"MATLAB MCP HTTP客户端". 3个.
概述(AI 翻译)
在 MATLABQQ 中创建 MCP 客户端, 在 LLM 工作流程中调用外部工具
模式上下文协议(MCP)是AI代理商与外部工具之间的交流框架. 一般情况下,一个大型语言模型(LLM)应用程序会设置一个或多个MCP客户端,每个客户端连接到一个MCP服务器. MCP服务器提供LLM应用程序可以使用的上下文和工具.
此添加\ - on 允许您:
- 创建MCP客户端,以连接MATLAB的可流HTTP服务器.
- 调用外部工具。
- 使用带有 MATLAB 添加-on的大语言模型的外部工具。
设置
- 在线使用 MATLAB
- 使用添加浏览器安装
实例
- 创建 MCP 客户端
- 使用 LLM 自动调用外部工具
职能
- McpHTTPlient 号
- 呼叫图尔
设置
使用此添加-on需要 MATLAB R2025a 或更新.
要生成并执行 MATLAB 的工具调用,您还需要使用 MATLAB 添加-on 的 4. 6.0 版本或更新的大语言模型(LLMs) 。
□ 在线使用 MATLAB
您可以点击此链接使用 MATLAB Online 中的添加:
□ 使用 Add- 在探索器上安装
建议在已安装的 MATLAB 版本中使用添加-on的方法是使用 Add-On Explorer.
- 联合国.
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
MATLAB MCP HTTP Client
Create MCP client in MATLAB® to call external tools in LLM workflows
Model Context Protocol (MCP) is a framework for communication between AI agents and external tools. Typically, a large language model (LLM) application sets up one or more MCP clients that each connect to an MCP server. The MCP server provides context and tools the LLM application can use.
This add-on allows you to:
- Create MCP clients to connect to streamable HTTP servers from MATLAB.
- Call external tools.
- Use external tools with the Large Language Models (LLMs) with MATLAB add-on.
Setup
Using this add-on requires MATLAB R2025a or newer.
To generate and execute tool calls from MATLAB, you also need version 4.6.0 or newer of the Large Language Models (LLMs) with MATLAB add-on.
Use MATLAB Online
You can use the add-on in MATLAB Online by clicking this link:
Install Using Add-On Explorer
The recommended way of using the add-on in an installed version of MATLAB is to use the Add-On Explorer.
- In MATLAB, go to the Home tab, and in the Environment section, click the Add-Ons icon.
- In the Add-On Explorer, search for “MATLAB MCP HTTP Client”.
- Select Install.
Examples
Create MCP Client
Create an MCP client using the mcpHTTPClient function. Specify the URL of the MCP server to which you want to connect. For example, use the IO Aerospace MCP server to access aerospace and astrodynamics tools.
endpoint = "https://mcp.io-aerospace.org/";
client = mcpHTTPClient(endpoint);
The MCP client stores information about the available tools from the server in the ServerTools property.
serverTools = client.ServerTools;
The IO Aerospace MCP server provides a tool called get_celestial_body_properties that returns the geophysical properties of a celestial body.
toolGetCelestialBodyProperties = serverTools{23}
toolGetCelestialBodyProperties = struct with fields:
name: 'get_celestial_body_properties'
title: 'Get celestial body properties'
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →