{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://docs.1mcp.app/schemas/v1.0.0/mcp-config.json",
  "title": "1MCP Server Configuration v1.0.0",
  "description": "JSON Schema for 1MCP server configuration files (v1.0.0)",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string",
      "format": "uri",
      "description": "JSON Schema reference for IDE autocompletion and validation"
    },
    "version": {
      "description": "Version of the configuration format for migration purposes",
      "type": "string"
    },
    "serverDefaults": {
      "description": "Shareable defaults inherited by all MCP servers (transport settings only)",
      "type": "object",
      "properties": {
        "env": {
          "description": "Environment variables as object or array of KEY=VALUE strings",
          "anyOf": [
            {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "string"
              }
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "timeout": {
          "description": "Deprecated: Use connectionTimeout and requestTimeout instead. Fallback timeout in milliseconds",
          "type": "number"
        },
        "connectionTimeout": {
          "description": "Timeout for establishing initial connection in milliseconds (takes precedence over timeout)",
          "type": "number"
        },
        "requestTimeout": {
          "description": "Timeout for individual request operations in milliseconds (takes precedence over timeout)",
          "type": "number"
        },
        "oauth": {
          "description": "OAuth configuration for authentication",
          "type": "object",
          "properties": {
            "issuer": {
              "description": "Exact approved upstream authorization-server issuer",
              "type": "string",
              "format": "uri"
            },
            "clientMetadataUrl": {
              "description": "HTTPS Client ID Metadata Document URL",
              "type": "string",
              "format": "uri"
            },
            "credentialAuthority": {
              "description": "Explicit configured authority shared by compatible template instances",
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "clientId": {
              "description": "OAuth client ID for authentication",
              "type": "string"
            },
            "clientSecret": {
              "description": "OAuth client secret for authentication",
              "type": "string"
            },
            "scopes": {
              "description": "OAuth scopes to request",
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "autoRegister": {
              "description": "Automatically register OAuth client if not already registered",
              "type": "boolean"
            },
            "redirectUrl": {
              "description": "OAuth redirect URL used after auth",
              "type": "string"
            }
          }
        },
        "headers": {
          "description": "Custom HTTP headers to send with requests",
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "string"
          }
        },
        "inheritParentEnv": {
          "description": "Whether to inherit environment variables from parent process",
          "type": "boolean"
        },
        "envFilter": {
          "description": "List of environment variable names to include when inheritParentEnv is true",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "restartOnExit": {
          "description": "Enable runtime-owned automatic restart after an unexpected stdio backend exit",
          "type": "boolean"
        },
        "maxRestarts": {
          "description": "Maximum consecutive restart attempts (omitted = 5, 0 = unlimited; resets after 5 stable minutes)",
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "restartDelay": {
          "description": "Initial restart delay in milliseconds (omitted = 1000; backoff is 1x, 2x, 4x, 8x, then 16x)",
          "type": "number",
          "minimum": 0
        }
      }
    },
    "mcpServers": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "object",
        "properties": {
          "preparation": {
            "description": "Runtime-owned definition or inline commands and explicit action permissions",
            "type": "object",
            "properties": {
              "adapter": {
                "type": "string",
                "const": "configured-command"
              },
              "affectedTools": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "all"
                  },
                  {
                    "minItems": 1,
                    "maxItems": 4096,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    }
                  }
                ]
              },
              "integration": {
                "type": "object",
                "properties": {
                  "containment": {
                    "type": "string",
                    "const": "posix-process-group"
                  },
                  "probe": {
                    "type": "object",
                    "properties": {
                      "executable": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 4096
                      },
                      "args": {
                        "maxItems": 256,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 16384
                        }
                      }
                    },
                    "required": ["executable", "args"],
                    "additionalProperties": false
                  },
                  "status": {
                    "type": "object",
                    "properties": {
                      "executable": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 4096
                      },
                      "args": {
                        "maxItems": 256,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 16384
                        }
                      }
                    },
                    "required": ["executable", "args"],
                    "additionalProperties": false
                  },
                  "readinessExitCodes": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "pattern": "^(?:0|[1-9]\\d?|1\\d{2}|2[0-4]\\d|25[0-5])$"
                    },
                    "additionalProperties": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "ready"
                            }
                          },
                          "required": ["state"],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "required"
                            },
                            "action": {
                              "type": "string",
                              "enum": ["initialize", "sync", "rebuild", "install", "paid"]
                            },
                            "instructions": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 4096
                            }
                          },
                          "required": ["state", "action", "instructions"],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "conflict"
                            },
                            "instructions": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 4096
                            }
                          },
                          "required": ["state", "instructions"],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "unsupported"
                            },
                            "instructions": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 4096
                            }
                          },
                          "required": ["state", "instructions"],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "unknown"
                            },
                            "reason": {
                              "type": "string",
                              "const": "probe_failed"
                            },
                            "instructions": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 4096
                            }
                          },
                          "required": ["state", "reason", "instructions"],
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "actions": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "enum": ["initialize", "sync", "rebuild", "install", "paid"]
                    },
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "executable": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 4096
                        },
                        "args": {
                          "maxItems": 256,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "maxLength": 16384
                          }
                        },
                        "successExitCodes": {
                          "default": [0],
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 255
                          }
                        },
                        "transientExitCodes": {
                          "default": [],
                          "type": "array",
                          "items": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 255
                          }
                        }
                      },
                      "required": ["executable", "args"],
                      "additionalProperties": false
                    }
                  },
                  "inspectionTimeoutMs": {
                    "default": 5000,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 60000
                  },
                  "outputLimitBytes": {
                    "default": 16384,
                    "type": "integer",
                    "minimum": 256,
                    "maximum": 65536
                  },
                  "terminationGraceMs": {
                    "default": 500,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5000
                  }
                },
                "required": ["containment", "probe", "readinessExitCodes", "actions"],
                "additionalProperties": false
              },
              "definition": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9-]{0,127}$"
                  },
                  "file": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096,
                    "pattern": "^(?:[/\\\\]|[A-Za-z]:[/\\\\])"
                  },
                  "inputs": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,127}$"
                    },
                    "additionalProperties": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 16384
                    }
                  }
                },
                "required": ["id"],
                "additionalProperties": false
              },
              "activation": {
                "type": "string",
                "const": "setup"
              },
              "enabled": {
                "type": "boolean"
              },
              "allowedActions": {
                "maxItems": 5,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": ["initialize", "sync", "rebuild", "install", "paid"]
                }
              },
              "executionDeadlineMs": {
                "type": "integer",
                "minimum": 1,
                "maximum": 86400000
              },
              "transientRetryLimit": {
                "type": "integer",
                "minimum": 0,
                "maximum": 3
              }
            },
            "required": ["adapter", "allowedActions"],
            "additionalProperties": false,
            "allOf": [
              {
                "if": {
                  "required": ["definition"]
                },
                "then": {
                  "not": {
                    "required": ["integration"]
                  }
                },
                "else": {
                  "required": ["affectedTools"]
                }
              },
              {
                "if": {
                  "required": ["activation"]
                },
                "then": {
                  "required": ["definition"]
                }
              }
            ]
          },
          "projectTarget": {
            "description": "Runtime-owned project targeting; templates default to single and static backends to independent",
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": ["independent", "single"]
                  },
                  "argument": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": ["mode"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "const": "native-set"
                  },
                  "argument": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": ["mode", "argument"],
                "additionalProperties": false
              }
            ]
          },
          "type": {
            "description": "Transport type for connecting to the MCP server",
            "type": "string",
            "enum": ["stdio", "sse", "http", "streamableHttp"]
          },
          "protocolVersion": {
            "description": "Outbound MCP protocol negotiation mode (defaults to auto when omitted)",
            "type": "string",
            "enum": ["auto", "legacy", "2026-07-28"]
          },
          "disabled": {
            "description": "Disable this server. Can be a boolean value or a template string that evaluates to a boolean (e.g., \"{?project.environment=production}\")",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "string"
              }
            ]
          },
          "disabledTools": {
            "description": "Hide specific tools from this server without disabling the entire server",
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "instructionOverride": {
            "description": "Literal replacement for upstream instructions; an empty string intentionally suppresses them",
            "type": "string"
          },
          "toolDescriptionOverrides": {
            "description": "Override upstream tool descriptions by logical tool name; blank descriptions are not supported",
            "type": "object",
            "propertyNames": {
              "type": "string",
              "minLength": 1,
              "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
            },
            "additionalProperties": {
              "type": "string",
              "minLength": 1,
              "pattern": "\\S"
            }
          },
          "timeout": {
            "description": "Deprecated: Use connectionTimeout and requestTimeout instead. Fallback timeout in milliseconds",
            "type": "number"
          },
          "connectionTimeout": {
            "description": "Timeout for establishing initial connection in milliseconds (takes precedence over timeout)",
            "type": "number"
          },
          "requestTimeout": {
            "description": "Timeout for individual request operations in milliseconds (takes precedence over timeout)",
            "type": "number"
          },
          "tags": {
            "description": "Tags for filtering and organizing servers",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "oauth": {
            "description": "OAuth configuration for authentication",
            "type": "object",
            "properties": {
              "issuer": {
                "description": "Exact approved upstream authorization-server issuer",
                "type": "string",
                "format": "uri"
              },
              "clientMetadataUrl": {
                "description": "HTTPS Client ID Metadata Document URL",
                "type": "string",
                "format": "uri"
              },
              "credentialAuthority": {
                "description": "Explicit configured authority shared by compatible template instances",
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "clientId": {
                "description": "OAuth client ID for authentication",
                "type": "string"
              },
              "clientSecret": {
                "description": "OAuth client secret for authentication",
                "type": "string"
              },
              "scopes": {
                "description": "OAuth scopes to request",
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "autoRegister": {
                "description": "Automatically register OAuth client if not already registered",
                "type": "boolean"
              },
              "redirectUrl": {
                "description": "OAuth redirect URL used after auth",
                "type": "string"
              }
            }
          },
          "url": {
            "description": "URL for HTTP or SSE transport",
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "string",
                "pattern": "\\$\\{[^}]+\\}|\\$[A-Za-z_][A-Za-z0-9_]*"
              }
            ]
          },
          "headers": {
            "description": "Custom HTTP headers to send with requests",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "command": {
            "description": "Command to execute for stdio transport",
            "type": "string"
          },
          "args": {
            "description": "Command-line arguments for the command",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stderr": {
            "description": "How to handle stderr output (inherit, ignore, overlapped, pipe, or file descriptor)",
            "anyOf": [
              {
                "type": "string",
                "enum": ["inherit", "ignore", "overlapped", "pipe"]
              },
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            ]
          },
          "cwd": {
            "description": "Working directory for the command",
            "type": "string"
          },
          "env": {
            "description": "Environment variables as object or array of KEY=VALUE strings",
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "inheritParentEnv": {
            "description": "Whether to inherit environment variables from parent process",
            "type": "boolean"
          },
          "envFilter": {
            "description": "List of environment variable names to include when inheritParentEnv is true",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "restartOnExit": {
            "description": "Enable runtime-owned automatic restart after an unexpected stdio backend exit",
            "type": "boolean"
          },
          "maxRestarts": {
            "description": "Maximum consecutive restart attempts (omitted = 5, 0 = unlimited; resets after 5 stable minutes)",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "restartDelay": {
            "description": "Initial restart delay in milliseconds (omitted = 1000; backoff is 1x, 2x, 4x, 8x, then 16x)",
            "type": "number",
            "minimum": 0
          },
          "template": {
            "description": "Template-based server instance management configuration",
            "type": "object",
            "properties": {
              "shareable": {
                "description": "Whether this template creates shareable server instances",
                "type": "boolean"
              },
              "maxInstances": {
                "description": "Maximum instances per template (0 = unlimited)",
                "type": "number",
                "minimum": 0
              },
              "idleTimeout": {
                "description": "Idle timeout before termination in milliseconds",
                "type": "number",
                "minimum": 0
              },
              "perClient": {
                "description": "Force per-client instances (overrides shareable)",
                "type": "boolean"
              },
              "extractionOptions": {
                "description": "Default options for variable extraction",
                "type": "object",
                "properties": {
                  "includeOptional": {
                    "description": "Whether to include optional variables in the result",
                    "type": "boolean"
                  },
                  "includeEnvironment": {
                    "description": "Whether to include environment variables",
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      },
      "description": "Static server configurations (no template processing)"
    },
    "mcpTemplates": {
      "description": "Template-based server configurations (processed with context data)",
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "object",
        "properties": {
          "preparation": {
            "description": "Runtime-owned definition or inline commands and explicit action permissions",
            "type": "object",
            "properties": {
              "adapter": {
                "type": "string",
                "const": "configured-command"
              },
              "affectedTools": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "all"
                  },
                  {
                    "minItems": 1,
                    "maxItems": 4096,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    }
                  }
                ]
              },
              "integration": {
                "type": "object",
                "properties": {
                  "containment": {
                    "type": "string",
                    "const": "posix-process-group"
                  },
                  "probe": {
                    "type": "object",
                    "properties": {
                      "executable": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 4096
                      },
                      "args": {
                        "maxItems": 256,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 16384
                        }
                      }
                    },
                    "required": ["executable", "args"],
                    "additionalProperties": false
                  },
                  "status": {
                    "type": "object",
                    "properties": {
                      "executable": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 4096
                      },
                      "args": {
                        "maxItems": 256,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 16384
                        }
                      }
                    },
                    "required": ["executable", "args"],
                    "additionalProperties": false
                  },
                  "readinessExitCodes": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "pattern": "^(?:0|[1-9]\\d?|1\\d{2}|2[0-4]\\d|25[0-5])$"
                    },
                    "additionalProperties": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "ready"
                            }
                          },
                          "required": ["state"],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "required"
                            },
                            "action": {
                              "type": "string",
                              "enum": ["initialize", "sync", "rebuild", "install", "paid"]
                            },
                            "instructions": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 4096
                            }
                          },
                          "required": ["state", "action", "instructions"],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "conflict"
                            },
                            "instructions": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 4096
                            }
                          },
                          "required": ["state", "instructions"],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "unsupported"
                            },
                            "instructions": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 4096
                            }
                          },
                          "required": ["state", "instructions"],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string",
                              "const": "unknown"
                            },
                            "reason": {
                              "type": "string",
                              "const": "probe_failed"
                            },
                            "instructions": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 4096
                            }
                          },
                          "required": ["state", "reason", "instructions"],
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "actions": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "enum": ["initialize", "sync", "rebuild", "install", "paid"]
                    },
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "executable": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 4096
                        },
                        "args": {
                          "maxItems": 256,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "maxLength": 16384
                          }
                        },
                        "successExitCodes": {
                          "default": [0],
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 255
                          }
                        },
                        "transientExitCodes": {
                          "default": [],
                          "type": "array",
                          "items": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 255
                          }
                        }
                      },
                      "required": ["executable", "args"],
                      "additionalProperties": false
                    }
                  },
                  "inspectionTimeoutMs": {
                    "default": 5000,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 60000
                  },
                  "outputLimitBytes": {
                    "default": 16384,
                    "type": "integer",
                    "minimum": 256,
                    "maximum": 65536
                  },
                  "terminationGraceMs": {
                    "default": 500,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5000
                  }
                },
                "required": ["containment", "probe", "readinessExitCodes", "actions"],
                "additionalProperties": false
              },
              "definition": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9-]{0,127}$"
                  },
                  "file": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096,
                    "pattern": "^(?:[/\\\\]|[A-Za-z]:[/\\\\])"
                  },
                  "inputs": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,127}$"
                    },
                    "additionalProperties": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 16384
                    }
                  }
                },
                "required": ["id"],
                "additionalProperties": false
              },
              "activation": {
                "type": "string",
                "const": "setup"
              },
              "enabled": {
                "type": "boolean"
              },
              "allowedActions": {
                "maxItems": 5,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": ["initialize", "sync", "rebuild", "install", "paid"]
                }
              },
              "executionDeadlineMs": {
                "type": "integer",
                "minimum": 1,
                "maximum": 86400000
              },
              "transientRetryLimit": {
                "type": "integer",
                "minimum": 0,
                "maximum": 3
              }
            },
            "required": ["adapter", "allowedActions"],
            "additionalProperties": false,
            "allOf": [
              {
                "if": {
                  "required": ["definition"]
                },
                "then": {
                  "not": {
                    "required": ["integration"]
                  }
                },
                "else": {
                  "required": ["affectedTools"]
                }
              },
              {
                "if": {
                  "required": ["activation"]
                },
                "then": {
                  "required": ["definition"]
                }
              }
            ]
          },
          "projectTarget": {
            "description": "Runtime-owned project targeting; templates default to single and static backends to independent",
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": ["independent", "single"]
                  },
                  "argument": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": ["mode"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "const": "native-set"
                  },
                  "argument": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": ["mode", "argument"],
                "additionalProperties": false
              }
            ]
          },
          "type": {
            "description": "Transport type for connecting to the MCP server",
            "type": "string",
            "enum": ["stdio", "sse", "http", "streamableHttp"]
          },
          "protocolVersion": {
            "description": "Outbound MCP protocol negotiation mode (defaults to auto when omitted)",
            "type": "string",
            "enum": ["auto", "legacy", "2026-07-28"]
          },
          "disabled": {
            "description": "Disable this server. Can be a boolean value or a template string that evaluates to a boolean (e.g., \"{?project.environment=production}\")",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "string"
              }
            ]
          },
          "disabledTools": {
            "description": "Hide specific tools from this server without disabling the entire server",
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "instructionOverride": {
            "description": "Literal replacement for upstream instructions; an empty string intentionally suppresses them",
            "type": "string"
          },
          "toolDescriptionOverrides": {
            "description": "Override upstream tool descriptions by logical tool name; blank descriptions are not supported",
            "type": "object",
            "propertyNames": {
              "type": "string",
              "minLength": 1,
              "pattern": "^\\S(?:[\\s\\S]*\\S)?$"
            },
            "additionalProperties": {
              "type": "string",
              "minLength": 1,
              "pattern": "\\S"
            }
          },
          "timeout": {
            "description": "Deprecated: Use connectionTimeout and requestTimeout instead. Fallback timeout in milliseconds",
            "type": "number"
          },
          "connectionTimeout": {
            "description": "Timeout for establishing initial connection in milliseconds (takes precedence over timeout)",
            "type": "number"
          },
          "requestTimeout": {
            "description": "Timeout for individual request operations in milliseconds (takes precedence over timeout)",
            "type": "number"
          },
          "tags": {
            "description": "Tags for filtering and organizing servers",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "oauth": {
            "description": "OAuth configuration for authentication",
            "type": "object",
            "properties": {
              "issuer": {
                "description": "Exact approved upstream authorization-server issuer",
                "type": "string",
                "format": "uri"
              },
              "clientMetadataUrl": {
                "description": "HTTPS Client ID Metadata Document URL",
                "type": "string",
                "format": "uri"
              },
              "credentialAuthority": {
                "description": "Explicit configured authority shared by compatible template instances",
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "clientId": {
                "description": "OAuth client ID for authentication",
                "type": "string"
              },
              "clientSecret": {
                "description": "OAuth client secret for authentication",
                "type": "string"
              },
              "scopes": {
                "description": "OAuth scopes to request",
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "autoRegister": {
                "description": "Automatically register OAuth client if not already registered",
                "type": "boolean"
              },
              "redirectUrl": {
                "description": "OAuth redirect URL used after auth",
                "type": "string"
              }
            }
          },
          "url": {
            "description": "URL for HTTP or SSE transport",
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "string",
                "pattern": "\\$\\{[^}]+\\}|\\$[A-Za-z_][A-Za-z0-9_]*"
              }
            ]
          },
          "headers": {
            "description": "Custom HTTP headers to send with requests",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "command": {
            "description": "Command to execute for stdio transport",
            "type": "string"
          },
          "args": {
            "description": "Command-line arguments for the command",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stderr": {
            "description": "How to handle stderr output (inherit, ignore, overlapped, pipe, or file descriptor)",
            "anyOf": [
              {
                "type": "string",
                "enum": ["inherit", "ignore", "overlapped", "pipe"]
              },
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            ]
          },
          "cwd": {
            "description": "Working directory for the command",
            "type": "string"
          },
          "env": {
            "description": "Environment variables as object or array of KEY=VALUE strings",
            "anyOf": [
              {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                }
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "inheritParentEnv": {
            "description": "Whether to inherit environment variables from parent process",
            "type": "boolean"
          },
          "envFilter": {
            "description": "List of environment variable names to include when inheritParentEnv is true",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "restartOnExit": {
            "description": "Enable runtime-owned automatic restart after an unexpected stdio backend exit",
            "type": "boolean"
          },
          "maxRestarts": {
            "description": "Maximum consecutive restart attempts (omitted = 5, 0 = unlimited; resets after 5 stable minutes)",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "restartDelay": {
            "description": "Initial restart delay in milliseconds (omitted = 1000; backoff is 1x, 2x, 4x, 8x, then 16x)",
            "type": "number",
            "minimum": 0
          },
          "template": {
            "description": "Template-based server instance management configuration",
            "type": "object",
            "properties": {
              "shareable": {
                "description": "Whether this template creates shareable server instances",
                "type": "boolean"
              },
              "maxInstances": {
                "description": "Maximum instances per template (0 = unlimited)",
                "type": "number",
                "minimum": 0
              },
              "idleTimeout": {
                "description": "Idle timeout before termination in milliseconds",
                "type": "number",
                "minimum": 0
              },
              "perClient": {
                "description": "Force per-client instances (overrides shareable)",
                "type": "boolean"
              },
              "extractionOptions": {
                "description": "Default options for variable extraction",
                "type": "object",
                "properties": {
                  "includeOptional": {
                    "description": "Whether to include optional variables in the result",
                    "type": "boolean"
                  },
                  "includeEnvironment": {
                    "description": "Whether to include environment variables",
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "templateSettings": {
      "description": "Template processing settings",
      "type": "object",
      "properties": {
        "validateOnReload": {
          "description": "Whether to validate templates on configuration reload",
          "type": "boolean"
        },
        "failureMode": {
          "description": "How to handle template processing failures (strict = throw error, graceful = log and continue)",
          "type": "string",
          "enum": ["strict", "graceful"]
        },
        "cacheContext": {
          "description": "Whether to cache processed templates based on context hash",
          "type": "boolean"
        }
      }
    },
    "instructionTemplates": {
      "description": "Managed instruction template drafts keyed by stable identity",
      "type": "object",
      "propertyNames": {
        "type": "string",
        "minLength": 1,
        "not": {
          "const": "default"
        }
      },
      "additionalProperties": {
        "type": "object",
        "properties": {
          "initialization": {
            "type": "string",
            "description": "Complete Handlebars template for MCP initialization instructions"
          },
          "cli": {
            "type": "string",
            "description": "Complete Handlebars template for direct CLI instructions"
          }
        },
        "required": ["initialization", "cli"]
      }
    },
    "publishedInstructionTemplates": {
      "description": "Last activated instruction template variants keyed by stable identity",
      "type": "object",
      "propertyNames": {
        "type": "string",
        "minLength": 1,
        "not": {
          "const": "default"
        }
      },
      "additionalProperties": {
        "type": "object",
        "properties": {
          "initialization": {
            "type": "string",
            "description": "Complete Handlebars template for MCP initialization instructions"
          },
          "cli": {
            "type": "string",
            "description": "Complete Handlebars template for direct CLI instructions"
          }
        },
        "required": ["initialization", "cli"]
      }
    },
    "activeInstructionTemplate": {
      "description": "Explicitly selected managed instruction template identity",
      "type": "string",
      "minLength": 1
    }
  },
  "required": ["mcpServers"]
}
