Package com.tnsai.mcp.registry
Class CamelMcpHubClient
java.lang.Object
com.tnsai.mcp.registry.CamelMcpHubClient
- All Implemented Interfaces:
McpRegistrySource
Registry client for the Camel MCP Hub at mcp.camel-ai.org.
Fetches MCP server metadata from the Camel AI MCP Hub registry. The HTTP fetch is performed via a protected method that can be overridden in tests.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a CamelMcpHubClient with default HTTP client.CamelMcpHubClient(HttpClient httpClient) Creates a CamelMcpHubClient 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
-
CamelMcpHubClient
public CamelMcpHubClient()Creates a CamelMcpHubClient with default HTTP client. -
CamelMcpHubClient
Creates a CamelMcpHubClient 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
-