Skip to main content
Glama
landicefu

MCP Client Configuration Server

by landicefu

get_configuration_path

Retrieve the configuration file path for a specific MCP client to access or modify settings.

Instructions

Get the path to the configuration file for a specific client

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientYesClient name (cline, roo_code, windsurf, claude)

Implementation Reference

  • Handler implementation for the 'get_configuration_path' tool. Validates the client parameter and returns the computed configuration path using the getConfigPath helper.
    case 'get_configuration_path': {
      const client = validateClient(args.client);
      const configPath = getConfigPath(client);
      
      return {
        content: [
          {
            type: 'text',
            text: configPath,
          },
        ],
      };
    }
  • src/index.ts:127-140 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
    {
      name: 'get_configuration_path',
      description: 'Get the path to the configuration file for a specific client',
      inputSchema: {
        type: 'object',
        properties: {
          client: {
            type: 'string',
            description: 'Client name (cline, roo_code, windsurf, claude)',
          },
        },
        required: ['client'],
      },
    },
  • Core helper function that computes the configuration file path based on the client type and operating system platform (Windows/macOS).
    const getConfigPath = (client: ClientType): string => {
      const platform = os.platform();
      const homeDir = os.homedir();
      
      if (platform === 'win32') {
        // Windows paths
        switch (client) {
          case 'cline':
            return path.join(homeDir, 'AppData', 'Roaming', 'Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json');
          case 'roo_code':
            return path.join(homeDir, 'AppData', 'Roaming', 'Code', 'User', 'globalStorage', 'rooveterinaryinc.roo-cline', 'settings', 'cline_mcp_settings.json');
          case 'windsurf':
            return path.join(homeDir, 'AppData', 'Roaming', 'WindSurf', 'mcp_settings.json');
          case 'claude':
            return path.join(homeDir, 'AppData', 'Roaming', 'Claude', 'claude_desktop_config.json');
          default:
            throw new McpError(ErrorCode.InvalidParams, `Unsupported client: ${client}`);
        }
      } else if (platform === 'darwin') {
        // macOS paths
        switch (client) {
          case 'cline':
            return path.join(homeDir, 'Library', 'Application Support', 'Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json');
          case 'roo_code':
            return path.join(homeDir, 'Library', 'Application Support', 'Code', 'User', 'globalStorage', 'rooveterinaryinc.roo-cline', 'settings', 'cline_mcp_settings.json');
          case 'windsurf':
            return path.join(homeDir, '.codeium', 'windsurf', 'mcp_config.json');
          case 'claude':
            return path.join(homeDir, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
          default:
            throw new McpError(ErrorCode.InvalidParams, `Unsupported client: ${client}`);
        }
      } else {
        throw new McpError(ErrorCode.InternalError, `Unsupported platform: ${platform}`);
      }
    };
  • Helper function to validate the client parameter against supported types.
    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;
    };
  • Input schema definition for the get_configuration_path tool, specifying the required 'client' string parameter.
    inputSchema: {
      type: 'object',
      properties: {
        client: {
          type: 'string',
          description: 'Client name (cline, roo_code, windsurf, claude)',
        },
      },
      required: ['client'],
    },

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/landicefu/mcp-client-configuration-server'

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