Class OfficialRegistryClient

java.lang.Object
com.tnsai.mcp.registry.OfficialRegistryClient
All Implemented Interfaces:
McpRegistrySource

public class OfficialRegistryClient extends Object implements McpRegistrySource
Registry client for the official MCP registry at registry.modelcontextprotocol.io.

Fetches MCP server metadata from the official Model Context Protocol registry using its HTTP API. Responses are parsed from JSON into McpServerEntry records.

The HTTP fetch is performed via a protected method (fetchJson(String)) that can be overridden in tests to return canned responses.

  • Constructor Details

    • OfficialRegistryClient

      public OfficialRegistryClient()
      Creates an OfficialRegistryClient with default HTTP client.
    • OfficialRegistryClient

      public OfficialRegistryClient(HttpClient httpClient)
      Creates an OfficialRegistryClient with a custom HTTP client.
      Parameters:
      httpClient - the HTTP client to use
  • Method Details