-
Notifications
You must be signed in to change notification settings - Fork 46
Description
Is your feature request related to a problem? Please describe.
For registry-backed MCP servers, the VS Code adapter auto-generates ${input:...} variable definitions (promptString + password: true) from registry metadata. Users get prompted at runtime for secrets automatically.
For self-defined servers (registry: false), users can write ${input:...} references in headers or env, but APM does not generate the matching inputs entries in .vscode/mcp.json. VS Code cannot resolve them.
Example apm.yml:
dependencies:
mcp:
- name: my-server
registry: false
transport: http
url: https://my-server.example.com/mcp/
headers:
Authorization: "Bearer ${input:my-server-token}"
X-Project: "${input:my-server-project}"Expected: APM detects ${input:<id>} patterns in headers and env values, then generates matching input variable definitions — same as registry-backed servers.
Actual: Strings are written verbatim. No inputs entries are created.
Describe the solution you'd like
During adapter config formatting, scan string values in headers and env for ${input:<id>} patterns. For each match:
- Extract the variable id (e.g.,
my-server-token). - Generate an input variable definition:
{ "type": "promptString", "id": "my-server-token", "description": "my-server-token for MCP server my-server", "password": true } - Append to the adapter's
inputsarray (dedup by id).
Scope
- VS Code adapter — primary target (already has the
inputsmechanism). - Copilot / Codex adapters — emit a warning that
${input:...}variables won't be resolved at runtime, since those runtimes don't support input prompts.
Affected Code
src/apm_cli/adapters/client/vscode.py—configure_mcp_server()src/apm_cli/integration/mcp_integrator.py—_build_self_defined_info()
Describe alternatives you've considered
Users can manually add inputs entries to .vscode/mcp.json after apm compile, but this is fragile since APM overwrites the file on each compile.
Another option is requiring users to set environment variables instead of using ${input:...}, but this removes the convenience of VS Code runtime prompts.
Additional context
The VS Code adapter already has the inputs generation mechanism for registry-backed servers (see vscode.py line ~276). This feature extends the same pattern to self-defined servers for parity.