Skip to content

Add local cache to McpAsyncClient.listTools() #456

@johnyannj

Description

@johnyannj

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

Expected Behavior
McpAsyncClient caches tools locally, there is no need to request the MCP server every time.

Current Behavior

Every time McpAsyncClient. listTools() is called, an HTTP request is sent, but the probability of tool changes is very small, which is very wasteful.

Context
Add a parameter “cache=true” to McpAsyncClient to automatically cache the tool list, and periodically request MCP Server to refresh the cache, or refresh the local cache through the notify mechanism.

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