[BUG] Hermes MCP adapter drops cwd, extra passthrough keys and the SSE transport when writing config.yaml
Maintainers usually reply within 1 day
@Parth-Vasave is already working on this.
Since Nov 16, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Read src/apm_cli/adapters/client/hermes.py, especially _to_hermes_format, and inspect the Hermes adapter tests. Start by running the focused tests for server formatting, then add coverage for stdio cwd and extra keys and for remote SSE transport. Done when the generated Hermes config preserves those values while still filtering reserved keys.
Written by the indexing model from the issue text.
Description
Describe the bug
HermesClientAdapter (src/apm_cli/adapters/client/hermes.py) formats each MCP server with the Copilot formatter, then rebuilds it in _to_hermes_format from a fixed allowlist: command, args, env for stdio and url, headers for remote. Any other key is dropped before ~/.hermes/config.yaml is written, including keys that Hermes supports per server (Hermes MCP docs):
cwdon a self-defined stdio server is dropped. The Copilot formatter emits it, but Hermes starts the server in its own working directory.- Passthrough keys from
apm.ymlare dropped.McpDependency.extrareaches the formatter through_merge_extra(for example,timeout,connect_timeout,lazy,auth: oauth), but none of these reachconfig.yaml. An OAuth server configured withauth: oauthis therefore written without it and cannot authenticate. - SSE remotes lose their transport. The Copilot formatter writes
type: "http"for every remote, and the Hermes conversion writes onlyurl. Hermes needstransport: ssefor the legacy SSE transport, so a registry server withtransport_type: sseis written as a Streamable HTTP server and fails to connect.
The other JSON adapters (Claude, Cursor, Kiro, Gemini) write cwd and the extra keys through, so Hermes is the only target that loses them.
To Reproduce
# HERMES_HOME points at an empty temp directory
from apm_cli.adapters.client.hermes import HermesClientAdapter
a = HermesClientAdapter()
local = a._format_server_config({
"name": "local",
"_raw_stdio": {"command": "node", "args": ["s.js"], "cwd": "/srv/app"},
"_extra": {"timeout": 120, "connect_timeout": 30},
})
legacy = a._format_server_config({
"name": "legacy",
"remotes": [{"url": "https://x.example/sse", "transport_type": "sse"}],
"_extra": {"auth": "oauth"},
})
print(local) # {..., 'command': 'node', 'cwd': '/srv/app', 'args': ['s.js'], 'timeout': 120, 'connect_timeout': 30}
print(legacy) # {'type': 'http', 'url': 'https://x.example/sse', ..., 'auth': 'oauth'}
a.update_config({"local": local, "legacy": legacy})
Resulting $HERMES_HOME/config.yaml:
mcp_servers:
local:
command: node
args:
- s.js
enabled: true
legacy:
url: https://x.example/sse
enabled: true
cwd, timeout, connect_timeout and auth are missing, and nothing marks legacy as an SSE server.
Expected behavior
mcp_servers:
local:
command: node
args:
- s.js
cwd: /srv/app
timeout: 120
connect_timeout: 30
enabled: true
legacy:
url: https://x.example/sse
transport: sse
auth: oauth
enabled: true
cwdis kept for stdio servers.- Non-reserved
extrakeys pass through, as on the other adapters (the_EXTRA_DENYLISTguard still applies). - A remote with
transport_type: sseis written withtransport: sse.
Environment
- APM version:
0.35.1(f574a62c2, currentmain) - OS: macOS 27.2.1
- Python: 3.12.12
- Client: Hermes agent
Additional context
I could not find an existing issue or PR covering this. I'm happy to work on a fix if a maintainer can approve the scope:
- Scope:
_to_hermes_formatkeepscwdand non-Copilot-only keys (it still dropstype: local, defaulttools: ["*"]and emptyid). The Hermes formatting path also records an SSE transport so the written entry carriestransport: sse. - Done when: unit tests covering the three cases above fail on current
mainand pass with the fix. - Out of scope: translating APM's
toolsoverlay into Hermes'tools.include/tools.excludeshape, and other targets.
- Dominant language
- Python
- Stars
- 4.3k
- Forks
- 415
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 176
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/apm
-
compilation-target policy check ignores the plural targets: keyPossibly taken @MohammedAlkindi claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
require_pinned_constraint rejects [email protected] release tags as bare branchesPossibly taken @MohammedAlkindi claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
[BUG] Shorthand like git/git or jonas/tig is rejected because rstrip(".git") strips a character setOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
type/automation type/performance
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
[BUG] apm compile reports 'Referenced file not found' for links with a #fragmentPossibly taken A pull request linked to this issue is open or already merged. Openstatus/accepted
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
microsoft/apm#3255 · 2 comments ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
benchflow-ai/skillsbench#1090 ·
-
Missing unit tests for human-readable date/time formatters in utils/datetime.pyPossibly taken @prabhleen2317 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/iceberg-python#4387 ·
Maintainers usually reply within 1 day
-
backend bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA/numba-cuda-mlir#467 · 1 comment ·
Maintainers usually reply within 3 days
-
BUG: UserAgentGenerator.generate ignores browser_type and returns a random browser stackPossibly taken @HhH666-ux claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day