`McpServer.toolkit` should not hoist tool dependencies into the registration step
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
What is the problem this feature would solve?
The fix made in https://github.com/Effect-TS/effect/pull/8842 exposes a problem with the design of McpServer.toolkit that went previously unnoticed in our usage of the function: That we must provide all tool dependencies during layer construction.
Our tools have runtime dependencies that are supplied by the request (a user session, etc) and cannot be met earlier. Previously, these requirements went unmet during layer construction, and were then met without problem during tool execution.
Now, no mechanism exists to mark dependencies as execution dependencies, and so we cannot construct our McpServer layer any more.
What is the feature you are proposing to solve the problem?
MCP registration needs a way to defer dependencies to invocation time. Either through router-style markers such as Request<"Requires", Session>, or an option passed during construction of the toolkit registration layer: McpServer.toolkit(MyToolkit, { executionDependencies: [Session] }). Those dependencies should remain requirements of the request handler rather than of server construction.
What alternatives have you considered?
- Optional service lookup: hides a mandatory dependency and replaces compile-time safety with a runtime failure.
- Custom
toHttpEffectadapter: works in a prototype, but this needs a type assertion, and relies on registration not actually reading the dependency during construction. - Request-local server construction: satisfies dependencies honestly, but requires changing our sessionful protocol choice (
McpProtocol.v2025_11_25) and legacy elicitation flow. Generally, constructing a whole MCP server on every request seems like a bad idea, but it's the only non-hacky solution that the current API design pushes us to. - Custom RPC/Toolkit integration: preserves explicit execution requirements, but means taking over substantial MCP transport and lifecycle handling.
- Lingua principale
- TypeScript
- Stelle
- 16.7k
- Fork
- 808
- Merge medio
- 10h 14m
- PR unite (30g)
- 625
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 Effect-TS/effect
-
BrowserWorkerRunner: port finalizer throws when the worker global has no close() (Bun)Forse già presa @santiago-ramos-02 l’ha presa 15 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Effect-TS/effect#8635 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Support {self: this} for fnUntracedForse di nuovo libera @ArjunCodess l’ha presa 26 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Effect-TS/effect#8101 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
WorkflowEngine.layerMemory: `withCompensation` runs the compensation once per workflow run when a replayed workflow failsForse già presa @effect-bot l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
Effect-TS/effect#9058 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
add Effect-native McpClientForse già presa @lloydrichards l’ha presa 9 giorni fa. Apertaenhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 8/100
Effect-TS/effect#8912 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Effect-TS/effect
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
xdjs/MusicNerdWeb#1532 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
sebastian-software/ardo#352 ·
I maintainer di solito rispondono entro 1 giorno
-
@react95/core good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 3 giorni
-
@shikijs/stream: `ShikiStreamTokenizer.clone()` shares its `tokensStable` array with the originalForse già presa @xyrolle l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 6 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno