modelcontextprotocol / modelcontextprotocol/modelcontextprotocol

Define a Standard MCP Configuration Schema

Offen
#292 23 Kommentare 50 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

enhancement
Vorherrschende Sprache
TypeScript
Sterne
9.3k
Forks
1.8k
Ø Merge
1 T. 12 Std.
Gemergte PRs (30 T.)
25

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die im Issue verknüpften Konfigurationen von Claude Desktop, VS Code, Cline und Continue zu vergleichen, und lies anschließend die Diskussion mit 23 Kommentaren zu ungeklärten Anforderungen an Transport und Authentifizierung. Als erledigt gilt die Aufgabe, wenn das Projekt über ein vereinbartes, dokumentiertes JSON Schema für die Konfiguration von MCP-Servern verfügt, das die festgestellten Unterschiede und künftige Erweiterungen berücksichtigt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Bereich
backend-api-design
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.