mcp.registryΒΆ

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ΒΆ

  • ServerConverter - Convert GitHub repos to npm packages

  • 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ΒΆ

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"
)

See also

SubmodulesΒΆ

ClassesΒΆ

NPMPackageValidator

Validates whether npm packages exist and are installable.

ServerConversion

Result of converting a GitHub server to npm package format.

ServerConverter

Converts server entries from GitHub format to npm package format.

Package ContentsΒΆ

class mcp.registry.NPMPackageValidatorΒΆ

Validates whether npm packages exist and are installable.

async __aenter__()ΒΆ
async __aexit__(*args)ΒΆ
async package_exists(package_name: str) boolΒΆ

Check if an npm package exists.

async validate_batch(package_names: List[str]) Dict[str, bool]ΒΆ

Validate multiple packages in parallel.

session: aiohttp.ClientSession | None = NoneΒΆ
class mcp.registry.ServerConversionΒΆ

Result of converting a GitHub server to npm package format.

category_guess: str | None = NoneΒΆ
confidence: float = 0.0ΒΆ
github_url: strΒΆ
potential_npm_packages: List[str]ΒΆ
validated_package: str | None = NoneΒΆ
class mcp.registry.ServerConverterΒΆ

Converts server entries from GitHub format to npm package format.

async convert_batch(server_entries: List[Dict]) List[ServerConversion]ΒΆ

Convert multiple server entries in parallel.

convert_github_to_npm_candidates(github_url: str) List[str]ΒΆ

Convert a GitHub URL to potential npm package names.

async convert_server_entry(github_url: str, description: str = '') ServerConversionΒΆ

Convert a single server entry.

create_registry_categories(conversions: List[ServerConversion]) Dict[str, List[str]]ΒΆ

Create registry categories from validated conversions.

guess_category(server_name: str, description: str = '') str | NoneΒΆ

Guess the category based on server name and description.

category_mappingΒΆ
conversion_patterns = [('github\\.com/modelcontextprotocol/server-(\\w+)', '@modelcontextprotocol/server-\\1'),...ΒΆ
validatorΒΆ