Skip to main content
Glama
andresthor

Command-Line MCP Server

by andresthor

get_configuration

Retrieve current configuration settings from the Command-Line MCP Server to access system parameters and operational values.

Instructions

Get the current configuration settings.

Returns: The current configuration settings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler implementation for the 'get_configuration' tool, which retrieves and formats the current configuration settings.
    async def get_configuration() -> dict[str, Any]:
        """
        Get the current configuration settings.
    
        Returns:
            The current configuration settings
        """
        # Get a safe copy of the configuration
        config_copy = self.config.get_all()
    
        # Format it for display
        return {
            "server": config_copy["server"],
            "security": config_copy["security"],
            "commands": {
                "read_count": len(config_copy["commands"]["read"]),
                "write_count": len(config_copy["commands"]["write"]),
                "system_count": len(config_copy["commands"]["system"]),
                "blocked_count": len(config_copy["commands"]["blocked"]),
                "dangerous_patterns_count": len(
                    config_copy["commands"]["dangerous_patterns"]
                ),
                "full_command_lists": config_copy["commands"],
            },
            "output": config_copy["output"],
            "separator_support": self.config.has_separator_support(),
            "directory_whitelisting": {
                "enabled": True,
                "whitelisted_directories": self.whitelisted_directories,
                "note": "Directories not in this list will require session approval",
            },
        }
  • Registration of the get_configuration tool using the server application's tool decorator factory.
    get_configuration_tool = self.app.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/andresthor/cmd-line-mcp'

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