Interface McpClientAuthProvider


public interface McpClientAuthProvider
MCP client authentication providers can be used to supply credentials such as access tokens, API keys, and other type of credentials.

Providers which support a specific named MCP Client only must be annotated with a McpClientName annotation.

  • Method Details

    • getAuthorization

      String getAuthorization(McpClientAuthProvider.Input input)
      Provide authorization data which will be set as an HTTP Authorization header value.
      Parameters:
      input - representation of an HTTP request to the model provider.
      Returns:
      authorization data which must include an HTTP Authorization scheme value, for example: "Bearer the_access_token". Returning null will result in no Authorization header being set.
    • resolve

      static Optional<McpClientAuthProvider> resolve(String mcpClientName)
      Resolve McpClientAuthProvider.
      Parameters:
      mcpClientName - the MCP client name. If it is not null then a McpClientAuthProvider with a matching McpClientName annotation are preferred to a global McpClientAuthProvider.
      Returns:
      Resolved McpClientAuthProvider as an Optional value which will be empty if no McpClientAuthProvider is available.