Skip to main content
Glama
r3-yamauchi

MCP Configuration Editor

by r3-yamauchi

list_servers

Display all configured MCP servers and their configuration file paths for AWS Q Developer and Claude Desktop.

Instructions

設定されている全てのMCPサーバーをリスト表示する。

Returns:
    Dict[str, Any]: サーバーのリストと設定ファイルのパスを含む辞書
        - servers: 各サーバーの設定情報のリスト
        - config_path: 設定ファイルのパス

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_servers' tool. Decorated with @mcp.tool(name="list_servers"), it loads the MCP configuration using load_config() and returns a dictionary containing the list of servers and the config file path.
    @mcp.tool(name="list_servers")
    async def list_servers() -> Dict[str, Any]:
        """設定されている全てのMCPサーバーをリスト表示する。
    
        Returns:
            Dict[str, Any]: サーバーのリストと設定ファイルのパスを含む辞書
                - servers: 各サーバーの設定情報のリスト
                - config_path: 設定ファイルのパス
        """
        config = load_config()
    
        # 各サーバーの情報をリスト化
        servers = []
        for name, server_config in config.mcpServers.items():
            servers.append(
                {"name": name, "command": server_config.command, "args": server_config.args, "env": server_config.env}
            )
    
        return {"servers": servers, "config_path": str(CONFIG_PATH)}
  • Pydantic model defining the structure of the MCP configuration file, used by list_servers to parse and validate the config data.
    class MCPConfig(BaseModel):
        """mcp.json設定ファイルの構造を表すモデル。
    
        Attributes:
            mcpServers: サーバー名をキーとし、ServerConfigを値とする辞書
        """
    
        mcpServers: Dict[str, ServerConfig] = Field(default_factory=dict)
  • Pydantic model for individual server configurations, used within MCPConfig for validation in list_servers.
    class ServerConfig(BaseModel):
        """MCPサーバーの設定を表すモデル。
    
        Attributes:
            command: 実行するコマンド(例: "python", "uvx", "node")
            args: コマンドライン引数のリスト
            env: 環境変数の辞書(オプション)
        """
    
        command: str
        args: list[str] = Field(default_factory=list)
        env: Optional[Dict[str, str]] = None
  • Helper function to load and validate the MCP configuration file, called by list_servers.
    def load_config() -> MCPConfig:
        """現在のMCP設定を読み込む。
    
        設定ファイルが存在しない場合や読み込みエラーが発生した場合は、
        空の設定を返します。
    
        Returns:
            MCPConfig: 読み込まれた設定、またはデフォルトの空設定
        """
        if not CONFIG_PATH.exists():
            # 設定ファイルが存在しない場合は空の設定を返す
            logger.info(f"Configuration file not found at {CONFIG_PATH}")
            return MCPConfig()
    
        try:
            with open(CONFIG_PATH, "r") as f:
                data = json.load(f)
            config = MCPConfig(**data)
            logger.debug(f"Loaded configuration with {len(config.mcpServers)} servers")
            return config
        except json.JSONDecodeError as e:
            logger.error(f"Failed to parse JSON configuration: {e}")
            # エラーが発生した場合も空の設定を返す(既存の設定を破壊しない)
            return MCPConfig()
        except ValidationError as e:
            logger.error(f"Configuration validation failed: {e}")
            return MCPConfig()
        except Exception as e:
            logger.error(f"Unexpected error loading configuration: {e}")
            return MCPConfig()
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It clearly indicates this is a read-only operation (listing/displaying) and provides valuable behavioral context about the return format (dictionary with servers list and config path). This goes beyond what the empty input schema provides, though it doesn't mention potential limitations like pagination or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly structured: a clear purpose statement followed by detailed return format documentation. Every sentence earns its place - the first explains what the tool does, the second explains what it returns. No wasted words or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter read operation with no output schema, the description provides excellent context: clear purpose, behavioral transparency about being a listing operation, and detailed return format. The only minor gap is the lack of explicit guidance on when to use versus sibling tools, but overall it's quite complete for this tool's complexity level.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage (empty schema). The description appropriately doesn't discuss parameters since none exist, which is correct for a zero-parameter tool. No additional parameter semantics are needed beyond the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('リスト表示する' - list display) and resource ('設定されている全てのMCPサーバー' - all configured MCP servers). It distinguishes itself from siblings like get_server (which retrieves a specific server) and add_server/remove_server/update_server (which modify servers).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying '設定されている全ての' (all configured), suggesting this is for viewing all servers rather than filtering or modifying. However, it doesn't explicitly state when to use this versus alternatives like get_server for a specific server or validate_config for configuration validation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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