get_configuration
Retrieve the complete configuration for a specific client from the MCP Client Configuration Server, enabling efficient management and synchronization of settings across AI assistant clients.
Instructions
Get the entire configuration for a specific client
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| client | Yes | Client name (cline, roo_code, windsurf, claude) |
Implementation Reference
- src/index.ts:253-266 (handler)Handler logic for 'get_configuration' tool: validates client, computes config path, reads the JSON config file, and returns it as formatted JSON string in the MCP response format.case 'get_configuration': { const client = validateClient(args.client); const configPath = getConfigPath(client); const config = await readConfigFile(configPath); return { content: [ { type: 'text', text: JSON.stringify(config, null, 2), }, ], }; }
- src/index.ts:141-154 (registration)Registration of the 'get_configuration' tool in the ListTools response, including name, description, and input schema.{ name: 'get_configuration', description: 'Get the entire configuration for a specific client', inputSchema: { type: 'object', properties: { client: { type: 'string', description: 'Client name (cline, roo_code, windsurf, claude)', }, }, required: ['client'], }, },
- src/index.ts:144-153 (schema)Input schema definition for the 'get_configuration' tool: requires a 'client' string parameter.inputSchema: { type: 'object', properties: { client: { type: 'string', description: 'Client name (cline, roo_code, windsurf, claude)', }, }, required: ['client'], },
- src/index.ts:70-81 (helper)Helper function to read and parse the configuration JSON file from disk.const readConfigFile = async (configPath: string): Promise<any> => { try { const data = await fs.readFile(configPath, 'utf8'); return JSON.parse(data); } catch (error: unknown) { if (error instanceof Error && 'code' in error && error.code === 'ENOENT') { throw new McpError(ErrorCode.InternalError, `Configuration file not found: ${configPath}`); } const errorMessage = error instanceof Error ? error.message : String(error); throw new McpError(ErrorCode.InternalError, `Error reading configuration file: ${errorMessage}`); } };
- src/index.ts:56-67 (helper)Helper function to validate the 'client' parameter against supported values.const validateClient = (client: unknown): ClientType => { if (typeof client !== 'string') { throw new McpError(ErrorCode.InvalidParams, 'Client must be a string'); } const validClients: ClientType[] = ['cline', 'roo_code', 'windsurf', 'claude']; if (!validClients.includes(client as ClientType)) { throw new McpError(ErrorCode.InvalidParams, `Invalid client: ${client}. Must be one of: ${validClients.join(', ')}`); } return client as ClientType; };