Skip to content

Matlab MCP keeps asking for permission to run tool nomatter what I do #18133

Open

Description

@JonasEiche

What version of the Codex App are you using (From “About Codex” dialog)?

vscode codex extension version 26.5409.20454

What subscription do you have?

Pro

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What issue are you seeing?

No matter in which way I change the settings matlab MCP server keeps asking permission to run tool "evaluate_matlab_code" every single time. It breaks codex workflow. I am sitting here pressing enter like a monkey.

Image Image

What steps can reproduce the bug?

model = "gpt-5.4"
model_reasoning_effort = "xhigh"

approval_policy = "never"
sandbox_mode = "workspace-write"

[windows]
sandbox = "unelevated"

[mcp_servers.matlab]
command = "C:\Users\eich_j0\AppData\Local\MathWorks\matlab-mcp-core-server-win64.exe"
args = [
"--matlab-root=C:\Program Files\MATLAB\R2024b",
"--initialize-matlab-on-startup=true",
"--matlab-display-mode=desktop",
"--initial-working-folder=C:\Users\eich_j0\Documents\claude_code_matlab\JGCD_Open_Source_Benchmark_Model_for_AFS\matlab"
]
env = {}
startup_timeout_sec = 30
tool_timeout_sec = 180
enabled = true
cwd = 'C:\Users\eich_j0\Documents\claude_code_matlab\JGCD_Open_Source_Benchmark_Model_for_AFS\matlab'

What is the expected behavior?

To just run matlab mcp look at the results and iterate like claude code does correctly.

Additional information

PLEASE FIX

Activity

  1. added
    app
    on Apr 16, 2026
  2. added
    bug
    extension
    windows-os
    mcp
    sandbox
    on Apr 16, 2026
  3. removed
    extension
    sandbox
    app
    on Apr 16, 2026
  4. vegetabledog-dog commented on Sep 22, 2026

    @vegetabledog-dog

    We reproduced a related Windows + Codex + MATLAB permission issue and found a clean A/B that may help other users here.

    Environment: Windows, MATLAB launched directly from Codex (not via a MATLAB code bug).

    What we observed:

    Normal PowerShell:
    matlab -batch "disp('MANUAL_OK')"
    -> MANUAL_OK, exit 0
    
    Codex with permission profile :workspace:
    matlab -batch "disp('WORKSPACE_OK')"
    -> Fatal Startup Error
       System Error: File system inconsistency
       exit 1
    
    Codex with permission profile :danger-full-access:
    matlab -batch "disp('FULL_ACCESS_OK')"
    -> FULL_ACCESS_OK, exit 0
    

    The same matlab.exe, same machine, same working directory, and same MATLAB installation were used. This strongly suggests that MATLAB startup can require filesystem access that is blocked by the :workspace profile even though ordinary shell commands still work.

    A practical workaround for us was:

    1. Set Full access before starting the Codex task.
    2. Start a fresh task.
    3. Verify:
      Write-Output "CODEX_PERMISSION_PROFILE=$env:CODEX_PERMISSION_PROFILE"
      It should report :danger-full-access.
    4. Then launch MATLAB.

    This also appears related to #17653, where changing to Full access after the initiating prompt does not always affect the already-started task.

    So for MATLAB users, if the tool keeps behaving as if permissions are restricted, it is worth checking the effective CODEX_PERMISSION_PROFILE rather than only the UI setting.

    I would still prefer a least-privilege solution long-term (for example, allowing the specific MATLAB preference/cache/temp paths needed at startup) instead of requiring full access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmcpwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions