Skip to content

feat: Add support for meta parameter to list tools call( paginated request already support meta field). #907

@smohite04

Description

@smohite04

Expected Behavior

McpSyncClient and McpAsyncClient should provide support for passing meta parameter or to expose overloaded paginated list methods that accept a meta parameter, consistent with the Python SDK:

java
client.listTools(String cursor, Map<String, Object> meta)

Current Behavior

McpSchema.PaginatedRequest now has a meta field (added in #344), but listTools
only accepts a cursor string with no way to pass _meta. Due to this, the meta field though supported in request cannot be passed via client for listTools call. Note: The Python SDK already supports this: list_tools(cursor=None, meta=None).

Context

  • How has this issue affected you? When building an MCP server that needs
    to pass authentication data via _meta in tools/list requests, Java clients have
    no way to include this metadata even though the schema supports it.

  • What are you trying to accomplish? Pass request-scoped metadata in tools/list calls from Java MCP clients,
    consistent with what the Python SDK already supports.

  • What other alternatives have you considered? Using a lower-level transport layer to manually construct the JSON-RPC request, but this bypasses the SDK's client abstraction entirely.

  • Are you aware of any workarounds? No clean workaround exists within the SDK API. The only option is to bypass McpSyncClient/McpAsyncClient and send raw JSON-RPC messages directly.

A PR with the implementation is available:PR #906

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