haive.mcp.downloader.discovery¶
Server discovery module for finding MCP servers from various sources.
This module provides functionality to discover MCP servers from multiple registries and sources including npm, PyPI, GitHub, and custom registries.
Examples
Basic discovery:
discovery = ServerDiscovery(config) servers = await discovery.discover_all(limit_per_source=10)
Discover from specific source:
servers = await discovery.discover_from_npm(query="mcp server", limit=20)
- Classes:
ServerDiscovery: Main discovery class DiscoveredServer: Information about a discovered server
Version: 1.0.0 Author: Haive MCP Team
Classes¶
Information about a discovered MCP server. |
|
Discovers MCP servers from various sources. |
Module Contents¶
- class haive.mcp.downloader.discovery.DiscoveredServer(/, **data)[source]¶
Bases:
pydantic.BaseModelInformation about a discovered MCP server.
- Parameters:
data (Any)
- name¶
Server name
- source¶
Where it was discovered (npm, github, etc.)
- source_url¶
URL where it was found
- description¶
Server description
- package_name¶
Package name (for npm/pypi)
- repo_url¶
Repository URL (for git)
- author¶
Author/owner name
- version¶
Latest version
- stars¶
GitHub stars or similar metric
- tags¶
Extracted tags
- metadata¶
Additional metadata
Examples
Discovered server info:
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- class haive.mcp.downloader.discovery.ServerDiscovery(config)[source]¶
Discovers MCP servers from various sources.
This class provides methods to discover MCP servers from multiple registries and sources, with support for various search patterns and filtering options.
- config¶
Discovery configuration
- discovered_cache¶
Cache of discovered servers
- session¶
Aiohttp session for HTTP requests
Examples
Using discovery:
Initialize server discovery.
- Parameters:
config (haive.mcp.downloader.config.DiscoveryConfig) – Discovery configuration with sources and patterns
- determine_template(server_data)[source]¶
Determine the appropriate template for a discovered server.
- Parameters:
server_data (dict[str, Any]) – Discovered server information
- Returns:
Template name to use
- Return type:
Examples
Determining template:
- async discover_all(limit_per_source=None)[source]¶
Discover servers from all configured sources.
- Parameters:
limit_per_source (int | None) – Maximum servers to discover per source. Uses config default if not specified.
- Returns:
List of discovered server dictionaries
- Return type:
Examples
Discovering from all sources:
- async discover_from_github(api_url, limit=100)[source]¶
Discover servers from GitHub.
- Parameters:
- Returns:
List of discovered servers
- Return type:
Examples
GitHub discovery:
- async discover_from_npm_registry(registry_url, limit=100)[source]¶
Discover servers from npm registry.
- Parameters:
- Returns:
List of discovered servers
- Return type:
Examples
NPM discovery:
- async discover_from_url(url, limit=100)[source]¶
Discover servers from a generic URL (e.g., README).