Skip to content

[BUG] env variable expansion not working in plugin .mcp.json #9427

Description

@yonijacobi

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When including env variables in .mcp.json file inside plugin root folder instead of reading the value of the variables it reads the var string as is ("${VAR}"), with same file in the project root instead of the plugin folder it not happens

What Should Happen?

It should use the envioronment variables like in regular .mcp.json file, as mentioned in the docs

Error Messages/Logs

Steps to Reproduce

  1. install plugin with mcp servers using the builtin /plugin comand
  2. restart claude and run /mcp to verify the mcp servers from the plugin installed
  3. use tool that requires permissions or other usage of env variables

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.0.14

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:mcpbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions