Skip to main content
Glama
wonderwhy-er

Claude Desktop Commander MCP

get_config

Retrieve the full server configuration as JSON, including blocked commands, allowed directories, file read/write limits, telemetry settings, client details, system information, and more.

Instructions

                    Get the complete server configuration as JSON. Config includes fields for:
                    - blockedCommands (array of blocked shell commands)
                    - defaultShell (shell to use for commands)
                    - allowedDirectories (paths the server can access)
                    - fileReadLineLimit (max lines for read_file, default 1000)
                    - fileWriteLineLimit (max lines per write_file call, default 50)
                    - telemetryEnabled (boolean for telemetry opt-in/out)
                    - currentClient (information about the currently connected MCP client)
                    - clientHistory (history of all clients that have connected)
                    - version (version of the DesktopCommander)
                    - systemInfo (operating system and environment details)
                    This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in your instructions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler function for the get_config tool. Fetches server configuration, enriches with system info, memory usage, current client details, and feature flags. Returns formatted JSON text response with error handling.
    export async function getConfig() {
      console.error('getConfig called');
      try {
        const config = await configManager.getConfig();
        
        // Add system information and current client to the config response
        const systemInfo = getSystemInfo();
        
        // Get memory usage
        const memoryUsage = process.memoryUsage();
        const memory = {
          rss: `${(memoryUsage.rss / 1024 / 1024).toFixed(2)} MB`,
          heapTotal: `${(memoryUsage.heapTotal / 1024 / 1024).toFixed(2)} MB`,
          heapUsed: `${(memoryUsage.heapUsed / 1024 / 1024).toFixed(2)} MB`,
          external: `${(memoryUsage.external / 1024 / 1024).toFixed(2)} MB`,
          arrayBuffers: `${(memoryUsage.arrayBuffers / 1024 / 1024).toFixed(2)} MB`
        };
        
        const configWithSystemInfo = {
          ...config,
          currentClient,
          featureFlags: featureFlagManager.getAll(),
          systemInfo: {
            ...systemInfo,
            memory
          }
        };
        
        console.error(`getConfig result: ${JSON.stringify(configWithSystemInfo, null, 2)}`);
        return {
          content: [{
            type: "text",
            text: `Current configuration:\n${JSON.stringify(configWithSystemInfo, null, 2)}`
          }],
        };
      } catch (error) {
        console.error(`Error in getConfig: ${error instanceof Error ? error.message : String(error)}`);
        console.error(error instanceof Error && error.stack ? error.stack : 'No stack trace available');
        // Return empty config rather than crashing
        return {
          content: [{
            type: "text",
            text: `Error getting configuration: ${error instanceof Error ? error.message : String(error)}\nUsing empty configuration.`
          }],
        };
      }
    }
  • src/server.ts:185-204 (registration)
    Tool registration in list_tools handler: defines name 'get_config', detailed description, empty input schema reference, and annotations.
        name: "get_config",
        description: `
                Get the complete server configuration as JSON. Config includes fields for:
                - blockedCommands (array of blocked shell commands)
                - defaultShell (shell to use for commands)
                - allowedDirectories (paths the server can access)
                - fileReadLineLimit (max lines for read_file, default 1000)
                - fileWriteLineLimit (max lines per write_file call, default 50)
                - telemetryEnabled (boolean for telemetry opt-in/out)
                - currentClient (information about the currently connected MCP client)
                - clientHistory (history of all clients that have connected)
                - version (version of the DesktopCommander)
                - systemInfo (operating system and environment details)
                ${CMD_PREFIX_DESCRIPTION}`,
        inputSchema: zodToJsonSchema(GetConfigArgsSchema),
        annotations: {
            title: "Get Configuration",
            readOnlyHint: true,
        },
    },
  • Tool dispatch in call_tool handler: switch case that invokes the getConfig handler function with error catching.
    case "get_config":
        try {
            result = await getConfig();
        } catch (error) {
            capture('server_request_error', { message: `Error in get_config handler: ${error}` });
            result = {
                content: [{ type: "text", text: `Error: Failed to get configuration` }],
                isError: true,
            };
        }
  • Zod input schema for get_config tool (empty object as it takes no parameters). Referenced in server.ts registration.
    export const GetConfigArgsSchema = z.object({});
  • Underlying configManager.getConfig() method called by the tool handler to retrieve the base server configuration.
    async getConfig(): Promise<ServerConfig> {
      await this.init();
      return { ...this.config };
    }
    
    /**
     * Get a specific configuration value
     */
    async getValue(key: string): Promise<any> {
      await this.init();
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes what the tool returns (server configuration as JSON with specific fields) but does not mention potential side effects, permissions required, rate limits, or error conditions. It adds value by detailing the configuration structure but lacks comprehensive behavioral context.

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

Conciseness4/5

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

The description is front-loaded with the core purpose ('Get the complete server configuration as JSON'), followed by a bulleted list of included fields and a note on referencing. The bulleted list is efficient for detailing fields, but the referencing note could be more concise. Overall, it is well-structured with minimal waste.

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

Completeness3/5

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

Given no annotations and no output schema, the description provides good detail on the configuration fields returned, which helps compensate. However, it lacks information on return format (e.g., JSON structure depth), error handling, or operational constraints. For a read-only tool with rich output, this is adequate but has gaps in completeness.

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 input schema has 0 parameters with 100% coverage, so no parameter information is needed. The description appropriately does not discuss parameters, focusing instead on the output content. This meets the baseline of 4 for tools with no parameters, as it avoids unnecessary repetition.

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 ('Get') and resource ('complete server configuration as JSON'), distinguishing it from siblings like 'get_file_info' or 'get_usage_stats'. It explicitly lists the configuration fields included, making the purpose unambiguous and specific.

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

Usage Guidelines3/5

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

The description implies usage by mentioning it can be referenced as 'DC: ...' or 'use Desktop Commander to ...', but it does not explicitly state when to use this tool versus alternatives like 'get_file_info' or 'set_config_value'. No exclusions or prerequisites are provided, leaving usage context inferred rather than explicit.

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

Related 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/wonderwhy-er/DesktopCommanderMCP'

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