No way to forward a static Authorization header to a local container-backed MCP server (SSE readiness probe always 401)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 22/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- docker, go
- Ambito
- authentication, backend
Direzione di ricerca
Start from waitForInitializeSuccess, the readiness probe that sends an unauthenticated GET and accepts only HTTP 200, and from the local proxy path that forwards requests to container-backed workloads. Compare with the existing --remote-forward-headers and --remote-forward-headers-secret handling for remote servers, and the vMCP passthroughHeaders discussion in #6523 and #6394. Done means the design decides where static headers are configured and applied to both the probe and forwarded requests, which needs maintainer input first.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
ToolHive cannot proxy a local (non-remote) container-backed MCP server that requires a static Bearer token on its protocol endpoints. The SSE/streamable-HTTP readiness probe (waitForInitializeSuccess) sends an unauthenticated GET to the proxied backend and only accepts HTTP 200 — so a backend whose MCP endpoints are behind an auth gate (e.g. Crawl4AI 0.9.x AuthGateMiddleware) never becomes "ready" and the workload stays stuck in initializing until the 5m timeout (initialize not successful).
Repro
Crawl4AI 0.9.4 (see unclecode/crawl4ai, fail-closed AuthGateMiddleware): every MCP endpoint (/sse, /mcp/sse, /messages) requires Authorization: Bearer $CRAWL4AI_API_TOKEN. ToolHive probe hits http://localhost:<proxy>/sse without a token → always HTTP 401 → workload never ready.
- Probe log:
Still waiting for MCP server to be ready ... last_observed: "HTTP 401"theninitialize not successful after 5m0s (154 attempts, last observed: HTTP 401).
What's missing
A way to tell ToolHive the static credential it should attach to every request it forwards to the (local) backend. Related work exists but only for remote servers and vMCP:
--remote-forward-headers/--remote-forward-headers-secret→ only forremoteservers, not localimage:-backed workloads.- #6523 / #6394 → vMCP
passthroughHeaders— rejected forAuthorization/Cookiewithout an opt-in, and not applicable to the plain local proxy path.
Expected behavior
Optionally attach static headers (e.g. Authorization: Bearer <token> from ToolHive secrets) to the readiness probe and to forwarded MCP requests for local container-backed workloads — so token-protected backends like Crawl4AI 0.9.x can be proxied directly without a custom stdio bridge.
Workaround used
A custom pinned image that runs a stdio bridge in the foreground (the bridge carries the token itself) and is started with --transport stdio. This works but forces every token-protected backend to ship a custom bridge.
Environment
- ToolHive v0.50.0 (Linux, Docker)
- Crawl4AI 0.9.4 (token-protected SSE backend)
- Lingua principale
- Go
- Stelle
- 2.3k
- Fork
- 318
- Merge medio
- 2g 8h
- PR unite (30g)
- 79
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 stacklok/toolhive
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
proxyrunner tool-filter middleware strips SEP-2322 Modern envelope from tools/list, breaking vMCP health checksForse già presa @alex-feel l’ha presa 24 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
stacklok/toolhive#6684 · 5 commenti · 1 reazione · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
HttpClientBuilder.Build() ignores HTTP(S)_PROXY (auth-server OAuth/DCR calls bypass forward proxy)Forse già presa @schonmann l’ha presa 15 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
stacklok/toolhive#6671 · 2 commenti · 1 reazione · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
`thv run` ignores `--oidc-insecure-allow-http` and `--thv-ca-bundle` — both dropped in `createOIDCConfig` (same as #1470)Forse già presa @7487 l’ha presa 41 giorni fa. Apertaauthentication bug cli oidc p1
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
stacklok/toolhive#6522 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di stacklok/toolhive
Issue simili
-
agent-review-finding chore
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
jordansmall/spindrift#5748 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Resource links written as host:port without a scheme are brokenForse già presa @RaphaelFakhri l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Proxy ignores l5d-retry-http and l5d-retry-grpc conditions that follow a comma and spaceForse già presa @RaphaelFakhri l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 3 giorni
-
needs_triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 2 giorni