Guide

MCP server

Give agents and editors a structured way to run DollarLint without shelling out through a prompt.

Start the server

The MCP server runs over stdio and is designed to be launched by your MCP client.

dollarlint serve mcp

When developing from a checkout, use go run in the server command until the binary is installed.

go run ./cmd/dollarlint serve mcp

Configure a client

Most local MCP clients accept a JSON configuration with a command and arguments. For an installed binary:

{
  "mcpServers": {
    "dollarlint": {
      "type": "local",
      "command": "dollarlint",
      "args": ["serve", "mcp"],
      "tools": ["*"]
    }
  }
}

For GitHub Copilot CLI while working from this repository:

{
  "mcpServers": {
    "dollarlint": {
      "type": "local",
      "command": "go",
      "args": ["run", "./cmd/dollarlint", "serve", "mcp"],
      "tools": ["*"]
    }
  }
}

Use the validate tool

The server exposes a single validate tool. It validates JSON, JSONC, JSON5, JSON Lines, YAML, and TOML files using your DollarLint config, then returns the same result shape as dollarlint validate --format json, wrapped with a boolean ok field.

{
  "include": ["examples/basics/invalid.json"]
}

The only tool argument is include, an optional array of file or glob patterns relative to the server working directory. When omitted, DollarLint uses configured discovery. Source locations are included automatically so agents can point fixes at the right line and column.

Validation issues are not MCP transport errors. A successful tool call can still return "ok": false when files fail schema validation.

Configuration

Keep schema associations, discovery rules, fetch policy, excludes, and output preferences in .dollarlint.toml. This includes issue reporting choices such as output.branchErrors. The include argument only narrows a tool call; it does not move the validation root. If an MCP client needs a non-default config file, launch the server with the global --config flag in its command arguments.