{"id":40435890,"url":"https://github.com/subspace-lab/matlab-mcp-server","last_synced_at":"2026-01-20T16:31:40.174Z","repository":{"id":320907920,"uuid":"1083712330","full_name":"subspace-lab/matlab-mcp-server","owner":"subspace-lab","description":"Matlab MCP Server in python","archived":false,"fork":false,"pushed_at":"2025-10-26T16:12:08.000Z","size":102,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-26T18:20:59.154Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/subspace-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-26T15:20:19.000Z","updated_at":"2025-10-26T16:21:23.000Z","dependencies_parsed_at":"2025-10-26T18:21:24.592Z","dependency_job_id":"20492018-611c-4ca8-bc6c-f6630ab9441d","html_url":"https://github.com/subspace-lab/matlab-mcp-server","commit_stats":null,"previous_names":["subspace-lab/matlab-mcp-server"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/subspace-lab/matlab-mcp-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subspace-lab%2Fmatlab-mcp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subspace-lab%2Fmatlab-mcp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subspace-lab%2Fmatlab-mcp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subspace-lab%2Fmatlab-mcp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/subspace-lab","download_url":"https://codeload.github.com/subspace-lab/matlab-mcp-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subspace-lab%2Fmatlab-mcp-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28607206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-20T16:31:39.487Z","updated_at":"2026-01-20T16:31:40.169Z","avatar_url":"https://github.com/subspace-lab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MATLAB MCP Server\n\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/subspace-lab/matlab-mcp-server)\n\nA Model Context Protocol (MCP) server that enables seamless integration between MATLAB and MCP-compatible applications like Claude Code. Execute MATLAB code, manage workspace variables, create plots, handle data I/O, and more - all through a token-efficient MCP interface.\n\n## Features\n\n- **Execute MATLAB Code**: Run MATLAB commands and scripts with persistent session\n- **Workspace Management**: Get, set, list, and clear workspace variables\n- **Figure Operations**: Save, export, and close MATLAB figures (PNG, SVG, PDF, etc.)\n- **Data I/O**: Import/export data (CSV, JSON, XLSX) and load/save MAT files\n- **Environment Info**: Check MATLAB version and installed toolboxes\n- **Documentation Access**: Get MATLAB help, search functions, and find toolbox locations\n- **Token-Efficient Design**: Multi-operation tools minimize API calls\n- **JSON Resources**: Structured access to workspace, toolboxes, and session info\n\n## Quick Start\n\n**Prerequisites:**\n- MATLAB installed on your system\n- `uv` package manager installed ([install uv](https://docs.astral.sh/uv/getting-started/installation/))\n\n### Installation\n\nChoose your MCP client below for setup instructions:\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eClaude Code\u003c/b\u003e (CLI)\u003c/summary\u003e\n\n**Using CLI (Recommended):**\n\n```bash\n# macOS (Apple Silicon)\nclaude mcp add --transport stdio matlab \\\n  --env DYLD_LIBRARY_PATH=/Applications/MATLAB_R2025b.app/bin/maca64 \\\n  -- uvx matlab-mcp-server\n\n# macOS (Intel)\nclaude mcp add --transport stdio matlab \\\n  --env DYLD_LIBRARY_PATH=/Applications/MATLAB_R2025b.app/bin/maci64 \\\n  -- uvx matlab-mcp-server\n\n# Linux\nclaude mcp add --transport stdio matlab \\\n  --env LD_LIBRARY_PATH=/usr/local/MATLAB/R2024b/bin/glnxa64 \\\n  -- uvx matlab-mcp-server\n```\n\n**Scope options:**\n- Default (local): Private to you, only this project\n- `--scope project`: Share with team (stores in `.mcp.json`, can be committed to git)\n- `--scope user`: Available across all your projects\n\n**Manual configuration (`.mcp.json` in project root):**\n\n```json\n{\n  \"mcpServers\": {\n    \"matlab\": {\n      \"command\": \"uvx\",\n      \"args\": [\"matlab-mcp-server\"],\n      \"env\": {\n        \"DYLD_LIBRARY_PATH\": \"/Applications/MATLAB_R2025b.app/bin/maca64\"\n      }\n    }\n  }\n}\n```\n\nReplace with your MATLAB path. Use `LD_LIBRARY_PATH` for Linux.\n\n**Verify:**\n```bash\nclaude mcp list\nclaude mcp info matlab\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eClaude Desktop\u003c/b\u003e\u003c/summary\u003e\n\n**Configuration File Location:**\n\n- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`\n- **Windows**: `%APPDATA%\\Claude\\claude_desktop_config.json`\n- **Linux**: `~/.config/Claude/claude_desktop_config.json`\n\n**Configuration:**\n\n```json\n{\n  \"mcpServers\": {\n    \"matlab\": {\n      \"command\": \"uvx\",\n      \"args\": [\"matlab-mcp-server\"],\n      \"env\": {\n        \"DYLD_LIBRARY_PATH\": \"/Applications/MATLAB_R2025b.app/bin/maca64\"\n      }\n    }\n  }\n}\n```\n\n**Platform-specific environment variables:**\n\n- **macOS (Apple Silicon)**: `\"DYLD_LIBRARY_PATH\": \"/Applications/MATLAB_R2025b.app/bin/maca64\"`\n- **macOS (Intel)**: `\"DYLD_LIBRARY_PATH\": \"/Applications/MATLAB_R2025b.app/bin/maci64\"`\n- **Linux**: `\"LD_LIBRARY_PATH\": \"/usr/local/MATLAB/R2024b/bin/glnxa64\"`\n- **Windows**: Usually not needed (installer handles library paths)\n\n**Steps:**\n1. Create or edit the config file at the location above\n2. Add your MCP server configuration with correct MATLAB path\n3. **Restart Claude Desktop completely** (quit and reopen)\n4. Look for the MCP server icon (🔨) in Claude Desktop interface\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eCursor\u003c/b\u003e\u003c/summary\u003e\n\n**UI Configuration:**\n\nGo to `Cursor Settings` → `MCP` → `Add new MCP Server`:\n- **Name**: `matlab`\n- **Command**: `uvx matlab-mcp-server`\n- Click `Edit` to add environment variables\n\n**Configuration File Location:**\n\n- **macOS**: `~/Library/Application Support/Cursor/mcp_config.json`\n- **Windows**: `%APPDATA%\\Cursor\\mcp_config.json`\n- **Linux**: `~/.config/Cursor/mcp_config.json`\n\n**Configuration:**\n\n```json\n{\n  \"mcpServers\": {\n    \"matlab\": {\n      \"command\": \"uvx\",\n      \"args\": [\"matlab-mcp-server\"],\n      \"env\": {\n        \"DYLD_LIBRARY_PATH\": \"/Applications/MATLAB_R2025b.app/bin/maca64\"\n      }\n    }\n  }\n}\n```\n\nReplace with your MATLAB path (see Claude Desktop section for platform-specific paths).\n\n**Steps:**\n1. Create `mcp_config.json` if it doesn't exist\n2. Add MCP server configuration\n3. Restart Cursor completely\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eVS Code\u003c/b\u003e (GitHub Copilot)\u003c/summary\u003e\n\n**VS Code Settings (User or Workspace):**\n\n```json\n{\n  \"github.copilot.chat.mcp.servers\": {\n    \"matlab\": {\n      \"command\": \"uvx\",\n      \"args\": [\"matlab-mcp-server\"],\n      \"env\": {\n        \"DYLD_LIBRARY_PATH\": \"/Applications/MATLAB_R2025b.app/bin/maca64\"\n      }\n    }\n  }\n}\n```\n\n**CLI Installation:**\n\n```bash\n# macOS (Apple Silicon)\ncode --add-mcp '{\"name\":\"matlab\",\"command\":\"uvx\",\"args\":[\"matlab-mcp-server\"],\"env\":{\"DYLD_LIBRARY_PATH\":\"/Applications/MATLAB_R2025b.app/bin/maca64\"}}'\n\n# Linux\ncode --add-mcp '{\"name\":\"matlab\",\"command\":\"uvx\",\"args\":[\"matlab-mcp-server\"],\"env\":{\"LD_LIBRARY_PATH\":\"/usr/local/MATLAB/R2024b/bin/glnxa64\"}}'\n```\n\nReplace with your MATLAB path (see Claude Desktop section for platform-specific paths).\n\n**Resources:**\n- [Use MCP servers in VS Code](https://code.visualstudio.com/docs/copilot/chat/mcp-servers)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eCodex\u003c/b\u003e\u003c/summary\u003e\n\n**CLI:**\n\n```bash\ncodex mcp add matlab uvx \"matlab-mcp-server\"\n```\n\nThen manually edit `~/.codex/config.toml` to add environment variables:\n\n**Edit `~/.codex/config.toml`:**\n\n```toml\n[mcp_servers.matlab]\ncommand = \"uvx\"\nargs = [\"matlab-mcp-server\"]\n\n[mcp_servers.matlab.env]\nDYLD_LIBRARY_PATH = \"/Applications/MATLAB_R2025b.app/bin/maca64\"\n```\n\n**Platform-specific environment variables:**\n\n- **macOS (Apple Silicon)**: `DYLD_LIBRARY_PATH = \"/Applications/MATLAB_R2025b.app/bin/maca64\"`\n- **macOS (Intel)**: `DYLD_LIBRARY_PATH = \"/Applications/MATLAB_R2025b.app/bin/maci64\"`\n- **Linux**: `LD_LIBRARY_PATH = \"/usr/local/MATLAB/R2024b/bin/glnxa64\"`\n\n**Resources:**\n- [Codex MCP Documentation](https://github.com/openai/codex/blob/main/codex-rs/config.md#mcp_servers)\n\n\u003c/details\u003e\n\n**For 11 additional clients** (Windsurf, Continue, Amp, Cline, Gemini CLI, Goose, Kiro, LM Studio, opencode, Qodo Gen, Warp), see **[Complete Setup Guide →](md-files/MCP_CLIENT_SETUP.md)**\n\n### Finding Your MATLAB Library Path\n\nIf you don't know your MATLAB library path, use the configuration helper:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/subspace-lab/matlab-mcp-server/main/install-matlab-mcp.sh | bash\n```\n\nThe script will:\n- Auto-detect your MATLAB installation\n- Display the config with the correct paths\n- You copy and paste it into your MCP client's config file\n\nThat's it! When your MCP client starts, `uvx` will automatically:\n- Download `matlab-mcp-server` from PyPI\n- Install `matlabengine` and all dependencies\n- Start the MATLAB MCP server\n\n### Manual Installation\n\nIf you prefer to install manually or the automated installer doesn't work:\n\n#### 1. Install matlabengine\n\n```bash\n# Navigate to your MATLAB Python engine directory\ncd /Applications/MATLAB_R20XXx.app/extern/engines/python  # macOS\n# OR\ncd /usr/local/MATLAB/R20XXx/extern/engines/python  # Linux\n\n# Install using uv\nuv pip install .\n```\n\nReplace `R20XXx` with your MATLAB version (e.g., R2024a, R2024b, R2025a).\n\n#### 2. Install matlab-mcp-server\n\n```bash\nuv pip install matlab-mcp-server\n```\n\n#### 3. Configure MCP server\n\nFollow the configuration instructions for your MCP client in the sections above. Use `matlab-mcp` as the command instead of `uvx matlab-mcp-server`.\n\n**Example for Claude Code (`.mcp.json` in project root):**\n\n```json\n{\n  \"mcpServers\": {\n    \"matlab\": {\n      \"command\": \"matlab-mcp\",\n      \"env\": {\n        \"DYLD_LIBRARY_PATH\": \"/Applications/MATLAB_R2025b.app/bin/maca64\"\n      }\n    }\n  }\n}\n```\n\nReplace with your MATLAB path:\n- **macOS (Apple Silicon)**: `DYLD_LIBRARY_PATH` → `/Applications/MATLAB_R20XXx.app/bin/maca64`\n- **macOS (Intel)**: `DYLD_LIBRARY_PATH` → `/Applications/MATLAB_R20XXx.app/bin/maci64`\n- **Linux**: `LD_LIBRARY_PATH` → `/usr/local/MATLAB/R20XXx/bin/glnxa64`\n- **Windows**: Usually not needed\n\nFor other MCP clients, see configuration sections above or [MCP_CLIENT_SETUP.md](md-files/MCP_CLIENT_SETUP.md)\n\n## Available Tools\n\nThe server provides 8 MCP tools for interacting with MATLAB:\n\n- **`execute_matlab`** - Execute MATLAB code and get results\n- **`workspace`** - Manage workspace variables (get, set, list, clear)\n- **`figure`** - Save, export, and manage MATLAB figures (PNG, SVG, PDF, etc.)\n- **`data_io`** - Import/export data in various formats (CSV, JSON, XLSX, MAT files)\n- **`env`** - Get MATLAB version and check installed toolboxes\n- **`get_help`** - Access MATLAB documentation and search functions\n- **`route_intent`** - Suggest appropriate tool mode (meta-tool)\n- **`select_mode`** - Enable optional tool groups (meta-tool)\n\nFor detailed documentation on each tool, see [TOOLS.md](md-files/TOOLS.md) or [MATLAB_MCP_GUIDE.md](md-files/MATLAB_MCP_GUIDE.md).\n\n## Troubleshooting\n\n### MATLAB Engine Not Found\n\nIf you get an error about MATLAB engine not being found:\n\n1. Ensure MATLAB is properly installed\n2. Verify MATLAB Engine API for Python is installed\n3. Check Python version matches MATLAB compatibility\n4. Verify library path is correctly set in config\n\n### Library Path Issues\n\n**Default MATLAB locations:**\n\n- macOS: `/Applications/MATLAB_R20XXx.app`\n- Linux: `/usr/local/MATLAB/R20XXx`\n- Windows: `C:\\Program Files\\MATLAB\\R20XXx`\n\nIf MATLAB is in a non-standard location, update the library path in your config.\n\n## Documentation\n\n- [CONTRIBUTING.md](CONTRIBUTING.md) - Development setup and guidelines\n- [PLANNING.md](md-files/PLANNING.md) - Roadmap and architecture\n- [MATLAB_MCP_GUIDE.md](md-files/MATLAB_MCP_GUIDE.md) - Detailed usage guide\n- [TOOLS.md](md-files/TOOLS.md) - Tool catalog\n\n## License\n\nMIT License\n\n## Contributing\n\nContributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=subspace-lab/matlab-mcp-server\u0026type=date\u0026legend=top-left)](https://www.star-history.com/#subspace-lab/matlab-mcp-server\u0026type=date\u0026legend=top-left)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubspace-lab%2Fmatlab-mcp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsubspace-lab%2Fmatlab-mcp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubspace-lab%2Fmatlab-mcp-server/lists"}