Package com.tnsai.mcp.registry
Class McpServersOrgClient
java.lang.Object
com.tnsai.mcp.registry.McpServersOrgClient
- All Implemented Interfaces:
McpRegistrySource
Registry client for mcpservers.org directory.
Fetches MCP server metadata from the mcpservers.org community directory. The HTTP fetch is performed via a protected method that can be overridden in tests.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an McpServersOrgClient with default HTTP client.McpServersOrgClient(HttpClient httpClient) Creates an McpServersOrgClient with a custom HTTP client. -
Method Summary
Modifier and TypeMethodDescriptionLooks up a specific server by name.Returns the name of this registry source.listAll()Lists all available servers from this registry.Searches the registry for servers matching the given query.
-
Constructor Details
-
McpServersOrgClient
public McpServersOrgClient()Creates an McpServersOrgClient with default HTTP client. -
McpServersOrgClient
Creates an McpServersOrgClient with a custom HTTP client.- Parameters:
httpClient- the HTTP client to use
-
-
Method Details
-
getSourceName
Description copied from interface:McpRegistrySourceReturns the name of this registry source.- Specified by:
getSourceNamein interfaceMcpRegistrySource- Returns:
- source name (e.g. "official", "smithery", "mcpservers.org", "camel")
-
search
Description copied from interface:McpRegistrySourceSearches the registry for servers matching the given query.- Specified by:
searchin interfaceMcpRegistrySource- Parameters:
query- search query string- Returns:
- list of matching server entries
- Throws:
IOException- if the registry cannot be reached
-
getServer
Description copied from interface:McpRegistrySourceLooks up a specific server by name.- Specified by:
getServerin interfaceMcpRegistrySource- Parameters:
name- the server name- Returns:
- the server entry if found
- Throws:
IOException- if the registry cannot be reached
-
listAll
Description copied from interface:McpRegistrySourceLists all available servers from this registry.- Specified by:
listAllin interfaceMcpRegistrySource- Returns:
- list of all server entries
- Throws:
IOException- if the registry cannot be reached
-