mcp_registry_client.commands.search
Search command implementation.
SearchCommand
Bases: BaseCommand
Command to search for MCP servers in the registry.
Source code in mcp_registry_client/commands/search.py
__init__(args)
Initialize search command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args
|
Namespace
|
Parsed command line arguments containing 'name' and 'json' |
required |
execute()
async
Execute the search command.
Returns:
| Type | Description |
|---|---|
SearchResponse
|
Search result from the registry client |
Raises:
| Type | Description |
|---|---|
RegistryAPIError
|
If API request fails |
RegistryClientError
|
If client processing fails |
RequestError
|
If HTTP request fails |
ValidationError
|
If response validation fails |
Source code in mcp_registry_client/commands/search.py
format_output(result)
Format and display search results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
SearchResponse
|
Search result containing servers list |
required |
Source code in mcp_registry_client/commands/search.py
validate_args()
Validate search command arguments.
Raises:
| Type | Description |
|---|---|
ValueError
|
If search term is invalid |