mcp.registry.server_converter ============================= .. py:module:: mcp.registry.server_converter .. autoapi-nested-parse:: Server Registry Converter for Phase 3+. This module converts GitHub-based server entries from the 1900+ server database into npm package format for the MCP Manager registry. Features: - Converts GitHub URLs to potential npm package names - Validates npm package existence - Generates category mappings - Creates installable server lists Usage: from haive.mcp.registry.server_converter import ServerConverter converter = ServerConverter() # Convert known patterns npm_packages = await converter.convert_github_to_npm_batch([ "https://github.com/modelcontextprotocol/server-time", "https://github.com/some-org/mcp-server-custom" ]) # Validate packages exist on npm valid_packages = await converter.validate_npm_packages(npm_packages) Attributes ---------- .. autoapisummary:: mcp.registry.server_converter.logger Classes ------- .. autoapisummary:: mcp.registry.server_converter.NPMPackageValidator mcp.registry.server_converter.ServerConversion mcp.registry.server_converter.ServerConverter Functions --------- .. autoapisummary:: mcp.registry.server_converter.main Module 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 .. py:function:: main() :async: Example usage of ServerConverter. .. py:data:: logger