Connect

Datagoat has one API with two doors: MCP for agents and REST for code. Both run the same operations and give the same answers.

Get a key

Send it as Authorization: Bearer <key>. Keep live keys out of code; use DATAGOAT_API_KEY.

MCP

The server is https://api.datagoat.io/mcp (streamable HTTP). Hosts that support OAuth sign you in (your Datagoat account is created at first sign-in); others take a key as a Bearer header. Once Datagoat is listed in a host's connector directory, you can add it from there instead of pasting the URL.

Host How
Claude Code claude mcp add --transport http datagoat https://api.datagoat.io/mcp
Claude.ai / Claude Desktop Settings → Connectors → Add custom connector → https://api.datagoat.io/mcp
ChatGPT Settings → Apps → Advanced → Developer mode → add the URL
Cursor / VS Code add an HTTP MCP server with the URL
Codex CLI codex mcp add datagoat --url https://api.datagoat.io/mcp --bearer-token-env-var DATAGOAT_API_KEY
n8n MCP Client Tool node → the URL + a Bearer credential
LangGraph MultiServerMCPClient({"datagoat": {"url": "https://api.datagoat.io/mcp", "transport": "http"}})

Then ask: "Using dg_ask on sample:saas_churn, how likely is cust_0001 to churn, and why?" Or try another shape: "In Datagoat's sample:sensor_stream, which machines will fault in the next three days?"

Tools that only read (dg_ask, dg_poll, dg_preflight, dg_drift, dg_verify, dg_describe) are marked read-only, so hosts can run them without a prompt. dg_add_dataset and dg_report_outcomes write, and dg_delete_dataset is destructive, so hosts ask first.

Python

pip install datagoat
from datagoat import Client, yesno
dg = Client()   # reads DATAGOAT_API_KEY

LangChain: pip install "datagoat[langchain]", then from datagoat.langchain import datagoat_tools.

TypeScript

npm install @datagoat/sdk
import { Datagoat, yesno } from "@datagoat/sdk";
const dg = new Datagoat({ apiKey: process.env.DATAGOAT_API_KEY! });

REST

POST https://api.datagoat.io/v1/<operation> with a JSON body. The OpenAPI document is at https://api.datagoat.io/openapi.json. See API reference.