{"version":"2.1.335","anchor":"new-env-var-claude-code-eval-mocked-tools-added-to-a-list-of","canonical_anchor":"new-env-var-claude-code-eval-mocked-tools-added-to-a-list-of","heading":"Plugin evals can mock MCP tools and block calls to the real server","tier":"use","area":"Env Vars","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.335\/e\/new-env-var-claude-code-eval-mocked-tools-added-to-a-list-of","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.335","markdown":"### Plugin evals can mock MCP tools and block calls to the real server\n\nA new CLAUDE_CODE_EVAL_MOCKED_TOOLS variable lets plugin evals mark MCP tools as mocked and refuse calls that would reach the real server\n\n**Unclear.** What reads this variable and what setting it does is not shown.\n\n**What**\n\nAn eval is a scripted test run, here used to test plugins. MCP is the standard Claude Code uses to talk to outside tool servers. A new environment variable, `CLAUDE_CODE_EVAL_MOCKED_TOOLS`, lets an eval mark some of those tools as mocked, meaning stood in for by fakes:\n\n- When an eval config is present, the eval runner sets `CLAUDE_CODE_EVAL_MOCKED_TOOLS` to a comma-separated list of its `mockedTools`.\n\n- When Claude Code decides whether a tool may run, it reads that variable. If the tool's MCP source is not \"dynamic\", its name is on the list, and the call is not coming from an agent hook, the call is refused with \"Plugin eval refused this call because the tool is mocked and its name leads to the real MCP server\" followed by the server name.\n\n- The variable is also added to a list of environment variable names alongside `CLAUDE_CODE_EVAL_CONFINED`, `CLAUDE_CODE_TELEPORT_MOVE` and `CLAUDE_CODE_MANAGED_SETTINGS_PATH`. What that list is used for was not traced.\n\n**Why**\n\nIn practice this keeps a plugin test from reaching a real MCP server when the tool was meant to be faked. Ordinary use of Claude Code is not affected.\n\n- Area: Env Vars\n- Names: `CLAUDE_CODE_EVAL_MOCKED_TOOLS`\n- Tier: Use it now\n- Useful: 5\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: no"}