Skip to main content
Glama
base.py734 B
"""Base class for tool modules in the MCP system.""" from abc import ABC, abstractmethod from typing import Any import structlog from fastmcp import FastMCP from ceph_mcp.models.base import MCPResponse class ToolModule(ABC): """Simple base class for tool modules.""" def __init__(self, mcp: FastMCP, name: str): self.mcp = mcp self.name = name self.logger = structlog.get_logger(f"tools.{name}") # Register tools when created self.register_tools() @abstractmethod def register_tools(self) -> None: """Register tools with FastMCP.""" @abstractmethod def format_response(self, response: MCPResponse) -> str: """Format response for this module."""

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/rajmohanram/ceph-mcp-server'

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