Skip to main content
Glama

MCP Template

base.py1.77 kB
""" Base registry client interface. """ from abc import ABC, abstractmethod from typing import Any, Dict class RegistryClient(ABC): """ Abstract base class for registry clients. This interface allows different registry backends to be supported by implementing this interface. """ @abstractmethod async def register(self, server_info: Dict[str, Any]) -> Dict[str, Any]: """ Register the MCP server with the registry. Args: server_info: Server information to register Returns: Registration response from registry """ pass @abstractmethod async def deregister(self, server_id: str) -> bool: """ Deregister the MCP server from the registry. Args: server_id: Unique server identifier Returns: True if deregistration was successful """ pass @abstractmethod async def heartbeat(self, server_id: str) -> bool: """ Send heartbeat to maintain registration. Args: server_id: Unique server identifier Returns: True if heartbeat was successful """ pass @abstractmethod async def update_metadata(self, server_id: str, metadata: Dict[str, Any]) -> bool: """ Update server metadata in the registry. Args: server_id: Unique server identifier metadata: Updated metadata Returns: True if update was successful """ pass @abstractmethod async def health_check(self) -> bool: """ Check if registry is accessible. Returns: True if registry is healthy """ pass

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/riteshsonawala/mcp-template'

If you have feedback or need assistance with the MCP directory API, please join our Discord server