MATLAB MCP工具发布框架

将MATLAB函数发布为模型上下文协议(MCP)工具并部署到MATLAB Production Server,使AI代理能够调用MATLAB函数,获得高性能、可靠且专业的计算能力。

  • by matlab
  • MATLAB
  • 本地部署
  • 34 星标
  • 更新于
在 GitHub 查看 matlab/mcp-framework-matlab-production-server

使用说明

MCP Framework for MATLAB Production Server

Publish MATLAB® functions as Model Context Protocol tools on MATLAB Production Server™. AI agents call your functions, offering the speed, reliability, and domain-specific performance of MATLAB.

Prerequisites

Install

In MATLAB, open the Add-On Explorer (Home tab → Add-Ons) and search for "MCP Framework for MATLAB Production Server." Select Install.

If you use an AI coding agent, register the build skill so the agent can build and deploy tools on your behalf:

prodserver.mcp.agent.setup

Quick Start

To deploy a function as an MCP tool to an instance of MATLAB Production Server running on localhost:9910, run the following MATLAB code.

% Build an MCP tool from a function — the framework runs your example to determine parameter types
ctf = prodserver.mcp.build("principalStress", ...
    example=@() principalStress([120 -50 80], "max"), ...
    server="http://localhost:9910");

% Verify deployment
prodserver.mcp.ping("http://localhost:9910/principalStress/mcp")

% Call the tool directly
prodserver.mcp.call("http://localhost:9910/principalStress/mcp", ...
    "principalStress", [120 -50 80], "maxShear")

Your function is now available to any MCP client connected to that server. See the Getting Started guide for a complete walkthrough.

Key Features

Documentation: Getting Started | Examples | Guides | Concepts | Reference

License

See license.txt.

Contact

https://www.mathworks.com/support/contact_us.html

--- Copyright 2025-2026 The MathWorks, Inc. ---