Skip to content

MCP Access

Every data-mode Space can expose its DataAgent as an MCP (Model Context Protocol) server, so external agents — Claude, Cursor, or any MCP-capable client — can query and analyze the Space's datasets as first-class tools.

Data mode only

MCP access is available for data-mode Spaces. General-mode Spaces (and their keys) are rejected by the MCP endpoint — use the Open API there instead.

Connect a client

  1. Open the Space → click the menu (top right) → MCP access.
  2. Create an API key (keys are shared with API access — creating or revoking one takes effect in both places, and the full key is shown exactly once).
  3. Point your MCP client at the endpoint with the key as a Bearer token.

Endpoint: https://console.datyo.ai/mcp (Streamable HTTP)

Claude Code

bash
claude mcp add --transport http datyo https://console.datyo.ai/mcp \
  --header "Authorization: Bearer sk-df-..."

Cursor (~/.cursor/mcp.json, or .cursor/mcp.json inside a project)

json
{
  "mcpServers": {
    "datyo": {
      "url": "https://console.datyo.ai/mcp",
      "headers": { "Authorization": "Bearer sk-df-..." }
    }
  }
}

Claude Desktop (claude_desktop_config.json — remote servers with an auth header go through the mcp-remote bridge, requires Node.js)

json
{
  "mcpServers": {
    "datyo": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://console.datyo.ai/mcp",
               "--header", "Authorization: Bearer sk-df-..."]
    }
  }
}

OpenAI (Responses API — attach the MCP server as a tool)

python
from openai import OpenAI

client = OpenAI()
resp = client.responses.create(
    model="gpt-4.1",
    tools=[{
        "type": "mcp",
        "server_label": "datyo",
        "server_url": "https://console.datyo.ai/mcp",
        "headers": {"Authorization": "Bearer sk-df-..."},
        "require_approval": "never",
    }],
    input="Top 5 cities by sales",
)
print(resp.output_text)

JSON config (generic Streamable HTTP — most other clients)

json
{
  "mcpServers": {
    "datyo": {
      "type": "streamable_http",
      "url": "https://console.datyo.ai/mcp",
      "headers": { "Authorization": "Bearer sk-df-..." }
    }
  }
}

Tools

ToolWhat it does
list_datasetsDataset catalog of the Space — name, description, columns, engine, plus the exact table / table_alias names to use in run_sql (use them verbatim; quote non-ASCII names)
askEnd-to-end natural-language Q&A: the DataAgent generates and runs SQL, optionally charts, and returns {answer, sql, result, chart}
generate_sqlQuestion → one DuckDB SQL statement (generated only, not executed)
run_sqlExecute a DuckDB SQL statement over the Space's datasets, returns {columns, rows, took_ms}
make_chartPick a Datyo chart spec (line, bar, pie, scorecard, …) for a result set, returns {type, config}
generate_summaryNatural-language summary of a result set

Spaces with SLS or MaxCompute datasets additionally expose run_sls_query / run_maxcompute_query, with the same contracts as the built-in agent tools.

A typical orchestration: list_datasetsgenerate_sqlrun_sqlmake_chart / generate_summary. Or just call ask and let the DataAgent do all of it in one step.

Notes

  • Results larger than 500 rows are truncated (truncated: true, with total_rows).
  • All model-backed tools (ask, generate_sql, make_chart, generate_summary) are billed and rate-limited like normal chat; usage is attributed to the key owner's account. list_datasets and the SQL execution tools don't call the model and are free.
  • Revoked keys fail immediately.

Datyo · The Agent-native intelligent data analytics platform