Class McpClientRegistration

java.lang.Object
com.tnsai.mcp.auth.McpClientRegistration

public class McpClientRegistration extends Object
RFC 7591 Dynamic Client Registration for MCP OAuth.

Enables MCP clients to dynamically register with an OAuth authorization server without manual client registration. This is useful for public MCP clients that need to authenticate with servers discovered at runtime.

Usage:


 RegistrationRequest request = new RegistrationRequest(
     "TnsAI MCP Client",
     List.of("http://localhost:8080/callback"),
     List.of("authorization_code"),
     List.of("code"),
     "none"
 );

 RegistrationResponse response = McpClientRegistration.register(
     "https://auth.example.com/register",
     request
 );

 String clientId = response.clientId();
 
See Also:
  • Constructor Details

    • McpClientRegistration

      public McpClientRegistration()
  • Method Details