Skip to main content
Glama

dev-kit-mcp-server

custom_fastmcp.py1.18 kB
"""Custom FastMCP and Tool classes with extended functionality for repository operations.""" from typing import Any from fastmcp import FastMCP from fastmcp.tools import Tool from fastmcp.tools.tool import ToolResult from mcp.types import TextContent class RepoTool(Tool): """Custom tool class for RepoTool.""" async def run(self, arguments: dict[str, Any]) -> ToolResult: """Run the tool with arguments. Args: arguments: Dictionary of arguments to pass to the tool Returns: A ToolResult containing the tool's output or error message """ try: # Call the original run method result = await super().run(arguments) return result except Exception as e: # Handle exceptions and return an error message return ToolResult(content=[TextContent(text=f"Error: {str(e)}", type="text")]) class RepoFastMCPServerError(FastMCP): """Extended FastMCP class with additional tool management functionality.""" def add_fast_tool(self, tool: Tool) -> None: """Add a tool to the server.""" self._tool_manager.add_tool(tool)

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/DanielAvdar/dev-kit-mcp-server'

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