# sdcvalidator [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/SemanticDataCharter/sdcvalidator  
**GitHub Stars:** 1  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/sdcvalidator

## Description
SDC4 structural validator with ExceptionalValue recovery; thin wrapper over xmlschema.

## Tools
Capabilities this server exposes over MCP:

- **validate_instance** — Validate an XML instance against its SDC4 XSD schema. Returns pass/fail with error count and classified errors.
- **validate_and_report** — Validate an instance and return a detailed report with two-tier (structural vs semantic) error classification.
- **check_schema_compliance** — Check whether an XSD schema follows SDC4 principles (restriction only, no `xsd:extension`). Does not validate instances.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

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

## Documentation

## What the sdcvalidator MCP server does

The sdcvalidator MCP server gives MCP-capable agents access to SDC4 validation tasks through a local stdio process. It can validate an XML instance against an XSD schema, produce a more detailed validation report, and inspect an XSD for SDC4 schema compliance. The server is intended for SDC4 data models that use restriction-based derivation rather than extension.

Validation results distinguish structural failures from semantic failures. Structural issues include problems such as unknown elements, invalid nesting, and cardinality violations. Semantic issues include type errors, pattern violations, and enumeration mismatches. This distinction lets a caller determine whether an instance should be rejected or reported for further attention.

## How it works

The sdcvalidator MCP server communicates using JSON-RPC 2.0 over standard input and output. It does not require an external MCP SDK. The validation implementation is a thin wrapper around the Python xmlschema package and loads the supplied XSD before checking the XML instance.

Schema loading uses strict validation by default. In this mode, invalid restriction derivations can raise an XMLSchemaParseError, including cases where derived element names or types do not agree with the base definition. The underlying Python API also supports lax mode, which collects schema derivation problems, and skip mode, which bypasses schema-level validation. These modes are described for the library API; the MCP tool descriptions specify schema and instance paths plus an optional compliance-check flag.

## Setup and configuration

Install the package from PyPI with pip, or install a local source checkout in editable mode. Start the MCP process with `sdcvalidator-mcp serve --mcp`. The process is local and uses stdio, so an MCP client must launch it and exchange requests through its standard streams.

The validation tools accept filesystem paths rather than embedding XML or XSD content in the request. `validate_instance` and `validate_and_report` take `schema_path` and `instance_path`. Both also accept `check_compliance`, which defaults to true. `check_schema_compliance` takes only `schema_path`.

## Tools and capabilities

- `validate_instance` returns whether validation passed, an error count, and classified errors.
- `validate_and_report` returns a detailed report organized into structural and semantic error categories.
- `check_schema_compliance` checks that an XSD follows the SDC4 restriction-only rule and does not use `xsd:extension`.

The package also provides command-line programs for direct use outside MCP: `sdcvalidate` validates XML, `sdcvalidator-xml2json` converts XML to schema-aware JSON, and `sdcvalidator-json2xml` converts JSON back to XML using a schema. The Python API exposes the validator, error tiers, compliance-checking functions, and XML/JSON conversion helpers.

## Limitations and notes

This server validates against supplied local schema and instance paths; the provided material does not describe remote schema retrieval, hosted deployment, authentication, or client-specific configuration. Schema compliance checking is separate from instance validation: `check_schema_compliance` examines the XSD and does not validate an XML instance.

The default strict mode may reject schemas with pre-existing derivation problems during loading. Lax and skip validation modes are available through the Python API, but the MCP tool interface described here does not list a validation-mode parameter. SDC4 compliance checking can be disabled for the two instance-validation tools by setting `check_compliance` to false.

_Full upstream README: https://allmcps.com/mcp/sdcvalidator/readme_

