{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/claude-code/lsp-server-config/latest.json",
  "title": "LSP Server Configuration",
  "description": "[LSP server](https://code.claude.com/docs/en/plugins-reference#lsp-servers) configuration for a language. The language server binary must be installed separately on the user's machine. See [available LSP plugins](https://code.claude.com/docs/en/plugins-reference#lsp-servers) for pre-built options.",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/lintel-rs/catalog/master/schemas/claude-code/lsp-server-config.json",
    "sourceSha256": "3818f1f7fa872a81d939cb33ba72b4af8f29ca2bb44561cb698abe9e2b42878b",
    "catalogDescription": "LSP server configuration for a Claude Code plugin."
  },
  "type": "object",
  "properties": {
    "command": {
      "type": "string",
      "description": "The LSP binary to execute (must be in `PATH`).",
      "examples": [
        "gopls",
        "typescript-language-server",
        "rust-analyzer",
        "pyright"
      ]
    },
    "extensionToLanguage": {
      "type": "object",
      "examples": [
        {
          ".go": "go"
        },
        {
          ".ts": "typescript",
          ".tsx": "typescriptreact"
        }
      ],
      "description": "Maps file extensions to [language identifiers](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentItem).",
      "additionalProperties": {
        "type": "string"
      }
    },
    "args": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Command-line arguments for the LSP server.",
      "examples": [
        [
          "serve"
        ],
        [
          "--stdio"
        ]
      ]
    },
    "transport": {
      "type": "string",
      "description": "Communication transport protocol.",
      "enum": [
        "stdio",
        "socket"
      ],
      "default": "stdio"
    },
    "env": {
      "type": "object",
      "description": "Environment variables to set when starting the server.",
      "additionalProperties": {
        "type": "string"
      }
    },
    "initializationOptions": {
      "type": "object",
      "description": "Options passed to the server during [initialization](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialize)."
    },
    "settings": {
      "type": "object",
      "description": "Settings passed via [`workspace/didChangeConfiguration`](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_didChangeConfiguration)."
    },
    "workspaceFolder": {
      "type": "string",
      "description": "Workspace folder path."
    },
    "startupTimeout": {
      "type": "number",
      "description": "Max time to wait for server startup in milliseconds.",
      "examples": [
        5000
      ]
    },
    "shutdownTimeout": {
      "type": "number",
      "description": "Max time to wait for graceful shutdown in milliseconds.",
      "examples": [
        5000
      ]
    },
    "restartOnCrash": {
      "type": "boolean",
      "description": "Whether to automatically restart the server if it crashes."
    },
    "maxRestarts": {
      "type": "number",
      "description": "Maximum number of restart attempts before giving up."
    }
  },
  "required": [
    "command",
    "extensionToLanguage"
  ]
}
