Skip to content

MCP server

DataSquares ships a built-in Model Context Protocol (MCP) server, so AI assistants outside the product — Claude Desktop, Claude Code, or anything that speaks MCP — can explore your models, run read-only queries, and evaluate governed metrics, all under your permissions.

One stateless endpoint speaking MCP over Streamable HTTP:

POST https://<your-datasquares-host>/api/mcp

Authenticate with an API key carrying the mcp:read scope in the X-API-Key header (keys look like ds_…; create one under Admin → API Keys — any user can mint a read-only key). A user bearer token works too.

For Claude Code:

Terminal window
claude mcp add --transport http datasquares \
https://<your-host>/api/mcp \
--header "X-API-Key: ds_your_key_here"

For clients configured via JSON (the standard mcpServers shape):

{
"mcpServers": {
"datasquares": {
"type": "http",
"url": "https://<your-host>/api/mcp",
"headers": { "X-API-Key": "ds_your_key_here" }
}
}
}

All read-only — MCP clients read governed data; authoring stays in the product.

Tool Does
list_dashboards / list_reports inventory of the workspace’s dashboards and reports
list_models semantic models with table/field counts
get_schema a model’s tables, fields, relationships, and SQL dialect
search_tables / search_fields navigate large models by name/pattern
describe_field field metadata, sample values, statistics
preview_data / profile_data sample rows / per-column statistics
validate_sql parse & safety-check SQL without running it
execute_query run a read-only SELECT (destructive SQL is blocked)
list_metrics governed metrics with expressions, targets, certification
evaluate_metric a metric’s current value + pace-to-target, through the governed pipeline
  • Read-only by construction — there are no mutating tools.
  • Row-level security is enforced fail-closed: every tool runs as the calling identity, through the same governed handlers as the in-product AI chat. RLS-restricted callers can’t side-step their filters with raw SQL.
  • Standard rate limits apply; API-key scope bounds what the key can ever do.