Validates and repairs structured LLM output against schemas and manages data contract ingestion and quarantine.
Also known as nightmoose/contractgate, contractgate, @nightmoose/contractgate-mcp-server
- Stars
- 4
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- 0.4.1
- Last commit
- Nov 14, 2026
- License
- MIT
What is ContractGate MCP?
ContractGate validates and repairs structured LLM output against schemas and manages data contract ingestion and quarantine.
Summary generated from the project's README
About ContractGate MCP server
Ensuring structured LLM outputs adhere to strict definitions and managing data contract lifecycles is the primary function of this server. It combines two distinct capabilities into a single interface by acting as a thin stdio wrapper for a remote HTTP API. Developers use it to validate and repair structured model responses or to manage data ingestion through contract enforcement.
Users connect via an API key and can configure a custom base URL if needed. The AISchemaGate component provides tools like egress_validate to check outputs against JSON Schema or Pydantic rules, using violation fields such as min, max, pattern, enum, and compliance_mode to perform repairs. The DataContractGate component handles data contract ingestion and inspection through tools like validate_events and get_quarantine, supporting ODCS v3.1.0 and v3.2.0 contracts.
This setup allows for automated correction of model errors and organized management of quarantined data. It is designed for developers building reliable data pipelines or LLM-driven applications that require high precision in structured data formats.
Written from the project's README. Every use case is checked against a quote from it.
How to install ContractGate MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall ContractGate MCP in Claude Code
$ claude mcp add --env 'CONTRACTGATE_API_KEY=<YOUR_CONTRACTGATE_API_KEY>' contractgate -- npx -y @nightmoose/contractgate-mcp-serverInstall ContractGate MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"contractgate": {
"command": "npx",
"args": [
"-y",
"@nightmoose/contractgate-mcp-server"
],
"env": {
"CONTRACTGATE_API_KEY": "<YOUR_CONTRACTGATE_API_KEY>"
}
}
}
}Install ContractGate MCP in VS Code
.vscode/mcp.json
{
"servers": {
"contractgate": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@nightmoose/contractgate-mcp-server"
],
"env": {
"CONTRACTGATE_API_KEY": "<YOUR_CONTRACTGATE_API_KEY>"
}
}
}
}Install ContractGate MCP in VS Code CLI
$ code --add-mcp '{"name":"contractgate","type":"stdio","command":"npx","args":["-y","@nightmoose/contractgate-mcp-server"],"env":{"CONTRACTGATE_API_KEY":"<YOUR_CONTRACTGATE_API_KEY>"}}'Install ContractGate MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"contractgate": {
"command": "npx",
"args": [
"-y",
"@nightmoose/contractgate-mcp-server"
],
"env": {
"CONTRACTGATE_API_KEY": "<YOUR_CONTRACTGATE_API_KEY>"
}
}
}
}Install ContractGate MCP in Codex
$ codex mcp add contractgate --env 'CONTRACTGATE_API_KEY=<YOUR_CONTRACTGATE_API_KEY>' -- npx -y @nightmoose/contractgate-mcp-serverInstall ContractGate MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.contractgate] command = "npx" args = ["-y", "@nightmoose/contractgate-mcp-server"] [mcp_servers.contractgate.env] CONTRACTGATE_API_KEY = "<YOUR_CONTRACTGATE_API_KEY>"
Install ContractGate MCP in Gemini CLI
$ gemini mcp add -s user -e 'CONTRACTGATE_API_KEY=<YOUR_CONTRACTGATE_API_KEY>' contractgate npx -- -y @nightmoose/contractgate-mcp-serverInstall ContractGate MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"contractgate": {
"command": "npx",
"args": [
"-y",
"@nightmoose/contractgate-mcp-server"
],
"env": {
"CONTRACTGATE_API_KEY": "<YOUR_CONTRACTGATE_API_KEY>"
}
}
}
}Configuration
CONTRACTGATE_API_KEYRequiredSecretDataContractGate API key (cg_live_...). Create one at https://app.datacontractgate.com/account
CONTRACTGATE_BASE_URLGateway base URL. Defaults to https://api.datacontractgate.com
| Name | Description | |
|---|---|---|
| CONTRACTGATE_API_KEY | DataContractGate API key (cg_live_...). Create one at https://app.datacontractgate.com/account | RequiredSecret |
| CONTRACTGATE_BASE_URL | Gateway base URL. Defaults to https://api.datacontractgate.com |
Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachablenightmoose/contractgate is public and reachablegithub.com/nightmoose/contractgate ↗Pass
- Package names this repository as its source@nightmoose/contractgate-mcp-server names nightmoose/contractgate as sourcenpmjs.com/package/@nightmoose/contractgate-mcp-server ↗Pass
- Build provenance (Sigstore attestation)Sigstore attestation for @nightmoose/contractgate-mcp-servernpmjs.com/package/@nightmoose/contractgate-mcp-server/v/0.4. ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-11-12github.com/nightmoose/contractgate ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from @nightmoose/contractgate-mcp-serverPass
- No critical advisory in the package or its dependencies4 resolved dependencies checked; no critical advisoryosv.dev ↗Pass
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHub@nightmoose/contractgate-mcp-server
AISchemaGate validates and repairs structured LLM output against a contract, plus DataContractGate data contracts. Repair uses the violation fields from that check. The contract checks values a JSON Schema or Pydantic validation can leave open.
Official Model Context Protocol server. Thin
stdio wrapper over the HTTP API at https://api.datacontractgate.com (override
with CONTRACTGATE_BASE_URL). The dashboard host
https://app.datacontractgate.com is not the gateway.
One server, two products, same API key:
- AISchemaGate — validates structured LLM output
(
egress_validate→POST /egress/{id}). Repair uses the violation fields from that check (min,max,pattern,enum,compliance_mode). Forwardpayloadfrom the tool result, not the original body. - DataContractGate — infer and deploy data contracts, validate ingest
(
validate_events→POST /v1/ingest/{id}), including ODCS v3.1.0 and v3.2.0 contracts, and inspect quarantine (get_quarantine). Replay stays on the HTTP API (POST /contracts/{id}/quarantine/replay).
Registry metadata for the Official MCP Registry is server.json.
The title and description lead with AISchemaGate (description is the
100-character registry field). The server name stays
io.github.nightmoose/contractgate. Keywords and the longer summary are under
_meta. Smithery config is smithery.yaml;
its default contractgateBaseUrl is the API gateway. npm keywords, this
README, and DIRECTORY_LISTINGS.md are the directory
listing.
See docs/mcp-reference.md for tools and auth.
AISchemaGate app integrations: docs/integrations/.
{
"mcpServers": {
"contractgate": {
"command": "npx",
"args": ["-y", "@nightmoose/contractgate-mcp-server"],
"env": {
"CONTRACTGATE_API_KEY": "${CONTRACTGATE_API_KEY}"
}
}
}
}
cd mcp
npm install
npm test
npm run build
ContractGate MCP questions
How do I add ContractGate MCP to Claude Code?
Run claude mcp add --env 'CONTRACTGATE_API_KEY=<YOUR_CONTRACTGATE_API_KEY>' contractgate -- npx -y @nightmoose/contractgate-mcp-server in your terminal. Add --scope user to make it available in every project.
How do I add ContractGate MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What does AISchemaGate do?
AISchemaGate validates and repairs structured LLM output against a contract using violation fields like min, max, pattern, enum, and compliance_mode.
Can I use a custom API URL?
Yes, you can override the default HTTP API endpoint using the CONTRACTGATE_BASE_URL environment variable.
What are the capabilities of DataContractGate?
DataContractGate allows you to infer and deploy data contracts, validate ingest (including ODCS v3.1.0 and v3.2.0), and inspect quarantine.