haive.mcp.self_query

Self-query interface for MCP server discovery.

Provides an interactive textual interface for querying the MCP server database, searching by capability, category, or free-text, and getting installation instructions for discovered servers.

Usage:

poetry run python -m haive.mcp discover poetry run python -m haive.mcp self-query

Classes

MCPSelfQuery

Self-query engine for the MCP server database.

Functions

run_interactive()

Run the interactive self-query interface with install support.

Module Contents

class haive.mcp.self_query.MCPSelfQuery(loader=None)[source]

Self-query engine for the MCP server database.

Provides search, filtering, and detail retrieval for the 1,960+ MCP servers in the pre-indexed database.

Parameters:

loader (haive.mcp.documentation.doc_loader.MCPDocumentationLoader | None)

get_categories()[source]

Get all server categories with counts.

Returns:

Dictionary mapping category names to server counts

Return type:

dict[str, int]

get_server_detail(name)[source]

Get detailed information about a specific server.

Enriches the server with data from its individual document file (full README, description, stars, derived install command).

Parameters:

name (str) – Server name (exact or partial match)

Returns:

Server detail dictionary or None

Return type:

dict[str, Any] | None

search(query, limit=20)[source]

Search servers by free-text query.

Searches across name, description, category, and source fields.

Parameters:
  • query (str) – Search query string

  • limit (int) – Maximum results to return

Returns:

List of matching server documents, sorted by relevance

Return type:

list[dict[str, Any]]

property server_count: int

Total number of servers in the database.

Return type:

int

haive.mcp.self_query.run_interactive()[source]

Run the interactive self-query interface with install support.