Skip to content

Define a Standard MCP Configuration Schema #292

Open
@jlandowner

Description

@jlandowner

Is your feature request related to a problem? Please describe.
I'm developing an MCP host. Existing MCP hosts read their configuration from a config JSON file, but I couldn’t find a standard configuration schema.

Currently, each implementation appears to handle configuration independently in some popular projects/products. There are concerns with this situation from multiple perspectives:

From the MCP host implementer's perspective:
Each implementation has its own design and validation mechanism. As new requirements—such as additional validation rules or authentication methods—arise, implementers must address these changes on a case-by-case basis. This fragmentation increases maintenance overhead and complicates keeping up with evolving specifications.

From the end-user's perspective:
Configuration options differ across products. Users must consult various product documents to understand each specific implementation's requirements, and if multiple products are used, configurations may vary (with different setting names). This inconsistency negatively impacts the user experience.

Here are some implementations in popular projects/products:

  • Claude Desktop:
    [Quickstart for Claude Desktop](https://modelcontextprotocol.io/quickstart/user)
    Example configuration locations:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    {
      "mcpServers": {
        "filesystem": {
          "command": "npx",
          "args": [
            "-y",
            "@modelcontextprotocol/server-filesystem",
            "/Users/username/Desktop",
            "/Users/username/Downloads"
          ]
        }
      }
    }

    This configuration is minimal but no documentation for transport types like stdin or sse.

  • VSCode's GitHub Copilot:
    [MCP Servers Documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_add-an-mcp-server)

    {
      // 💡 Inputs are prompted on first server start, then stored securely by VS Code.
      "inputs": [
        {
          "type": "promptString",
          "id": "perplexity-key",
          "description": "Perplexity API Key",
          "password": true
        }
      ],
      "servers": {
        // https://github.com/ppl-ai/modelcontextprotocol/
        "Perplexity": {
          "type": "stdio",
          "command": "npx",
          "args": ["-y", "@modelcontextprotocol/server-perplexity-ask"],
          "env": {
            "PERPLEXITY_API_KEY": "${input:perplexity-key}"
          }
        }
      }
    }

    The inputs field is more advanced—it defines how to obtain authentication information and pass it to the command. Also, GitHub Copilot can read claude_desktop_config.json:

    VS Code can automatically detect and reuse MCP servers defined in other tools, such as Claude Desktop. Enable auto-discovery with the chat.mcp.discovery.enabled setting.

  • Cline:
    The schema is defined using Zod.
    [Cline's MCP Schema in McpHub.ts](https://github.com/cline/cline/blob/807a4b36dfe14a18a3e6a0dc39e05594e2fbff4c/src/services/mcp/McpHub.ts#L48-L72)

    const AutoApproveSchema = z.array(z.string()).default([])
    
    const BaseConfigSchema = z.object({
    	autoApprove: AutoApproveSchema.optional(),
    	disabled: z.boolean().optional(),
    	timeout: z.number().min(MIN_MCP_TIMEOUT_SECONDS).optional().default(DEFAULT_MCP_TIMEOUT_SECONDS),
    })
    
    const SseConfigSchema = BaseConfigSchema.extend({
    	url: z.string().url(),
    }).transform((config) => ({
    	...config,
    	transportType: "sse" as const,
    }))
    
    const StdioConfigSchema = BaseConfigSchema.extend({
    	command: z.string(),
    	args: z.array(z.string()).optional(),
    	env: z.record(z.string()).optional(),
    }).transform((config) => ({
    	...config,
    	transportType: "stdio" as const,
    }))
    
    const ServerConfigSchema = z.union([StdioConfigSchema, SseConfigSchema])
    
    const McpSettingsSchema = z.object({
    	mcpServers: z.record(ServerConfigSchema),
    })

    Cline extends the schema with additional properties like autoApprove and disabled. It uses transportType to indicate whether the configuration is for stdin or sse, whereas GitHub Copilot uses a property called type.

  • Continue:
    [Continue MCP Documentation](https://docs.continue.dev/customize/deep-dives/mcp)

    {
      "experimental": {
        "modelContextProtocolServers": [
          {
            "transport": {
              "type": "stdio",
              "command": "uvx",
              "args": ["mcp-server-sqlite", "--db-path", "/Users/NAME/test.db"]
            }
          }
        ]
      }
    }

Describe the solution you'd like
Define a standard MCP configuration schema. I propose using JSON Schema because it is language-independent and is already employed in MCP (e.g., in the ListTools response).

Here is an example of a server schema.

{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": ["stdio", "sse"]
    },
    "command": {
      "type": "string"
    },
    "args": {
      "type": "array",
      "items": { "type": "string" }
    },
    "env": {
      "type": "object",
      "additionalProperties": { "type": "string" }
    },
    "url": {
      "type": "string",
      "format": "uri"
    }
  }
}

While this is merely a basic schema common to all current implementations, defining it could provide a base for future enhancements such as various authentication methods and other transport-specific configurations(e.g. the input field in GitHub Copilot)

Describe alternatives you've considered

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions