Skip to content

mcp-valid-json

MCP configuration must be valid JSON with proper mcpServers structure

Severity error
Autofix -
Since v0.1.0
Category MCP (Model Context Protocol)

Why

MCP (Model Context Protocol) configuration files must be valid JSON with a proper mcpServers structure. Invalid JSON or missing structure means no MCP servers will be loaded, and tools that depend on them will silently fail.

Examples

Bad:

{"servers": {"my-server": {"command": "npx my-server"}}}

Good:

{
  "mcpServers": {
    "my-server": {
      "command": "npx",
      "args": ["my-server"]
    }
  }
}

How to fix

Fix the JSON syntax error or restructure the file to use the mcpServers top-level key with properly configured server entries. Each server needs at minimum a command field.

Configuration

rules:
  mcp-valid-json:
    enabled: true  # true | false | auto
    severity: error

Run skillsaw explain mcp-valid-json to see this documentation and the rule's effective configuration in your terminal.