MATLAB MCP Server
MATLAB MCP統合
これはMATLAB用のモデルコンテキストプロトコル(MCP)サーバーの実装です。MCPクライアント(LLMエージェントやClaude Desktopなど)は、Python用のMATLABエンジンAPIを使用して共有MATLABセッションと対話できます。
特徴
MATLAB コードの実行:
runMatlabCodeツールを使用して任意の MATLAB コード スニペットを実行します。変数の取得:
getVariableツールを使用して、MATLAB ワークスペースから変数の値を取得します。**構造化された通信:**ツールは結果とエラーを構造化された JSON として返すため、クライアントによるプログラムでの使用が容易になります。
非ブロッキング実行: MATLAB エンジン呼び出しは、サーバーのブロックを防ぐために
asyncio.to_threadを使用して非同期的に実行されます。標準ログ: Python の標準
loggingモジュールを使用して、クライアント ログでの表示のためにstderrに出力します。**共有セッション:**既存の共有 MATLAB セッションに接続します。
やるべきこと:
MATLAB ワークスペースにデータを書き込むための
setVariableツールを追加します。.mファイルを直接実行するためのrunScriptツールを追加します。ワークスペース管理用のツールを追加します (例:
clearWorkspace、getWorkspaceVariables)。より複雑なデータ型 (構造体、セル配列、オブジェクト) を処理できるように
matlab_to_pythonヘルパーを拡張します。Simulink モデルとの対話のサポートを追加します。
Related MCP server: MATLAB MCP Server
要件
Python 3.12以上
MATLAB ( R2023a 以上を推奨- Python との互換性については MATLAB Engine API を確認してください) と Python 用 MATLAB Engine API がインストールされています。
numpyPython パッケージ。
インストール
このリポジトリをクローンします:
git clone https://github.com/jigarbhoye04/MatlabMCP.git cd MatlabMCPPython 仮想環境をセットアップします (推奨):
# Install uv if you haven't already: https://github.com/astral-sh/uv uv init uv venv source .venv/bin/activate # On Windows use: .venv\Scripts\activate依存関係をインストールします:
uv pip syncMATLABがインストールされ、Python環境向けにMATLABエンジンAPIが設定されていることを確認してください。MATLAB ドキュメントをご覧ください。
MATLAB を起動してエンジンを共有します。MATLABコマンド ウィンドウで次のコマンドを実行します。
matlab.engine.shareEngineMATLABで
matlab.engine.isEngineSharedを実行すると、共有エンジンであるかどうかを確認できます(trueまたは1返されるはずです)。MCPサーバーへの接続には、この共有エンジンが必要です。
構成(Claude Desktop 用)
このサーバーをClaude Desktopで使用するには:
Claude Desktop -> 設定 -> 開発者 -> 構成の編集に移動します。
claude_desktop_config.json``mcpServers開きます。mcpServers セクションを追加または変更し、MatlabMCP設定を含めます。{ "mcpServers": { "MatlabMCP": { "command": "C:\\Users\\username\\.local\\bin\\uv.exe", // Path to your uv executable "args": [ "--directory", "C:\\Users\\username\\Desktop\\MatlabMCP\\", // ABSOLUTE path to the cloned repository directory "run", "main.py" ] // Optional: Add environment variables if needed // "env": { // "MY_VAR": "value" // } } // Add other MCP servers here if you have them } }重要:
C:\\Users\\username\\...パスをシステムの正しい絶対パスに置き換えてください。ファイルを保存し、 Claude Desktop を再起動します。
**ログ記録:**サーバー ログ (Python の
loggingモジュールから) は、Claude Desktop の MCP ログ ファイルに表示されます (macOS ではtail -f ~/Library/Logs/Claude/mcp-server-MatlabMCP.logでアクセスでき、Windows では%APPDATA%\Claude\logs\でアクセスできます)。
発達
プロジェクト構造:
MatlabMCP/
├── .venv/ # Virtual environment created by uv
├── Docs/
│ └── Images/
│ └── Updates.md # Documentation for updates and changes
├── main.py # The MCP server script
├── pyproject.toml # Project metadata and dependencies
├── README.md # This file
└── uv.lock # Lock file for dependenciesドキュメント
サーバーの機能、使用方法、開発ノートに関する詳細なドキュメントについては、 「アップデート」を参照してください。
貢献
貢献を歓迎します!ご提案や改善点がありましたら、お気軽に問題を報告したり、プルリクエストを送信してください。
一緒にさらに良くしていきましょう!
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Build Apps and run code in 30 languages — sandboxed, with persistent sessions for agent loops.
Share context and questions between Claude instances — VS Code, claude.ai web, and mobile.
Persistent memory and cross-session learning for AI coding assistants (hosted remote MCP).
Hosted Amazon Seller Central and Amazon Ads MCP server for Claude, ChatGPT, Cursor, and agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAllows interaction with MATLAB by creating and executing scripts and functions through Claude or other MCP clients, supporting script management and execution result retrieval with environment configuration capabilities.39
- AlicenseBqualityFmaintenanceIntegrates MATLAB with AI to execute code, generate scripts from natural language, and access MATLAB documentation seamlessly.255Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables interactive MATLAB development by allowing users to execute scripts and specific code sections, manage workspace variables, and capture generated plots. It integrates with the MATLAB Python Engine to provide persistent execution context for MCP-compatible clients.18BSD 3-Clause
- AlicenseAqualityAmaintenanceMCP server that connects any AI agent to MATLAB — execute code, async jobs, interactive Plotly plots, custom tools, and monitoring dashboard205MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jigarbhoye04/MatlabMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server