# sdcvalidator MCP server

> Validates XML instances against SDC4 XSD schemas using two-tier error classification and schema-aware XML/JSON conversion.

- Repository: https://github.com/SemanticDataCharter/sdcvalidator
- Page: https://hostedmcp.org/servers/semanticdatacharter/sdcvalidator
- Transport: stdio
- Stars: 1
- License: Apache-2.0
- Latest version: 4.6.3

## Install

### Claude Code

```sh
claude mcp add sdcvalidator -- uvx sdcvalidator
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "sdcvalidator": {
      "command": "uvx",
      "args": [
        "sdcvalidator"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "sdcvalidator": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "sdcvalidator"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"sdcvalidator","type":"stdio","command":"uvx","args":["sdcvalidator"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "sdcvalidator": {
      "command": "uvx",
      "args": [
        "sdcvalidator"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add sdcvalidator -- uvx sdcvalidator
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.sdcvalidator]
command = "uvx"
args = ["sdcvalidator"]
```

### Gemini CLI

```sh
gemini mcp add -s user sdcvalidator uvx -- sdcvalidator
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "sdcvalidator": {
      "command": "uvx",
      "args": [
        "sdcvalidator"
      ]
    }
  }
}
```

## Tools (3)

- `validate_instance`
- `validate_and_report`
- `check_schema_compliance`

## FAQ

### What is the difference between structural and semantic errors?

Structural errors (Tier 1) involve unknown elements or cardinality violations and require rejection, while semantic errors (Tier 2) involve type or pattern violations and can be reported or recovered.

### Can the validator recover from semantic errors?

Yes, semantic errors can be recovered by inserting an ISO 21090 ExceptionalValue beside the invalid value, allowing the rest of the record to remain usable.

### Does the tool support XML to JSON conversion?

Yes, it provides schema-aware conversion between XML and JSON formats.
