Skip to main content
Glama
mcp_protocol.py1.2 kB
"""Protocol definition for MCP server interface.""" from typing import Any, Callable, Protocol class MCPServer(Protocol): """Protocol for MCP server tool registration. This protocol defines the interface that MCP servers must implement for tool registration. It allows for type-safe tool definitions while remaining decoupled from specific MCP implementations. """ def tool( self, name: str | None = None, title: str | None = None, description: str | None = None, annotations: Any = None, icons: Any = None, structured_output: bool | None = None, ) -> Callable[[Callable[..., Any]], Callable[..., Any]]: """Register a tool with the MCP server. Args: ---- name: Optional tool name. title: Optional tool title. description: Optional description of the tool's functionality. annotations: Optional tool annotations. icons: Optional tool icons. structured_output: Optional structured output flag. Returns: ------- Callable: Decorator function that registers the tool. """ ...

Latest Blog Posts

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/arcaputo3/mcp-server-whisper'

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