Skip to content

Support filtering tools depends on request data (http-headers, etc) #608

@linarkou

Description

@linarkou

Please do a quick search on GitHub issues first, the feature you are about to request might have already been requested.

Expected Behavior

There is no way to filter available tools in toolsListRequestHandler() and toolsCallRequestHandler()
I would like to filter tools to specific clients depending on some data in http-headers.

Current Behavior

There is no way to filter tools dynamically. The only way to do it - inherit McpAsyncServer, and use same package io.modelcontextprotocol.server - because McpServerFeatures.Async used in constructor is package-private. So maybe also make McpServerFeatures.Async public?

Context

I would like to implement authorization to be able to restrict tool calls to specific clients.

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