bio_img_deep-learning

Artificial Intelligence

Apply machine learning and deep learning

Releasing the MATLAB MCP Core Server on GitHub

This blog post is co-authored with Akshay Paul, the product manager for the new MATLAB MCP Core Server that released on Friday 31st of October on GitHub: github.com/matlab/matlab-mcp-core-server

The AI Copy & Paste problem

If you are like me, you are probably familiar with this situation. Going to your favorite chat app (ChatGPT® or Claude® for instance) and asking a question about MATLAB. Now the annoying thing is that you have to copy paste the generated code to your MATLAB Desktop to run it. And if the code is incorrect (which let’s admit, it happens sometimes), then you need to copy the error and paste it in the chat. Iterate…
There is now a more elegant solution, and in this blog post I am going to introduce how you can integrate MATLAB into an agentic workflow. But let's start with a quick demo of what this would look like:

MCP: USB-C for AI

The issue raised by the copy pasting of code from a chat to MATLAB isn’t unique. In fact, you can expand this problem to any AI chat or agent (Visual Studio Code®, Claude Desktop®, Gemini CLI®, …) you want to connect to your tools (like your files, your GitHub repos, or your MATLAB). You quickly end up with a combination of MxN applications to connect. That is where the Model Context Protocol (MCP) comes in. It standardizes the connection of agentic AI apps to tools, resources and prompts, using a client-server architecture.
 
If we look at how this works specifically for MATLAB, here is an example of this communication taking place locally:
 
 
  1. I enter a prompt in Claude Desktop. For example: “Create and run a linear regression in MATLAB”.
  2. Claude Desktop relays the prompt as well as connected MCP servers and their corresponding tools to the Large Language Model Claude Sonnet 4.5.
  3. The LLM generates the code and then decides it should invoke the run_matlab_code tool to run the code in MATLAB.
  4. The client communicates with the server which in turn communicates with MATLAB to run the code.
  5. Claude Desktop retrieves the results to format them in the chat response.
 

The MATLAB MCP Core Server provides a set of 5 tools, designed to best implement agentic coding with MATLAB:

  • detect_matlab_toolboxes
  • check_matlab_code
  • evaluate_matlab_code
  • run_matlab_file
  • run_matlab_test_file
The MATLAB MCP Core Server is free and open-source. All you need is your locally installed and licensed MATLAB as well as your subscription to an AI service and a client of your choice. In the next section, you will get a sense of the experience in three different types of agentic apps: a chat (Claude desktop), an integrated development environment (VS Code), a command line interface (Gemini CLI).

How to get started

Here are a few videos to get you started with 3 potential clients to our MATLAB MCP Core Server.
  • VS Code
To build on the previous example, this example shows how to "vibe code" an app in MATLAB programmatically. UI front end is definitely a use case where I welcome the AI productivity boost.
  • Claude Desktop
Here my colleague Maithili is using it with Claude Desktop. It provides a more casual experience but gives less control about the development environment.
  • Gemini CLI
This terminal interface was tested by our development lead Andrew. I really like the full agentic vibe that it gives. It certainly feels way more hands-off.

Installation

Here is a short video on how to get the MATLAB MCP Core Server installed. The repository goes through the setup, but based on conversations with some of my colleagues on this, I feel like it's alwasy good to offer some handholding.
I got this one running at home on my personal Mac Mini M4 with GitHub Copilot. I'm also going through the installation only on Mac here, as it isn't as seamless as Windows (with the catch of making the binary executable with chmod +x).
If you are new to these types of tools, it is important to understand the risks of Agentic AI tools before using them, such as those arising from the combination of LLM-generated code, code execution, and access to your files.
That's it. We hope you like this release. If you have feedback, please open an issue on the GitHub repo, so that our dev team can continuously improve it. Happy AI coding📎
|
  • print

コメント

コメントを残すには、ここ をクリックして MathWorks アカウントにサインインするか新しい MathWorks アカウントを作成します。