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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/config.ts:10-56 (handler)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, }, },
- src/server.ts:1099-1108 (registration)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, }; }
- src/tools/schemas.ts:4-4 (schema)Zod input schema for get_config tool (empty object as it takes no parameters). Referenced in server.ts registration.export const GetConfigArgsSchema = z.object({});
- src/config-manager.ts:163-172 (helper)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();