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
- MATLAB R2025b or later
- MATLAB Compiler™, which MATLAB Compiler SDK requires
- MATLAB Compiler SDK™
- MATLAB Production Server R2025b or later. Archives built in R2025b need the R2025b MATLAB Runtime, and a server can host runtimes from its own release or earlier.
- With archive management turned on (
--enable-archive-management in the instance’s main_config), so that prodserver.mcp.deploy can upload archives. Discovery (--enable-discovery) and metrics (--enable-metrics) are optional. See Set Up a Server.
- An MCP client (Claude Desktop, Claude Code, VS Code with Copilot, or any HTTP-capable client)
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
- Building MCP tools — The framework packages your functions and deploys them to MPS. Supports single functions, multi-tool servers, large data, and structured inputs.
- MCP Resources — Serve read-only reference data (material properties, calibration tables) alongside your tools, so the LLM uses real values instead of guessing. Materials example
- MCP Apps — Give your tools an interactive view, such as a plot, that hosts supporting MCP Apps show in the chat. Signal Filter App example
- Server metrics — Monitor deployed tools with built-in counters at framework, server, and tool level.
- AI agent skills — Let Claude Code build and deploy tools on your behalf from natural language.
- Discovery — Deployed tools register with the MPS discovery endpoint so clients can find them automatically.
- Protocol conformance — Servers support MCP 2025-06-18, which uses sessions, and 2026-07-28, which is stateless. The server selects the revision from each request.
Documentation: Getting Started | Cheat Sheet | Examples | Guides | Concepts | Reference | Release Notes | Security
License
See license.txt.
https://www.mathworks.com/support/contact_us.html
— Copyright 2025-2026 The MathWorks, Inc. —
评论