[BUG] Hermes MCP adapter drops cwd, extra passthrough keys and the SSE transport when writing config.yaml
I maintainer di solito rispondono entro 1 giorno
@Parth-Vasave ci sta già lavorando.
Dal 16/11/2026.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 76/100
Direzione di ricerca
Leggi src/apm_cli/adapters/client/hermes.py, in particolare _to_hermes_format, ed esamina i test dell’adattatore Hermes. Inizia eseguendo i test mirati sulla formattazione del server, poi aggiungi la copertura per cwd e le chiavi aggiuntive di stdio e per il trasporto SSE remoto. Il lavoro è completato quando la configurazione Hermes generata conserva questi valori continuando a filtrare le chiavi riservate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 4.3k
- Fork
- 415
- Merge medio
- 3g 4h
- PR unite (30g)
- 176
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/apm
-
compilation-target policy check ignores the plural targets: keyForse già presa @MohammedAlkindi l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
require_pinned_constraint rejects [email protected] release tags as bare branchesForse già presa @MohammedAlkindi l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG] Shorthand like git/git or jonas/tig is rejected because rstrip(".git") strips a character setAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
type/automation type/performance
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG] apm compile reports 'Referenced file not found' for links with a #fragmentForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertastatus/accepted
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
microsoft/apm#3255 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di microsoft/apm
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
benchflow-ai/skillsbench#1090 ·
-
Missing unit tests for human-readable date/time formatters in utils/datetime.pyForse già presa @prabhleen2317 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/iceberg-python#4387 ·
I maintainer di solito rispondono entro 1 giorno
-
backend bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NVIDIA/numba-cuda-mlir#467 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
BUG: UserAgentGenerator.generate ignores browser_type and returns a random browser stackForse già presa @HhH666-ux l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno