{"id":19038,"date":"2025-12-11T08:37:18","date_gmt":"2025-12-11T13:37:18","guid":{"rendered":"https:\/\/blogs.mathworks.com\/deep-learning\/?p=19038"},"modified":"2025-12-11T11:29:38","modified_gmt":"2025-12-11T16:29:38","slug":"matlab-mcp-server-update-bringing-your-coding-guidelines-directly-to-ai","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/deep-learning\/2025\/12\/11\/matlab-mcp-server-update-bringing-your-coding-guidelines-directly-to-ai\/","title":{"rendered":"MATLAB MCP Core Server Update: Bringing Your Coding Guidelines Directly to AI"},"content":{"rendered":"<span style=\"font-weight: 400;\">Last month, we <\/span><a href=\"https:\/\/blogs.mathworks.com\/deep-learning\/2025\/11\/03\/releasing-the-matlab-mcp-core-server-on-github\/\"><span style=\"font-weight: 400;\">announced the release of the MATLAB Model Context Protocol (MCP) Core Server<\/span><\/a><span style=\"font-weight: 400;\">, opening a new bridge between MATLAB and the next generation of AI agents. The response has been incredible, and we\u2019ve been listening closely to how you are using these agents to accelerate your workflows.<\/span>\r\n\r\n<span style=\"font-weight: 400;\">Today, we are excited to share a new feature-driven update to the server (v0.3), which goes beyond just <\/span><i><span style=\"font-weight: 400;\">executing<\/span><\/i><span style=\"font-weight: 400;\"> code. This release introduces a fundamental shift in how your AI assistant understands your development environment: <\/span><b>MCP Resources<\/b><span style=\"font-weight: 400;\">.<\/span>\r\n<h6><\/h6>\r\n&nbsp;\r\n<h6><\/h6>\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=\"6386331065112\" 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<h3><b>Beyond Tools: The Power of Context<\/b><\/h3>\r\n<span style=\"font-weight: 400;\">In our initial release, we focused on <\/span><b>Tools<\/b><span style=\"font-weight: 400;\">\u2014giving the AI the ability to run MATLAB code, evaluate expressions, and retrieve documentation. That\u2019s the \"hands\" of the agent.<\/span>\r\n\r\n<span style=\"font-weight: 400;\">With today\u2019s update, we are giving the agent \"eyes.\"<\/span>\r\n\r\n<span style=\"font-weight: 400;\">The <\/span><b>Model Context Protocol<\/b><span style=\"font-weight: 400;\"> isn't just about execution; it\u2019s about <\/span><i><span style=\"font-weight: 400;\">Context<\/span><\/i><span style=\"font-weight: 400;\">. By adding support for <\/span><b>Resources<\/b><span style=\"font-weight: 400;\">, the MATLAB MCP server can now feed structured read-only data directly into the Large Language Model\u2019s (LLM) context window. This ensures the model knows <\/span><i><span style=\"font-weight: 400;\">how<\/span><\/i><span style=\"font-weight: 400;\"> you want your code written before it writes a single line.<\/span>\r\n<h6><\/h6>\r\n<h6><\/h6>\r\n&nbsp;\r\n\r\n&nbsp;\r\n<h3><b>Feature Highlight: Standardizing Code with \"MATLAB Coding Guidelines\"<\/b><\/h3>\r\n<span style=\"font-weight: 400;\">We know that generating code is easy, but generating <\/span><i><span style=\"font-weight: 400;\">compliant, production-ready<\/span><\/i><span style=\"font-weight: 400;\"> code is hard. To demonstrate the power of Resources, we have connected the MATLAB MCP server directly to the <\/span><a href=\"https:\/\/github.com\/matlab\/rules\"><span style=\"font-weight: 400;\">MATLAB AI Coding Rules<\/span><\/a><span style=\"font-weight: 400;\">.<\/span>\r\n\r\n<span style=\"font-weight: 400;\">Now, instead of prompting your agent with \"Write this script and please remember to use camelCase and don't use i for loops,\" you can simply attach the <\/span><b>Coding Guidelines Resource<\/b><span style=\"font-weight: 400;\">.<\/span>\r\n<h6><\/h6>\r\n<b>A Real-World Workflow: <\/b><span style=\"font-weight: 400;\">Imagine you are asking an AI agent (like Claude Desktop or Cursor) to write a script that processes complex number arrays.<\/span>\r\n<h6><\/h6>\r\n<span style=\"font-weight: 400;\">Without Context:<\/span>\r\n\r\n<span style=\"font-weight: 400;\">The model might generate a loop using i as an iterator:<\/span>\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n<div>\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\">\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\"><span class=\"comment\">% Typical AI Output<\/span>\r\nfor i = 1:100\r\n    y = x + 3i; <span class=\"comment\">% Potentially ambiguous or error-prone if 'i' is overwritten<\/span>\r\nend\r\n<\/pre>\r\n<\/div>\r\n<\/div>\r\n<h6><\/h6>\r\n<h6><\/h6>\r\n<span style=\"font-weight: 400;\">With the MATLAB Coding Guidelines Resource:<\/span>\r\n\r\n<span style=\"font-weight: 400;\">You simply select the matlab:\/\/resources\/coding_guidelines resource in your MCP client. The agent instantly reads the guidelines, specifically the rule regarding imaginary units and variable naming.<\/span>\r\n\r\n<span style=\"font-weight: 400;\">The Result:<\/span>\r\n\r\n<span style=\"font-weight: 400;\">The agent auto-corrects its behavior based on the guideline recommendation to \"Use 1i or 1j for imaginary numbers\" and avoids using i as a loop variable to prevent shadowing.<\/span>\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n<div>\r\n<h6><\/h6>\r\n<div style=\"position: relative; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; padding: 1rem; font-family: Consolas,monospace; color: #111827;\">\r\n<pre id=\"matlab-snippet\" style=\"margin: 0; padding: 0; border: none; background: none; color: inherit; white-space: pre; line-height: 1.4;\"><span class=\"comment\">% Output with MCP Resource attached<\/span>\r\nfor k = 1:100\r\n\u00a0 \u00a0 y = x + 3*1i; <span class=\"comment\">% Adheres to MathWorks guidelines for imaginary units<\/span>\r\nend\r\n<\/pre>\r\n<\/div>\r\n<\/div>\r\n&nbsp;\r\n<h6><\/h6>\r\n<span style=\"font-weight: 400;\">This ensures your AI-generated code isn't just functional\u2014it\u2019s clean, maintainable, and adheres to the standards used by large engineering teams.<\/span>\r\n<h6><\/h6>\r\n<h6><\/h6>\r\n&nbsp;\r\n<h6><\/h6>\r\n<h3><b>What Else is New?<\/b><\/h3>\r\n<span style=\"font-weight: 400;\">This release includes several other improvements driven by community feedback:<\/span>\r\n<ul>\r\n \t<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Lazy Loading:<\/b><span style=\"font-weight: 400;\"> We are optimizing the server startup. MATLAB will now \"lazy load,\" meaning the server starts instantly and only launches the full MATLAB engine when you make your first tool call.<\/span><\/li>\r\n \t<li style=\"font-weight: 400;\" aria-level=\"1\"><b>System Tests:<\/b><span style=\"font-weight: 400;\"> We've added a robust suite of system tests to ensure stability across different OS environments.<\/span><\/li>\r\n \t<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Watchdog Logging:<\/b><span style=\"font-weight: 400;\"> Improved debugging with dedicated logs for the server watchdog process.<\/span><\/li>\r\n<\/ul>\r\n&nbsp;\r\n<h5><\/h5>\r\n<h5><\/h5>\r\n&nbsp;\r\n<h3><b>Try It Out<\/b><\/h3>\r\n<span style=\"font-weight: 400;\">The updated MATLAB MCP Core Server is available now.<\/span>\r\n<ol>\r\n \t<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Update your server:<\/b><span style=\"font-weight: 400;\"> Get the latest release from our <\/span><a href=\"https:\/\/github.com\/matlab\/matlab-mcp-core-server\/releases\/tag\/v0.3.0\"><span style=\"font-weight: 400;\">GitHub Repository<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/li>\r\n \t<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Explore the Guidelines:<\/b><span style=\"font-weight: 400;\"> Check out the source of inspiration for our new resource at the <\/span><a href=\"https:\/\/github.com\/mathworks\/MATLAB-Coding-Guidelines\"><span style=\"font-weight: 400;\">MATLAB Coding Guidelines repo<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/li>\r\n \t<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Connect:<\/b><span style=\"font-weight: 400;\"> Point your AI chat or agent (like Claude or IDEs supporting MCP) to the new server and look for the new Resources (in Claude Desktop, it is available with the + icon).<\/span><\/li>\r\n<\/ol>\r\n<span style=\"font-weight: 400;\">We can\u2019t wait to see what you build\u2014and how cleanly you code it!<\/span>","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/deep-learning\/files\/2025\/12\/AddResourceCodingGuidelines.png\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div><p>Last month, we announced the release of the MATLAB Model Context Protocol (MCP) Core Server, opening a new bridge between MATLAB and the next generation of AI agents. The response has been... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/deep-learning\/2025\/12\/11\/matlab-mcp-server-update-bringing-your-coding-guidelines-directly-to-ai\/\">read more >><\/a><\/p>","protected":false},"author":230,"featured_media":19041,"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\/19038"}],"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=19038"}],"version-history":[{"count":6,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/posts\/19038\/revisions"}],"predecessor-version":[{"id":19046,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/posts\/19038\/revisions\/19046"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/media\/19041"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/media?parent=19038"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/categories?post=19038"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/deep-learning\/wp-json\/wp\/v2\/tags?post=19038"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}