Skip to main content

Use DataChord from an AI agent (MCP)

DataChord runs as a Model Context Protocol server, so an AI agent — Claude Code, Cursor, or any MCP client — can list your mapping projects, test a mapping against a record, generate code, and trigger pipeline runs, all scoped to your workspace by a personal access token.

By the end of this page you will have:

  • Minted a personal access token (PAT) for your workspace.
  • Started the MCP server mode.
  • Connected an MCP client and called a DataChord tool.
You'll need
  • A running DataChord deployment you can reach over HTTP.
  • An MCP-capable client (e.g. Claude Code).

Step 1 — Mint a personal access token

Open Settings → Personal access tokens (/settings/tokens), give the token a name (e.g. claude-code-laptop), and click Create token. Copy the dck_… value immediately — it is shown only once. Only the token's hash is stored; you can revoke it any time from the same page.

Step 2 — Start the MCP server

The MCP surface runs in its own deployment mode. With Docker Compose:

docker compose --profile mcp up mcp-server

This boots a process with ENGINE_MODE=mcp-server serving the MCP endpoint at /mcp on port 8001. (Self-hosters can instead set MCP_ENABLE_IN_STANDALONE=true to mount it inside the main app.)

Step 3 — Connect a client

Point your MCP client at the streamable-HTTP endpoint and pass the PAT as a bearer token:

{
"mcpServers": {
"datachord": {
"url": "https://your-host:8001/mcp",
"headers": { "Authorization": "Bearer dck_…" }
}
}
}

Step 4 — Call a tool

The server exposes these tools, each scoped to the token's workspace:

ToolWhat it does
list_projectsList your mapping projects
get_projectSchemas + mapping-field status summary
test_mapping_on_recordRun the mapping's rules against one record
generate_codeEmit code in a chosen language
export_mapping_configExport the full mapping definition
trigger_dag_runQueue a pipeline run
get_run_statusCheck a run's status

Ask your agent to "list my DataChord projects" or "test this record against project X" and it will call the matching tool.

Verify

  • The MCP client lists 7 DataChord tools after connecting.
  • A missing or revoked token is rejected with a 401 — the workspace is never exposed without a valid PAT.

What's next