Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

`McpServer.toolkit` should not hoist tool dependencies into the registration step

Cerrado
#9,114 1 comentario 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@effect-bot ya está trabajando en esto.

Desde el 13/10/2026.

  • #9154 de @effect-bot — fusionado

Evaluación

Este issue todavía no se ha evaluado.

Descripción

enhancement
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 toHttpEffect adapter: 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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Effect-TS/effect

Todos los issues de Effect-TS/effect

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.