`McpServer.toolkit` should not hoist tool dependencies into the registration step
Los mantenedores suelen responder en 1 día
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 16.7k
- Forks
- 808
- Merge medio
- 9 h 42 min
- PR fusionados (30 d)
- 669
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Effect-TS/effect
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
BrowserWorkerRunner: port finalizer throws when the worker global has no close() (Bun)Posiblemente ocupada @santiago-ramos-02 la tomó hace 16 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Effect-TS/effect#8635 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Support {self: this} for fnUntracedQuizá libre de nuevo @ArjunCodess la tomó hace 28 días y no hay ningún pull request abierto. Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Effect-TS/effect#8101 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 Medio día Aptitud para principiantes 52/100
Los mantenedores suelen responder en 1 día
Todos los issues de Effect-TS/effect
Issues similares
-
bug engine
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
frostney/GocciaScript#1746 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
agilepathway/label-checker#739 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Wrong key location at startupAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
CopilotKit/OpenBot#800 ·
Los mantenedores suelen responder en 1 día
-
Endpoint links in the tag operations list are below the 24px target sizePosiblemente ocupada @AdzerKI la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
ehmpathy/rhachet-roles-bhuild#471 ·
Los mantenedores suelen responder en 1 día