Completions follow-ups

Abierto
#1,318 5 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@weiwastron ya está trabajando en esto.

Desde el 16/11/2026.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java

Línea de trabajo

Read the follow-up items alongside the #1316 review, then trace CompletionsFeature.handle, CompleteReference, McpFeature.completionRefTypes(), and ResourcesFeature.complete. Check the completion tests for missing-type refs, custom ref types, and concrete resource URIs; compare the resource behavior with the legacy McpAsyncServer. Confirm the intended concrete-resource behavior before treating that item as done.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

waiting for user

Follow-ups from the review of #1316. Each item can go in its own small PR.

  1. A ref without type returns an internal error instead of invalid params. CompletionsFeature.handle looks up byRefType.get(ref.get("type")). byRefType comes from Map.copyOf, and get(null) on an immutable map throws an NPE, so a request like {"ref": {"name": "x"}, ...} gets -32603 instead of -32602.

  2. McpFeature.completionRefTypes() can't serve a new reference type. CompletionsFeature decodes every request into CompleteRequest before calling feature.complete(...). CompleteReference only lists ref/prompt and ref/resource in @JsonSubTypes, so a feature that declares ref/custom is advertised and routed to, but decoding fails with -32602 "Malformed CompleteRequest" before complete() runs. Today a custom feature can only take over one of the two built-in types. Either remove the extension point until there's a use case, or let complete() take the raw params, as handle() does.

  3. ref/resource with a concrete resource URI is rejected. ResourcesFeature.complete only resolves ref/resource through an exact findTemplate match, so a reference to an existing resource such as test://static-text gets -32602 "Unknown resource template". The legacy McpAsyncServer returns an empty completion here, so the two server stacks now differ. Confirm if this is intentional

Lenguaje dominante
Java
Estrellas
3.8k
Forks
1.1k
Merge medio
1 d 3 h
PR fusionados (30 d)
38

Preparar el entorno

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 modelcontextprotocol/java-sdk

Todos los issues de modelcontextprotocol/java-sdk

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.