mcp.registry ============ .. py:module:: mcp.registry .. autoapi-nested-parse:: Registry Management for MCP Servers. This module provides comprehensive tools for managing the MCP server registry, supporting the transition from Git-based to NPM package-based server distribution. Key Features ------------ **Server Registry Management** - Converting GitHub repositories to npm package format - Validating npm package existence and compatibility - Organizing servers into logical categories - Expanding the registry from the 1900+ server database **Phase 3+ Implementation** The registry system supports Phase 3+ of the MCP implementation plan, focusing on package-based installation rather than Git cloning for improved reliability and performance. Available Classes ----------------- Server Management ~~~~~~~~~~~~~~~~~ - :class:`ServerConverter` - Convert GitHub repos to npm packages - :class:`ServerConverterConfig` - Configuration for server conversion Registry Operations ~~~~~~~~~~~~~~~~~~~ - **Package Validation**: Verify npm package existence - **Category Organization**: Logical server grouping - **Database Expansion**: Scale from existing server collections Usage Example ------------- .. code-block:: python from haive.mcp.registry import ServerConverter # Convert GitHub repo to npm package converter = ServerConverter() package_info = converter.convert_repo_to_package( "github.com/user/mcp-server", category="development" ) .. seealso:: - :mod:`haive.mcp.downloader` for package installation - :mod:`haive.mcp.discovery` for server discovery Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/mcp/registry/server_converter/index Classes ------- .. autoapisummary:: mcp.registry.NPMPackageValidator mcp.registry.ServerConversion mcp.registry.ServerConverter Package Contents ---------------- .. py:class:: NPMPackageValidator Validates whether npm packages exist and are installable. .. py:method:: __aenter__() :async: .. py:method:: __aexit__(*args) :async: .. py:method:: package_exists(package_name: str) -> bool :async: Check if an npm package exists. .. py:method:: validate_batch(package_names: List[str]) -> Dict[str, bool] :async: Validate multiple packages in parallel. .. py:attribute:: session :type: Optional[aiohttp.ClientSession] :value: None .. py:class:: ServerConversion Result of converting a GitHub server to npm package format. .. py:attribute:: category_guess :type: Optional[str] :value: None .. py:attribute:: confidence :type: float :value: 0.0 .. py:attribute:: github_url :type: str .. py:attribute:: potential_npm_packages :type: List[str] .. py:attribute:: validated_package :type: Optional[str] :value: None .. py:class:: ServerConverter Converts server entries from GitHub format to npm package format. .. py:method:: convert_batch(server_entries: List[Dict]) -> List[ServerConversion] :async: Convert multiple server entries in parallel. .. py:method:: convert_github_to_npm_candidates(github_url: str) -> List[str] Convert a GitHub URL to potential npm package names. .. py:method:: convert_server_entry(github_url: str, description: str = '') -> ServerConversion :async: Convert a single server entry. .. py:method:: create_registry_categories(conversions: List[ServerConversion]) -> Dict[str, List[str]] Create registry categories from validated conversions. .. py:method:: guess_category(server_name: str, description: str = '') -> Optional[str] Guess the category based on server name and description. .. py:attribute:: category_mapping .. py:attribute:: conversion_patterns :value: [('github\\.com/modelcontextprotocol/server-(\\w+)', '@modelcontextprotocol/server-\\1'),... .. py:attribute:: validator