Summary
When installing a Docker-based MCP server from an MCP registry into VS Code, APM generates an incomplete .vscode/mcp.json.
The registry manifest contains Docker runtimeArguments, including a required workspace mount argument using the MCP registry v0.1 variables shape. During install, APM drops those arguments and writes only the fallback Docker command, so the final MCP server configuration is missing required parameters.
This appears to be an APM issue in the VS Code adapter, not a registry issue.
Environment
- APM:
0.14.0 (9d1161b)
- VS Code:
1.120.0
- macOS:
14.7.3 (23H417)
Reproduction
- Install an MCP server from a registry whose package uses:
runtimeHint: "docker"
transport.type: "stdio"
runtimeArguments with v0.1 variables
- Let APM write the VS Code workspace config.
- Open
.vscode/mcp.json.
Example registry response
{
"server": {
"name": "com.example/playwright-mcp",
"version": "1.2.3",
"packages": [
{
"registryType": "oci",
"identifier": "ghcr.io/example/playwright-mcp:1.2.3",
"runtimeHint": "docker",
"transport": {
"type": "stdio"
},
"runtimeArguments": [
{
"value": "-v",
"type": "positional"
},
{
"value": "{workdir}:/workspace",
"variables": {
"workdir": {
"description": "Working directory to mount into the container.",
"isRequired": true,
"format": "filepath",
"placeholder": "/path/to/project"
}
},
"type": "positional"
},
{
"value": "-w",
"type": "positional"
},
{
"value": "/workspace",
"type": "positional"
}
]
}
]
}
}
Actual result
APM writes something like:
{
"servers": {
"com.example/playwright-mcp": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/example/playwright-mcp:1.2.3"
]
}
},
"inputs": []
}
The required mount and working-directory args are missing.
Expected result
APM should preserve the runtime arguments and translate the required variable into something usable by VS Code, for example:
{
"servers": {
"com.example/playwright-mcp": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"${workspaceFolder}:/workspace",
"-w",
"/workspace",
"ghcr.io/example/playwright-mcp:1.2.3"
]
}
}
}
Or, if prompting is preferred, generate a matching inputs entry and reference it in the args.
Why this looks like an APM bug
From the code path:
- The registry client normalizes
runtimeArguments to runtime_arguments.
- The install path threads
runtime_vars through to adapters.
- The VS Code adapter does not appear to consume
runtime_vars.
VSCodeClientAdapter._extract_package_args() handles:
package_arguments[].value
- legacy
runtime_arguments[] entries with is_required + value_hint
- It does not handle the MCP registry v0.1
runtimeArguments[].variables shape.
As a result, Docker packages using variable-based runtime arguments fall back to:
["run", "-i", "--rm", "<image>"]
Impact
This breaks Docker-based MCP servers that require workspace mounts or other runtime parameters from the manifest. The server may start, but it is misconfigured because required arguments are omitted.
Suggested fix
Support v0.1 runtimeArguments entries that contain variables, especially for the VS Code adapter:
- Parse
runtimeArguments[].variables
- Resolve well-known workspace paths to
${workspaceFolder} where appropriate
- Otherwise generate
inputs entries and substitute ${input:...}
- Add a regression test for Docker packages using
runtimeArguments with variables
Additional note
There are already tests covering legacy runtime_arguments handling, but this looks like a gap for the newer MCP registry v0.1 variable-bearing argument format.
Summary
When installing a Docker-based MCP server from an MCP registry into VS Code, APM generates an incomplete
.vscode/mcp.json.The registry manifest contains Docker
runtimeArguments, including a required workspace mount argument using the MCP registry v0.1variablesshape. During install, APM drops those arguments and writes only the fallback Docker command, so the final MCP server configuration is missing required parameters.This appears to be an APM issue in the VS Code adapter, not a registry issue.
Environment
0.14.0 (9d1161b)1.120.014.7.3 (23H417)Reproduction
runtimeHint: "docker"transport.type: "stdio"runtimeArgumentswith v0.1variables.vscode/mcp.json.Example registry response
{ "server": { "name": "com.example/playwright-mcp", "version": "1.2.3", "packages": [ { "registryType": "oci", "identifier": "ghcr.io/example/playwright-mcp:1.2.3", "runtimeHint": "docker", "transport": { "type": "stdio" }, "runtimeArguments": [ { "value": "-v", "type": "positional" }, { "value": "{workdir}:/workspace", "variables": { "workdir": { "description": "Working directory to mount into the container.", "isRequired": true, "format": "filepath", "placeholder": "/path/to/project" } }, "type": "positional" }, { "value": "-w", "type": "positional" }, { "value": "/workspace", "type": "positional" } ] } ] } }Actual result
APM writes something like:
{ "servers": { "com.example/playwright-mcp": { "type": "stdio", "command": "docker", "args": [ "run", "-i", "--rm", "ghcr.io/example/playwright-mcp:1.2.3" ] } }, "inputs": [] }The required mount and working-directory args are missing.
Expected result
APM should preserve the runtime arguments and translate the required variable into something usable by VS Code, for example:
{ "servers": { "com.example/playwright-mcp": { "type": "stdio", "command": "docker", "args": [ "run", "-i", "--rm", "-v", "${workspaceFolder}:/workspace", "-w", "/workspace", "ghcr.io/example/playwright-mcp:1.2.3" ] } } }Or, if prompting is preferred, generate a matching
inputsentry and reference it in the args.Why this looks like an APM bug
From the code path:
runtimeArgumentstoruntime_arguments.runtime_varsthrough to adapters.runtime_vars.VSCodeClientAdapter._extract_package_args()handles:package_arguments[].valueruntime_arguments[]entries withis_required+value_hintruntimeArguments[].variablesshape.As a result, Docker packages using variable-based runtime arguments fall back to:
Impact
This breaks Docker-based MCP servers that require workspace mounts or other runtime parameters from the manifest. The server may start, but it is misconfigured because required arguments are omitted.
Suggested fix
Support v0.1
runtimeArgumentsentries that containvariables, especially for the VS Code adapter:runtimeArguments[].variables${workspaceFolder}where appropriateinputsentries and substitute${input:...}runtimeArgumentswithvariablesAdditional note
There are already tests covering legacy
runtime_argumentshandling, but this looks like a gap for the newer MCP registry v0.1 variable-bearing argument format.