Skip to main content
Glama
landicefu

MCP Client Configuration Server

by landicefu

get_server_configuration

Retrieve server configuration details for AI assistant clients to manage and synchronize MCP server settings across different platforms.

Instructions

Get the configuration for a specific server from a client configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientYesClient name (cline, roo_code, windsurf, claude)
server_nameYesName of the server to retrieve

Implementation Reference

  • Executes the get_server_configuration tool: validates client and server_name, reads client config file, extracts and returns the server configuration as JSON.
    case 'get_server_configuration': {
      const client = validateClient(args.client);
      const serverName = args.server_name;
      
      if (typeof serverName !== 'string') {
        throw new McpError(ErrorCode.InvalidParams, 'server_name must be a string');
      }
      
      const configPath = getConfigPath(client);
      
      let config;
      try {
        config = await readConfigFile(configPath);
      } catch (error) {
        if (error instanceof McpError && error.code === ErrorCode.InternalError && error.message.includes('not found')) {
          throw new McpError(ErrorCode.InvalidParams, `Server '${serverName}' not found in ${client} configuration (configuration file does not exist)`);
        } else {
          throw error;
        }
      }
      
      // Check if the server exists
      if (!config.mcpServers || !config.mcpServers[serverName]) {
        throw new McpError(ErrorCode.InvalidParams, `Server '${serverName}' not found in ${client} configuration`);
      }
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(config.mcpServers[serverName], null, 2),
          },
        ],
      };
    }
  • Input schema for get_server_configuration tool, defining parameters client (string) and server_name (string), both required.
    {
      name: 'get_server_configuration',
      description: 'Get the configuration for a specific server from a client configuration',
      inputSchema: {
        type: 'object',
        properties: {
          client: {
            type: 'string',
            description: 'Client name (cline, roo_code, windsurf, claude)',
          },
          server_name: {
            type: 'string',
            description: 'Name of the server to retrieve',
          },
        },
        required: ['client', 'server_name'],
      },
    },
  • src/index.ts:125-233 (registration)
    Registers the get_server_configuration tool by including it in the tools list returned for ListToolsRequest.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        {
          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'],
          },
        },
        {
          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'],
          },
        },
        {
          name: 'list_servers',
          description: 'List all server names configured in a specific client',
          inputSchema: {
            type: 'object',
            properties: {
              client: {
                type: 'string',
                description: 'Client name (cline, roo_code, windsurf, claude)',
              },
            },
            required: ['client'],
          },
        },
        {
          name: 'get_server_configuration',
          description: 'Get the configuration for a specific server from a client configuration',
          inputSchema: {
            type: 'object',
            properties: {
              client: {
                type: 'string',
                description: 'Client name (cline, roo_code, windsurf, claude)',
              },
              server_name: {
                type: 'string',
                description: 'Name of the server to retrieve',
              },
            },
            required: ['client', 'server_name'],
          },
        },
        {
          name: 'add_server_configuration',
          description: 'Add or update a server configuration in a client configuration',
          inputSchema: {
            type: 'object',
            properties: {
              client: {
                type: 'string',
                description: 'Client name (cline, roo_code, windsurf, claude)',
              },
              server_name: {
                type: 'string',
                description: 'Name of the server to add or update',
              },
              json_config: {
                type: 'object',
                description: 'Server configuration in JSON format',
              },
              allow_override: {
                type: 'boolean',
                description: 'Whether to allow overriding an existing server configuration with the same name (default: false)',
                default: false,
              },
            },
            required: ['client', 'server_name', 'json_config'],
          },
        },
        {
          name: 'remove_server_configuration',
          description: 'Remove a server configuration from a client configuration',
          inputSchema: {
            type: 'object',
            properties: {
              client: {
                type: 'string',
                description: 'Client name (cline, roo_code, windsurf, claude)',
              },
              server_name: {
                type: 'string',
                description: 'Name of the server to remove',
              },
            },
            required: ['client', 'server_name'],
          },
        },
      ],
    }));
  • Helper function to validate the client parameter used in get_server_configuration.
    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;
    };
  • Helper function to read and parse the client configuration JSON file, used by get_server_configuration.
    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}`);
      }
    };
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Get' implies a read operation, the description doesn't specify whether this requires authentication, has rate limits, returns structured data, or what happens if the server doesn't exist. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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

Conciseness5/5

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

The description is a single, clear sentence that efficiently communicates the core purpose without unnecessary words. It's appropriately sized for a simple retrieval tool and front-loads the essential information.

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?

For a simple read operation with no output schema and no annotations, the description provides the basic purpose but lacks important context. It doesn't explain what format the configuration returns, whether it's JSON/YAML/text, or what happens on errors. With siblings suggesting a configuration management system, more behavioral context would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description doesn't add any parameter information beyond what's already in the schema, which has 100% coverage with clear descriptions for both 'client' and 'server_name'. The baseline score of 3 reflects that the schema adequately documents parameters, though the description could have provided additional context about parameter relationships or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('configuration for a specific server from a client configuration'), making the purpose understandable. However, it doesn't explicitly differentiate this from sibling tools like 'get_configuration' or 'get_configuration_path', which likely retrieve different types of configuration data.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'get_configuration' and 'get_configuration_path' that might retrieve different scopes of configuration data, there's no indication of when this specific server-focused retrieval is appropriate.

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

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