Logo MATLAB MCP Core Server

MATLAB MCP Core Server

Tổ chứcPhổ biến
matlab

Run MATLAB® using AI applications with the official MATLAB MCP Server from MathWorks®. This MCP server for MATLAB supports a wide range of coding agents like Claude Code® and Visual Studio® Code.

Nhà phát hànhmatlab
Kho mãmatlab-mcp-server
Ngôn ngữGo
Bản fork
126
Sao
1.6K
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    MATLAB MCP Core Server cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    1.6K sao và 126 bản fork từ kho mã được liên kết.

MATLAB MCP Server

Run MATLAB® using AI applications with the official MATLAB MCP Server from MathWorks®. The MATLAB MCP Server allows your AI applications to:

  • Start and quit MATLAB.
  • Write and run MATLAB code.
  • Assess your MATLAB code for style and correctness.

To assist your agent in using MATLAB and Simulink, you can use skills from MATLAB Agentic Toolkit (GitHub) and Simulink Agentic Toolkit (GitHub), which can also install this MCP server for you.

Table of Contents

Setup

  1. Install MATLAB (MathWorks) R2021a or later and add it to the system PATH.

  2. The server supports any AI application that uses Model Context Protocol. To set up the MATLAB MCP Server for Claude Desktop, skip to the instructions for Claude Desktop. To set up the server for other applications, follow these instructions:

    • For Windows or Linux, Download the Latest Release. (Alternatively, you can build from source: install Go and build the binary using go install github.com/matlab/matlab-mcp-server/cmd/matlab-mcp-server@latest).

    • For macOS, first download the latest release by running the following command in your terminal:

      • For Apple silicon processors, run:
        sh
        curl -L -o ~/Downloads/matlab-mcp-server https://github.com/matlab/matlab-mcp-server/releases/latest/download/matlab-mcp-server-macos-arm64
      • For Intel processors, run:
        sh
        curl -L -o ~/Downloads/matlab-mcp-server https://github.com/matlab/matlab-mcp-server/releases/latest/download/matlab-mcp-server-macos-x64

      Then grant executable permissions to the downloaded binary so you can run the MATLAB MCP Server:

      sh
      chmod +x ~/Downloads/matlab-mcp-server
  3. Add the MATLAB MCP Server to your AI application. You can find instructions for adding MCP servers in the documentation of your AI application. For example instructions on using Claude Code®, Claude Desktop®, and GitHub Copilot in Visual Studio® Code, see below. Note that you can customize the server by specifying optional Arguments.

Claude Code

In your terminal, run the following, remembering to insert the full path to the server binary you acquired in the setup:

sh
claude mcp add --transport stdio matlab -- /fullpath/to/matlab-mcp-server-binary

You can customize the server by specifying optional Arguments. Note the -- separator between Claude Code's options and the server arguments:

sh
claude mcp add --transport stdio matlab -- /fullpath/to/matlab-mcp-server-binary --initial-working-folder=/home/username/myproject

For details on adding MCP servers in Claude Code, see Add a local stdio server (Claude Code). To remove the server later, run:

sh
claude mcp remove matlab

Claude Desktop

You install the MATLAB MCP Server in Claude Desktop using the MATLAB MCP Server bundle.

  1. Install the Filesystem extension in Claude Desktop to allow Claude to read and write files on your system. In Claude Desktop, click Settings > Extensions > Browse extensions. Search for the Filesystem extension developed by Anthropic and click Install. Specify the folders you want to allow the MCP server to access, then toggle the Disabled button to Enable the Filesystem extension.

  2. Download the MATLAB MCP Server bundle matlab-mcp-server.mcpb from the Latest Release page.

  3. To install the MATLAB MCP Server bundle as a desktop extension, double click the downloaded matlab-mcp-server.mcpb file and click Install in Claude Desktop. (Alternatively, navigate in Claude to File menu > Settings > Extensions > Advanced Settings > Install Extension and select the matlab-mcp-server.mcpb file. Click Install).

To customize the behaviour of the MATLAB MCP Server, navigate to Settings > Extensions > Configure, where you can modify the server's Arguments.

GitHub Copilot in Visual Studio Code

In your VS Code workspace, create a file named .vscode/mcp.json. Insert the following JSON, remembering to specify the full path to the server binary you acquired in the setup, as well as any Arguments. Then save the file. (Note that on Windows, your paths require extra slashes as escape characters).

json
{
    "servers": {
        "matlab": {
            "type": "stdio",
            "command": "C:\\fullpath\\to\\matlab-mcp-server-windows-x64.exe",
            "args": []
        }
    }
}

For more information about using MCP servers in VS Code, see Add and Manage MCP servers in VS Code (VS Code).

Codex

In your terminal, run the following, remembering to insert the full path to the server binary you acquired in the setup:

sh
codex mcp add matlab -- /fullpath/to/matlab-mcp-server-binary

You can customize the server by specifying optional Arguments. For example:

sh
codex mcp add matlab -- /fullpath/to/matlab-mcp-server-binary --initial-working-folder=/home/username/myproject

[!NOTE] Windows users: Codex does not forward the WINDIR environment variable, which you need to run MATLAB and Simulink (see #32).

To add the variable, open your Codex config file at C:\Users\<username>\.codex\config.toml, and add env_vars = ["WINDIR"] to the [mcp_servers.matlab] section:

toml
[mcp_servers.matlab]
command = 'C:\fullpath\to\matlab-mcp-server-windows-x64.exe'
args = []
env_vars = ["WINDIR"]

Arguments

Customize the behavior of the server by specifying arguments in one of these ways:

  • Insert the arguments in the configuration settings of your AI application (usually a .json file).
  • Enter the arguments as command-line interface (CLI) flags when you start the server.
  • Use environment variables, specified either in your CLI or application's configuration settings. To derive the environment variable name from a CLI flag, add the prefix MW_MCP_SERVER_, convert to uppercase, and replace hyphens (-) with underscores (_). For example, the argument --matlab-root becomes the environment variable MW_MCP_SERVER_MATLAB_ROOT. CLI flags take precedence over environment variables, if you use both.
ArgumentDescriptionExample
helpDisplays help information for all arguments.--help
versionDisplays the version of the MATLAB MCP Server.--version
matlab-rootFull path specifying which MATLAB to start. Do not include /bin in the path. By default, the server tries to find the first MATLAB on the system PATH.Windows: --matlab-root=C:\\Program Files\\MATLAB\\R2026a Linux/macOS: --matlab-root=/home/usr/MATLAB/R2026aAs an environment variable: MW_MCP_SERVER_MATLAB_ROOT=/home/usr/MATLAB/R2026a
initialize-matlab-on-startupTo initialize MATLAB as soon as you start the server, set this argument to true. By default, MATLAB only starts when the first tool is called.--initialize-matlab-on-startup=true
initial-working-folderSpecify the folder where MATLAB starts. If you do not specify a value, MATLAB starts at the path of your AI application's first Root (MCP). If you have not defined a root, MATLAB starts in these locations: Linux: /home/username Windows: C:\Users\username\DocumentsMac: /Users/username/DocumentsWindows: --initial-working-folder=C:\\Users\\username\\MyProject Linux/macOS: --initial-working-folder=/Users/username/MyProject
matlab-display-modeSpecify whether to show the MATLAB desktop. Use desktop mode (default) to show the MATLAB desktop. Use nodesktop mode to use MATLAB only from your AI application, without the MATLAB desktop. Note that in nodesktop mode, commands requiring a graphical interface (such as edit, open, open_system, uifigure, and appdesigner) will still open MATLAB windows on your desktop.--matlab-display-mode=nodesktop
matlab-session-modeSpecify whether the MCP server starts a new MATLAB or connects to an existing MATLAB session (supported for MATLAB R2023a onwards). The default is auto mode. new mode: The MCP server starts a new MATLAB session. auto mode (default): The server tries to connect to an existing MATLAB session, which you must have configured for existing mode using the instructions below. If the server is unable to find an existing MATLAB session, it starts a new one. existing mode: The server tries to connect to an existing MATLAB session. Do not use this mode in conjunction with the arguments matlab-root, initial-working-folder, or matlab-display-mode. You must have configured your MATLAB session beforehand to use this mode, with these steps:If you are using existing mode for the first time, run ./matlab-mcp-server --setup-matlab.This command installs an add-on named MATLAB MCP Server Toolbox in MATLAB. You can customize the command with other arguments from this table. For example, to specify which MATLAB to use to install the toolbox, you can use ./matlab-mcp-server --setup-matlab --matlab-root=/home/usr/MATLAB/R2026a.For Claude Desktop, you must download the MATLAB MCP Server binary using the instructions in Setup before you run ./matlab-mcp-server --setup-matlab.In the command window of a running MATLAB session, run shareMATLABSession(). The MCP server will connect to this MATLAB when you start the server with --matlab-session-mode=existing or --matlab-session-mode=auto. If you are running multiple MATLAB sessions, the server connects to the MATLAB session where you most recently ran the command shareMATLABSession().As an alternative to running shareMATLABSession() manually, you can add the command to your MATLAB Startup Script (MathWorks).--matlab-session-mode=existing
extension-fileTo use custom MCP tools, provide a path to a JSON file that defines your tools. You can also use multiple extension files. For details on using custom tools, see Use Custom Tools with the MATLAB MCP Server.Windows: --extension-file=C:\\Users\\name\\my-tools.json Linux/macOS: --extension-file=/path/to/my-tools.json Using multiple extension files:Windows:--extension-file=C:\\path\\to\\tools-1.json --extension-file=C:\\path\\to\\tools-2.jsonLinux/macOS:--extension-file=/path/to/tools1.json --extension-file=/path/to/tools2.json Using environment variables: Windows: MW_MCP_SERVER_EXTENSION_FILE=C:\Users\name\tools1.json;C:\Users\name\tools2.json Linux/macOS: MW_MCP_SERVER_EXTENSION_FILE=/path/to/tools1.json:/path/to/tools2.json
log-folderSpecify the folder where the MCP server stores log files. If not specified, the server uses the default temporary folder of your operating system.Windows: --log-folder=C:\\Users\\name\\AppData\\Local\\Temp Linux/macOS: --log-folder=/tmp/my-logs
log-levelThe log levels of the MCP server. Valid values, in order of decreasing verbosity, are debug, info, warn, and error. The default is info.--log-level=debug
disable-telemetryTo disable anonymized data collection, set this argument to true. For details, see Data Collection.--disable-telemetry=true

Tools

  1. detect_matlab_toolboxes

    • Returns information about installed MATLAB and toolboxes, including version numbers.
  2. check_matlab_code

    • Performs static code analysis on a MATLAB script. Returns warnings about coding style, potential errors, deprecated functions, performance issues, and best practice violations. This is a non-destructive, read-only operation that helps identify code quality issues without executing the script.
    • Inputs:
      • script_path (string): Absolute path to the MATLAB script file to analyze. Must be a valid .m file. The file is not modified during analysis. Example: C:\Users\username\matlab\myFunction.m or /home/user/scripts/analysis.m.
  3. evaluate_matlab_code

    • Evaluates a string of MATLAB code and returns the output.
    • Inputs:
      • code (string): MATLAB code to evaluate.
      • project_path (string): Absolute path to your project directory. MATLAB sets this directory as the current working folder. Example: C:\Users\username\matlab-project or /home/user/research.
  4. run_matlab_file

    • Executes a MATLAB script and returns the output. The script must be a valid .m file.
    • Inputs:
      • script_path (string): Absolute path to the MATLAB script file to execute. Must be a valid .m file. Example: C:\Users\username\projects\analysis.m or /home/user/matlab/simulation.m.
  5. run_matlab_test_file

    • Executes a MATLAB test script and returns comprehensive test results. Designed specifically for MATLAB unit test files that follow MATLAB testing framework conventions.
    • Inputs:
      • script_path (string): Absolute path to the MATLAB test script file. Must be a valid .m file containing MATLAB unit tests. Example: C:\Users\username\tests\testMyFunction.m or /home/user/matlab/tests/test_analysis.m.

Resources

The MCP server provides Resources (MCP) to help your AI application write MATLAB code. To see instructions for using this resource, refer to the documentation of your AI application that explains how to use resources.

  1. matlab_coding_guidelines

    • Provides comprehensive MATLAB coding standards for improving code readability, maintainability, and collaboration. The guidelines encompass naming conventions, formatting, commenting, performance optimization, and error handling.
    • URI: guidelines://coding
    • MIME Type: text/markdown
    • Source: MATLAB Coding Standards (GitHub)
  2. plain_text_live_code_guidelines

    • Provides rules and guidelines for generating live scripts using the plain text Live Code .m file format, suitable for version control and AI-assisted development. Note that to run plain text live scripts you need MATLAB R2025a or newer. For details, see Live Code File Format (MathWorks).
    • URI: guidelines://plain-text-live-code
    • MIME Type: text/markdown
    • Source: Plain Text Live Code Generation (GitHub)

Data Collection

The MATLAB MCP Server may collect fully anonymized information about your usage of the server and send it to MathWorks. This data collection helps MathWorks improve products and is on by default. To opt out of data collection, set the argument --disable-telemetry to true.

Security Considerations

When using the MATLAB MCP Server, you should thoroughly review and validate all tool calls before you run them. Always keep a human in the loop for important actions and only proceed once you are confident the call will do exactly what you expect. For more information, see User Interaction Model (MCP) and Security Considerations (MCP).

Licensing and Usage

The license is available in the LICENSE.md file in this GitHub repository.

MCP servers are only permitted to be used with MATLAB in accordance with the MathWorks Software License Agreement, and must not be shared by multiple users. Contact MathWorks if you need to support shared or centralized server use.

Contact Support

MathWorks encourages you to use this repository and provide feedback. To request technical support or submit an enhancement request, create a GitHub issue or contact MathWorks Technical Support.


Copyright 2025-2026 The MathWorks, Inc.


Cài đặt

TypingMind
Yêu cầu:

Node.js 18+

{
  "mcpServers": {
    "matlab-matlab-mcp-core-server": {
      "command": "npx",
      "args": [
        "-y",
        "matlab-mcp-core-server"
      ]
    }
  }
}

Dùng MCP MATLAB MCP Core Server với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối MATLAB MCP Core Server, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm MATLAB MCP Core Server làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của MATLAB MCP Core Server.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "matlab-matlab-mcp-core-server": {
      "command": "npx",
      "args": [
        "-y",
        "matlab-mcp-core-server"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của MATLAB MCP Core Server, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của MATLAB MCP Core Server.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng MATLAB MCP Core Server giúp tôi làm việc này không?
MATLAB MCP Core Server
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng MATLAB MCP Core Server.

Câu hỏi thường gặp

Máy chủ MCP MATLAB MCP Core Server dùng để làm gì?

MATLAB MCP Core Server là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP MATLAB MCP Core Server với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng MATLAB MCP Core Server với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP MATLAB MCP Core Server với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối MATLAB MCP Core Server, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP MATLAB MCP Core Server với TypingMind?

MATLAB MCP Core Server hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP MATLAB MCP Core Server cung cấp những công cụ nào trong TypingMind?

MATLAB MCP Core Server cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP MATLAB MCP Core Server không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu MATLAB MCP Core Server yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇