# Triplex schema contracts

> Triplex schema contracts is an open-source MCP server for legal and government. Infer and validate schema contracts on local CSV, TSV and JSON Lines files. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Linux, macOS, Windows
- **Website:** https://triplexanalytics.io
- **Repository:** https://github.com/triplexanalytics/triplex/tree/HEAD/apps/triplex-mcp
- **MCP Registry name:** io.github.triplexanalytics/triplex-mcp
- **Categories:** legal and government, files and documents, analytics and data, developer tools
- **Listing updated:** 2026-11-15

## About

Triplex's server is a small Rust binary that a coding agent launches as a local process over stdio. It reads files by path and does not use the network, so tabular data stays on the machine. The README says nothing in it reads bytes over the wire.

Two read-only tools are exposed. One infers a schema contract from a file, optionally from a sample of rows, and the other checks a file against an existing `.triplex.yaml` contract. The anonymize function from the wider Triplex project is not exposed yet. Install it with `cargo install triplex-mcp`; there are no flags or config files.

## Features

- **Schema inference:** Builds a schema contract from a local data file, optionally sampling rows.
- **Contract validation:** Checks a file against a .triplex.yaml contract.
- **Local only:** Uses stdio and no network access.
- **Read-only tools:** Both tools only read the file path they are given.
- **Simple install:** Installs from crates.io with no flags or config file.

## Good for

- Having an agent draft a schema for a new CSV export
- Validating incoming data files against an agreed contract
- Catching column drift in JSON Lines logs before loading
- Checking sensitive files without sending them anywhere

## Install

### Claude Code (Terminal)

```sh
claude mcp add triplex-mcp -- npx -y triplex-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "triplex-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "triplex-mcp"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "triplex-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "triplex-mcp"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "triplex-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "triplex-mcp"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "triplex-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "triplex-mcp"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "triplex-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "triplex-mcp"
      ]
    }
  }
}
```

## Tools

- `schema_infer`: Infers a schema contract from a local file
- `schema_validate`: Checks a local file against a .triplex.yaml contract

## FAQ

### Does it send data over the network?

No. The README says it uses stdio only, with no network and no server.

### Can it anonymize data?

Not yet; anonymize is not exposed through this server.

### Which file formats work?

CSV, TSV and JSON Lines files.

### How do I install it?

Run `cargo install triplex-mcp`, then point an MCP client's stdio transport at the binary.

### Is Triplex schema contracts free?

Yes. Triplex schema contracts is open source, so you can use and self-host it for free.

### How do I add Triplex schema contracts to Claude Code?

Run this command in your terminal: claude mcp add triplex-mcp -- npx -y triplex-mcp

### What are the best alternatives to Triplex schema contracts?

The closest alternatives to Triplex schema contracts are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Agent-Native Analytics](https://ai-powered.com/mcp/agent-native-analytics): Agent-Native Analytics is an open-source MCP server for analytics and data.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.

---
Source: https://ai-powered.com/mcp/triplex-schema-contracts
