Describe the bug
When a self-defined stdio MCP server declares env in apm.yml, APM generates Claude Code .mcp.json with an empty env: {} object.
The environment variables are present in the apm.yml MCP declaration, but they are not preserved in the Claude runtime config.
To Reproduce
Steps to reproduce the behavior:
- Create a project with this
apm.yml:
name: apm-claude-env-repro
version: 1.0.0
target:
- claude
dependencies:
apm: []
mcp:
- name: env-demo
registry: false
transport: stdio
command: npx
args:
- -y
- example-mcp
env:
DEMO_ENV: demo-value
includes: auto
scripts: {}
- Ensure Claude project config directory exists:
- Run:
apm install --target claude --no-policy
- Inspect the generated file:
- Observe that
env is generated as {}.
Expected behavior
The generated .mcp.json should preserve the declared stdio environment variables:
{
"mcpServers": {
"env-demo": {
"type": "stdio",
"command": "npx",
"env": {
"DEMO_ENV": "demo-value"
},
"args": [
"-y",
"example-mcp"
]
}
}
}
Environment (please complete the following information):
- OS: macOS 26.4.1
- Python Version: 3.9.6
- APM Version: Agent Package Manager (APM) CLI version 0.12.4 (6aceef7)
- VSCode Version (if relevant): N/A
Logs
Actual generated .mcp.json:
{
"mcpServers": {
"env-demo": {
"type": "stdio",
"command": "npx",
"env": {},
"args": [
"-y",
"example-mcp"
]
}
}
}
apm install output reports success:
Successfully configured MCP server 'env-demo' for Claude Code
[*] Installed 1 MCP server
Additional context
I searched existing MCP config / env related issues and found related adapter issues, but not this exact Claude Code stdio env drop.
Describe the bug
When a self-defined stdio MCP server declares
envinapm.yml, APM generates Claude Code.mcp.jsonwith an emptyenv: {}object.The environment variables are present in the
apm.ymlMCP declaration, but they are not preserved in the Claude runtime config.To Reproduce
Steps to reproduce the behavior:
apm.yml:envis generated as{}.Expected behavior
The generated
.mcp.jsonshould preserve the declared stdio environment variables:{ "mcpServers": { "env-demo": { "type": "stdio", "command": "npx", "env": { "DEMO_ENV": "demo-value" }, "args": [ "-y", "example-mcp" ] } } }Environment (please complete the following information):
Logs
Actual generated
.mcp.json:{ "mcpServers": { "env-demo": { "type": "stdio", "command": "npx", "env": {}, "args": [ "-y", "example-mcp" ] } } }apm installoutput reports success:Additional context
I searched existing MCP config / env related issues and found related adapter issues, but not this exact Claude Code stdio
envdrop.