Skip to content

ServerHandler defaults answer prompts/list and completion/complete when neither capability is declared #1445

Open

Description

@tlinkin

In rmcp 3.9.0 (and on main), the default ServerHandler::list_prompts answers Ok(ListPromptsResult::default()) and the default complete answers Ok(CompleteResult::default()) (crates/rmcp/src/handler/server.rs), while get_prompt, set_level and subscribe default to method_not_found.

So a server whose get_info() declares neither the prompts nor the completions capability still answers prompts/list with {"prompts":[]} and completion/complete with {"completion":{"values":[]}}.

Why it matters

  • Spec 2026-07-28, Prompts: servers that support prompts MUST declare the prompts capability; its error handling lists -32601 for a capability not supported.
  • Spec 2025-11-25, Lifecycle: both parties MUST only use capabilities that were successfully negotiated.
  • The conformance suite (0.2.0-alpha.12) check sep-2575-server-declares-prompts-in-discover fails such a server ("Server handles prompts but does not declare the prompts capability").

Suggestion

Default both to method_not_found unless the matching capability is declared in get_info(), as validate_tasks_capability already does for tasks. list_resources, list_resource_templates and list_tools have the same Ok(default) defaults and may deserve the same treatment.

Workaround

Override list_prompts and complete to return Err(McpError::method_not_found::<…>()).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions