{"id":18818,"date":"2025-11-03T08:52:41","date_gmt":"2025-11-03T13:52:41","guid":{"rendered":"https:\/\/blogs.mathworks.com\/deep-learning\/?p=18818"},"modified":"2025-11-03T09:22:06","modified_gmt":"2025-11-03T14:22:06","slug":"releasing-the-matlab-mcp-core-server-on-github","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/deep-learning\/2025\/11\/03\/releasing-the-matlab-mcp-core-server-on-github\/","title":{"rendered":"Releasing the MATLAB MCP Core Server on GitHub"},"content":{"rendered":"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:\r\n\r\n<a href=\"https:\/\/github.com\/matlab\/matlab-mcp-core-server\" target=\"_blank\" rel=\"noopener\">github.com\/matlab\/matlab-mcp-core-server<\/a>\r\n<h6><\/h6>\r\n<h2>The AI Copy &amp; Paste problem<\/h2>\r\nIf you are like me, you are probably familiar with this situation. Going to your favorite chat app (ChatGPT\u00ae or Claude\u00ae 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\u2019s admit, it happens sometimes), then you need to copy the error and paste it in the chat. Iterate\u2026\r\n<h6><\/h6>\r\n<!--StartFragment --><span class=\"cf0\">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:<\/span><!--EndFragment -->\r\n<h6><\/h6>\r\n<div class=\"row\"><div class=\"col-xs-12 containing-block\"><div class=\"bc-outer-container add_margin_20\"><videoplayer><div class=\"video-js-container\"><video data-video-id=\"6384204783112\" data-video-category=\"blog\" data-autostart=\"false\" data-account=\"62009828001\" data-omniture-account=\"mathwgbl\" data-player=\"rJ9XCz2Sx\" data-embed=\"default\" id=\"mathworks-brightcove-player\" class=\"video-js\" controls><\/video><script src=\"\/\/players.brightcove.net\/62009828001\/rJ9XCz2Sx_default\/index.min.js\"><\/script><script>if (typeof(playerLoaded) === 'undefined') {var playerLoaded = false;}(function isVideojsDefined() {if (typeof(videojs) !== 'undefined') {videojs(\"mathworks-brightcove-player\").on('loadedmetadata', function() {playerLoaded = true;});} else {setTimeout(isVideojsDefined, 10);}})();<\/script><\/div><\/videoplayer><\/div><\/div><\/div>\r\n<h6><\/h6>\r\n<h2>MCP: USB-C for AI<\/h2>\r\nThe issue raised by the copy pasting of code from a chat to MATLAB isn\u2019t unique. In fact, you can expand this problem to any AI chat or agent (Visual Studio Code\u00ae, Claude Desktop\u00ae, Gemini CLI\u00ae, \u2026) 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.\r\n\r\nThat is where the <strong>Model Context Protocol (MCP)<\/strong> comes in. It standardizes the connection of agentic AI apps to tools, resources and prompts, using a client-server architecture.\r\n<h6><\/h6>\r\n&nbsp;\r\n<h6><\/h6>\r\n<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-18863\" src=\"https:\/\/blogs.mathworks.com\/deep-learning\/files\/2025\/10\/MCP-USB-C-2.png\" alt=\"\" width=\"800\" height=\"420\" \/>\r\n<h6><\/h6>\r\nIf we look at how this works specifically for MATLAB, here is an example of this communication taking place locally:\r\n<h6><\/h6>\r\n&nbsp;\r\n<h6><\/h6>\r\n<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-18869\" src=\"https:\/\/blogs.mathworks.com\/deep-learning\/files\/2025\/10\/claude-calls-matlab-2.png\" alt=\"\" width=\"800\" height=\"450\" \/>\r\n<h6><\/h6>\r\n&nbsp;\r\n<h6><\/h6>\r\n<ol>\r\n \t<li>I enter a prompt in Claude Desktop. For example:\r\n<em>\u201cCreate and run a linear regression in MATLAB\u201d.<\/em><\/li>\r\n \t<li>Claude Desktop relays the prompt as well as connected MCP servers and their corresponding tools to the Large Language Model Claude Sonnet 4.5.<\/li>\r\n \t<li>The LLM generates the code and then decides it should invoke the <strong>run_matlab_code<\/strong> tool to run the code in MATLAB.<\/li>\r\n \t<li>The client communicates with the server which in turn communicates with MATLAB to run the code.<\/li>\r\n \t<li>Claude Desktop retrieves the results to format them in the chat response.<\/li>\r\n<\/ol>\r\n&nbsp;\r\n<h6><\/h6>\r\n<!--StartFragment -->\r\n<p class=\"pf0\"><span class=\"cf0\">The MATLAB MCP Core Server provides a set of 5 tools, designed to best implement agentic coding with MATLAB<\/span><!--EndFragment -->:<\/p>\r\n\r\n<ul>\r\n \t<li>detect_matlab_toolboxes<\/li>\r\n \t<li>check_matlab_code<\/li>\r\n \t<li>evaluate_matlab_code<\/li>\r\n \t<li>run_matlab_file<\/li>\r\n \t<li>run_matlab_test_file<\/li>\r\n<\/ul>\r\n<h6><\/h6>\r\nThe 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.\r\n\r\nIn 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).\r\n<h6><\/h6>\r\n<h2>How to get started<\/h2>\r\nHere are a few videos to get you started with 3 potential clients to our MATLAB MCP Core Server.\r\n<h6><\/h6>\r\n<ul>\r\n \t<li>VS Code<\/li>\r\n<\/ul>\r\n<div class=\"row\"><div class=\"col-xs-12 containing-block\"><div class=\"bc-outer-container add_margin_20\"><videoplayer><div class=\"video-js-container\"><video data-video-id=\"6384356758112\" data-video-category=\"blog\" data-autostart=\"false\" data-account=\"62009828001\" data-omniture-account=\"mathwgbl\" data-player=\"rJ9XCz2Sx\" data-embed=\"default\" id=\"mathworks-brightcove-player\" class=\"video-js\" controls><\/video><script src=\"\/\/players.brightcove.net\/62009828001\/rJ9XCz2Sx_default\/index.min.js\"><\/script><script>if (typeof(playerLoaded) === 'undefined') {var playerLoaded = false;}(function isVideojsDefined() {if (typeof(videojs) !== 'undefined') {videojs(\"mathworks-brightcove-player\").on('loadedmetadata', function() {playerLoaded = true;});} else {setTimeout(isVideojsDefined, 10);}})();<\/script><\/div><\/videoplayer><\/div><\/div><\/div>\r\n\r\nTo 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.\r\n<h6><\/h6>\r\n<ul>\r\n \t<li>Claude Desktop<\/li>\r\n<\/ul>\r\n<div class=\"row\"><div class=\"col-xs-12 containing-block\"><div class=\"bc-outer-container add_margin_20\"><videoplayer><div class=\"video-js-container\"><video data-video-id=\"6384366154112\" data-video-category=\"blog\" data-autostart=\"false\" data-account=\"62009828001\" data-omniture-account=\"mathwgbl\" data-player=\"rJ9XCz2Sx\" data-embed=\"default\" id=\"mathworks-brightcove-player\" class=\"video-js\" controls><\/video><script src=\"\/\/players.brightcove.net\/62009828001\/rJ9XCz2Sx_default\/index.min.js\"><\/script><script>if (typeof(playerLoaded) === 'undefined') {var playerLoaded = false;}(function isVideojsDefined() {if (typeof(videojs) !== 'undefined') {videojs(\"mathworks-brightcove-player\").on('loadedmetadata', function() {playerLoaded = true;});} else {setTimeout(isVideojsDefined, 10);}})();<\/script><\/div><\/videoplayer><\/div><\/div><\/div>\r\n\r\nHere my colleague Maithili is using it with Claude Desktop. It provides a more casual experience but gives less control about the development environment.\r\n<h6><\/h6>\r\n<ul>\r\n \t<li>Gemini CLI<\/li>\r\n<\/ul>\r\n<div class=\"row\"><div class=\"col-xs-12 containing-block\"><div class=\"bc-outer-container add_margin_20\"><videoplayer><div class=\"video-js-container\"><video data-video-id=\"6384196888112\" data-video-category=\"blog\" data-autostart=\"false\" data-account=\"62009828001\" data-omniture-account=\"mathwgbl\" data-player=\"rJ9XCz2Sx\" data-embed=\"default\" id=\"mathworks-brightcove-player\" class=\"video-js\" controls><\/video><script src=\"\/\/players.brightcove.net\/62009828001\/rJ9XCz2Sx_default\/index.min.js\"><\/script><script>if (typeof(playerLoaded) === 'undefined') {var playerLoaded = false;}(function isVideojsDefined() {if (typeof(videojs) !== 'undefined') {videojs(\"mathworks-brightcove-player\").on('loadedmetadata', function() {playerLoaded = true;});} else {setTimeout(isVideojsDefined, 10);}})();<\/script><\/div><\/videoplayer><\/div><\/div><\/div>\r\n\r\nThis 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.\r\n<h6><\/h6>\r\n<h2>Installation<\/h2>\r\nHere is a short video on how to get the MATLAB MCP Core Server installed. The repository goes through the <a href=\"https:\/\/github.com\/matlab\/matlab-mcp-core-server#setup\" target=\"_blank\" rel=\"noopener\">setup<\/a>, but based on conversations with some of my colleagues on this, I feel like it's alwasy good to offer some handholding.\r\n<h6><\/h6>\r\nI 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 <strong>chmod +x<\/strong>).\r\n<h6><\/h6>\r\n<div class=\"row\"><div class=\"col-xs-12 containing-block\"><div class=\"bc-outer-container add_margin_20\"><videoplayer><div class=\"video-js-container\"><video data-video-id=\"6384196002112\" data-video-category=\"blog\" data-autostart=\"false\" data-account=\"62009828001\" data-omniture-account=\"mathwgbl\" data-player=\"rJ9XCz2Sx\" data-embed=\"default\" id=\"mathworks-brightcove-player\" class=\"video-js\" controls><\/video><script src=\"\/\/players.brightcove.net\/62009828001\/rJ9XCz2Sx_default\/index.min.js\"><\/script><script>if (typeof(playerLoaded) === 'undefined') {var playerLoaded = false;}(function isVideojsDefined() {if (typeof(videojs) !== 'undefined') {videojs(\"mathworks-brightcove-player\").on('loadedmetadata', function() {playerLoaded = true;});} else {setTimeout(isVideojsDefined, 10);}})();<\/script><\/div><\/videoplayer><\/div><\/div><\/div>\r\n<h6><\/h6>\r\nIf 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\u00a0from the combination of LLM-generated code, code execution, and access to your files.\r\n<h6><\/h6>\r\nThat'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\ud83d\udcce","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/deep-learning\/files\/2025\/10\/MCP-USB-C-2.png\" onError=\"this.style.display ='none';\" \/><\/div><p>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... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/deep-learning\/2025\/11\/03\/releasing-the-matlab-mcp-core-server-on-github\/\">read more >><\/a><\/p>","protected":false},"author":230,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[74,75],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/posts\/18818"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/users\/230"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/comments?post=18818"}],"version-history":[{"count":35,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/posts\/18818\/revisions"}],"predecessor-version":[{"id":18915,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/posts\/18818\/revisions\/18915"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/media?parent=18818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/categories?post=18818"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/tags?post=18818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}