Technical previewShare feedback
Fairspec
FairspecMaking data FAIR

Open source · MIT License

Fairspec MCP

Connect AI assistants to the Fairspec data management framework. Validate datasets, infer schemas, and query tables — directly from your editor or chat.

› Check broken.csv against schema.json.

●

Validating the table with the Fairspec MCP server.

fairspec · validateTableTool

{"resource":{"data":"broken.csv","tableSchema":"schema.json"}}

⎿

{"report":{"valid":false,"errors":[{"type":"cell/type","columnName":"id","rowNumber":3,"cell":"x","columnType":"integer"},{"type":"cell/type","columnName":"joined","rowNumber":2,"cell":"2024-02-30","columnType":"date"}]},"truncated":false}

●

Two cells fail: id is not an integer in row 3, and 2024-02-30 is not a date in row 2.

Input

broken.csv
id,name,joined,score
1,Ada,2024-01-15,91.5
2,Grace,2024-02-30,88.0
x,Linus,2024-03-21,79.25

Connect in one step

Wire up the Fairspec MCP server in your favorite AI assistant. It ships with the Python, TypeScript and Rust packages — pick the one you have.

  • Python, TypeScript or Rust

    Run it with uvx from the Python package, npx from the TypeScript one, or the fairspec binary from the GitHub releases. Same tools, same names.

  • Your assistant

    Claude Desktop, Claude Code, Codex and Gemini CLI each take one command or one config entry.

  • Runs on your machine

    The server is a local process your assistant starts. It reads the files you point it at and fetches only public URLs; set FAIRSPEC_HOST_POLICY=any to reach localhost or intranet hosts.

  • Twelve tools

    Validate, infer, preview and query data, schemas, dialects, tables and whole datasets.

Install

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "fairspec": {
      "command": "uvx",
      "args": ["fairspec@latest", "mcp"]
    }
  }
}

Tools

Twelve tools organized around core Fairspec concepts: data, data schemas, datasets, files, file dialects, tables, and table schemas.

Validate Data

Validates data against a provided data schema, checking that every value conforms to the declared types and constraints. Returns detailed error reports pinpointing exactly which values failed validation and why.

Infer Data Schema

Analyzes a data sample and infers a data schema descriptor describing its structure, types, and constraints. Examines patterns across values to determine the most appropriate type for each field.

Validate Data Schema

Checks that a data schema descriptor is well-formed and conforms to the Fairspec specification. Ensures that all field definitions use valid types and that constraints are properly structured.

Infer Dataset

Scans a directory of files and produces a dataset descriptor capturing the structure, resources, and metadata. Automatically discovers tabular files, infers their schemas and dialects.

Validate Dataset

Checks that a dataset descriptor is well-formed and that all referenced resources are consistent. Verifies that resource paths resolve correctly and that schemas match the actual data.

Query Dataset

Runs a SQL query across a dataset, with each table resource available under its name, and returns the matching rows. Joins related resources in one query and loads only the resources the query names.

Preview File

Returns the raw source of a local or remote file, exactly as stored and before any parsing, so a CSV's delimiter, header and quoting are visible. Reads only the first lines and caps the size, so a large file cannot flood the conversation.

Infer File Dialect

Detects the dialect of a tabular file, including delimiter, quote character, and header row presence. Samples the file content to reliably determine formatting details such as line terminators and encoding.

Query Table

Runs a SQL query against a tabular data file and returns the matching rows. Supports standard SQL syntax for filtering, sorting, aggregating, and joining data.

Validate Table

Checks that a table descriptor is well-formed and that the referenced data matches the declared schema. Reports mismatches between expected and observed field types, missing values, and constraint violations, plus any named SQL checks you add.

Infer Table Schema

Reads a tabular data file and infers a table schema descriptor with field names, types, and constraints. Analyzes column values to determine appropriate data types and identifies common patterns.

Validate Table Schema

Checks that a table schema descriptor is well-formed and conforms to the Fairspec specification. Ensures that all field definitions, types, and constraints are valid and properly structured.

Files in, a FAIR dataset out

Ask for a dataset and the server describes your files: dialect, schema and integrity, ready to cite and validate.

members.csv
id,name,joined,score
1,Ada,2024-01-15,91.5
2,Grace,2024-02-03,88.0
3,Linus,2024-03-21,79.25
inferDatasetTool
{
  "resources": [
    {
      "data": "members.csv",
      "name": "members",
      "textual": true,
      "integrity": { "type": "sha256", "hash": "67c830fe…108a" },
      "fileDialect": {
        "format": "csv", "delimiter": ",",
        "lineTerminator": "\n", "headerRows": [1]
      },
      "tableSchema": {
        "properties": {
          "id": { "type": "integer" },
          "name": { "type": "string" },
          "joined": { "type": "string", "format": "date" },
          "score": { "type": "number" }
        }
      }
    }
  ]
}

Ask in plain language

Just ask in natural language. Try one of these prompts.

prompts
  • Validate my dataset in the current directory
  • Infer the schema for data.csv
  • Check if my data schema is valid
  • Detect the dialect of measurements.tsv
  • Query users.csv for all records where age > 30
  • Infer a dataset descriptor from all files in the data folder
  • Validate the table schema in schema.json
  • Show me the first 10 rows of results.csv sorted by date
  • Skills pick the tool

    The Fairspec agent skills tell your coding agent which tool fits a task and how to read what it returns.

  • The same operations in the CLI

    Every tool has a fairspec command behind it, so a script or CI job can repeat what the assistant did.

  • Docs agents can read

    Every docs page has a Markdown twin, indexed in /llms.txt.

Ask in plain language. Get FAIR data back.

Pair the server with the agent skills so your coding agent knows when to reach for each tool, or script the same operations from the CLI.