Skip to main content
Glama
landicefu

MCP Client Configuration Server

by landicefu

add_server_configuration

Add or update server configurations for AI assistant clients like Cline, Roo Code, WindSurf, and Claude to manage MCP server settings across platforms.

Instructions

Add or update a server configuration in a client configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientYesClient name (cline, roo_code, windsurf, claude)
server_nameYesName of the server to add or update
json_configYesServer configuration in JSON format
allow_overrideNoWhether to allow overriding an existing server configuration with the same name (default: false)

Implementation Reference

  • The switch case that handles the 'add_server_configuration' tool execution. It validates inputs, reads or initializes the client config file, checks for existing servers, adds or updates the server configuration based on allow_override, writes the config back, and returns a success message.
    case 'add_server_configuration': {
      const client = validateClient(args.client);
      const serverName = args.server_name;
      const jsonConfig = args.json_config;
      const allowOverride = args.allow_override === true; // Default to false if not provided
      
      if (typeof serverName !== 'string') {
        throw new McpError(ErrorCode.InvalidParams, 'server_name must be a string');
      }
      
      if (typeof jsonConfig !== 'object' || jsonConfig === null) {
        throw new McpError(ErrorCode.InvalidParams, 'json_config must be a valid JSON object');
      }
      
      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')) {
          // Create a new configuration if it doesn't exist
          config = { mcpServers: {} };
        } else {
          throw error;
        }
      }
      
      // Ensure mcpServers object exists
      if (!config.mcpServers) {
        config.mcpServers = {};
      }
      
      // Check if server with the same name already exists
      const serverExists = config.mcpServers.hasOwnProperty(serverName);
      if (serverExists && !allowOverride) {
        throw new McpError(
          ErrorCode.InvalidParams,
          `Server '${serverName}' already exists in ${client} configuration. Set allow_override to true to update it.`
        );
      }
      
      // Add or update the server configuration
      config.mcpServers[serverName] = jsonConfig;
      
      // Write the updated configuration
      await writeConfigFile(configPath, config);
      
      const action = serverExists ? 'updated' : 'added';
      return {
        content: [
          {
            type: 'text',
            text: `Server '${serverName}' configuration ${action} in ${client} configuration`,
          },
        ],
      };
    }
  • The inputSchema defining the parameters for the add_server_configuration tool: client, server_name, json_config (required), and optional allow_override.
    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'],
  • src/index.ts:187-213 (registration)
    The tool registration object in the ListTools response, declaring the name, description, and inputSchema for add_server_configuration.
    {
      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'],
      },
    },
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. It mentions 'Add or update' which implies mutation, but fails to describe critical behaviors such as permissions required, idempotency, error handling, or what happens on conflicts (beyond the 'allow_override' parameter). This leaves significant gaps for a mutation tool.

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, efficient sentence that directly states the tool's function without unnecessary words. It is front-loaded and appropriately sized, making it easy to parse quickly.

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

Completeness2/5

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

Given the complexity of a mutation tool with no annotations and no output schema, the description is insufficient. It lacks details on behavioral traits, error conditions, return values, and how it interacts with sibling tools. This makes it incomplete for safe and effective use by an AI agent.

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 schema description coverage is 100%, so the input schema already documents all parameters thoroughly. The description does not add any additional meaning or context beyond what the schema provides, such as examples or usage notes for 'json_config' or 'client'. Thus, it meets the baseline but does not enhance understanding.

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 ('Add or update') and the target resource ('a server configuration in a client configuration'), making the purpose understandable. However, it does not explicitly differentiate from sibling tools like 'remove_server_configuration' or 'get_server_configuration', which would be needed for a score of 5.

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 like 'remove_server_configuration' or 'get_server_configuration', nor does it mention prerequisites or context for usage. It merely restates the tool's function without offering operational context.

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