Skip to main content
Glama
r3-yamauchi

MCP Configuration Editor

by r3-yamauchi

remove_server

Delete MCP server configurations from AWS Q Developer and Claude Desktop to manage your server list effectively.

Instructions

MCPサーバー設定を削除する。

Args:
    name: 削除するサーバーの名前

Returns:
    Dict[str, Any]: 成功メッセージと残りのサーバーリスト、またはエラー情報

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Implementation Reference

  • The main handler function for the 'remove_server' tool. It loads the MCP configuration, checks if the server exists, deletes it from the config, saves the updated config (with backup), and returns success or error details. Registered via the @mcp.tool decorator.
    @mcp.tool(name="remove_server")
    async def remove_server(name: str) -> Dict[str, Any]:
        """MCPサーバー設定を削除する。
    
        Args:
            name: 削除するサーバーの名前
    
        Returns:
            Dict[str, Any]: 成功メッセージと残りのサーバーリスト、またはエラー情報
        """
        config = load_config()
    
        if name not in config.mcpServers:
            # サーバーが見つからない場合はエラーを返す
            logger.warning(f"Attempted to remove non-existent server: {name}")
            return {"error": f"Server '{name}' not found", "available_servers": list(config.mcpServers.keys())}
    
        # サーバーを削除して保存
        del config.mcpServers[name]
    
        try:
            save_config(config)
            logger.info(f"Successfully removed server: {name}")
            return {"message": f"Server '{name}' removed successfully", "remaining_servers": list(config.mcpServers.keys())}
        except Exception as e:
            logger.error(f"Failed to save configuration after removing server {name}: {e}")
            return {"error": f"Failed to save configuration: {str(e)}", "hint": "Check file permissions and disk space"}

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/r3-yamauchi/mcp-conf-mcp-server'

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