MCP Reference
Hotdata MCP
Model Context Protocol server – expose workspace tools to AI agents.
Spec: Model Context Protocol
Endpoints
- GET
https://mcp.hotdata.dev/mcp/sse– open the event stream and receive this session's message endpoint. - POST
https://mcp.hotdata.dev/mcp/message?session=<session_id>– send JSON-RPC requests on that session.
The server speaks MCP's HTTP+SSE transport at protocol version 2024-11-05.
The POST endpoint is not callable on its own. The SSE stream issues the session id, and a POST without one is refused with 400 Missing session (query param or X-MCP-Session header).
Authentication
Opening the stream requires both headers:
Authorization: Bearer <user_api_key>
X-Workspace-Id: <workspace_public_id>
The API key is the same one api.hotdata.dev accepts. The workspace is pinned to the session when the stream opens, and every tool call on that session is scoped to it.
Each POST carries the same Authorization: Bearer header plus the session id. The key must belong to the user that opened the session.
X-Workspace-Id is not read on POST. The session's workspace always applies, so a request cannot re-target a session it did not open.
If a client sends an Origin header, it must be an allowed origin: https://mcp.hotdata.dev, or a localhost origin for local development. Anything else is refused with 403 Origin not allowed.
Clients that send no Origin, such as CLI tools and server-side agents, are unaffected.
Session handshake
-
Open the stream with the two auth headers, and keep it open for the life of the session.
curl -N https://mcp.hotdata.dev/mcp/sse \ -H "Authorization: Bearer $HOTDATA_API_KEY" \ -H "X-Workspace-Id: $HOTDATA_WORKSPACE_ID" -
Read the
endpointevent. The first event on the stream is the message URL — raw text, not JSON — with the session id already in the query string:event: endpoint data: https://mcp.hotdata.dev/mcp/message?session=7Xwn... -
POST JSON-RPC to that URL. Keep the
sessionquery param, or send the id as anX-MCP-Sessionheader instead:curl "https://mcp.hotdata.dev/mcp/message?session=$SESSION_ID" \ -H "Authorization: Bearer $HOTDATA_API_KEY" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"example","version":"0.1.0"}}}' -
Read the response on the stream. The POST answers
200with an empty body — it is an acknowledgement, not the result. Every JSON-RPC response arrives on the SSE stream as amessageevent:event: message data: {"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2024-11-05","capabilities":{"tools":{"listChanged":true}},"serverInfo":{"name":"hotdata-mcp","version":"1.0.0"}}}
Normal MCP ordering follows:
initialize- The
notifications/initializednotification, which produces no response tools/listandtools/call
The stream emits : keepalive comments while idle.
A session lives one hour. A POST against an expired or unknown id returns 404 Session not found or expired. Open a new stream to get a new session.
Available tools
The server exposes the tools below to AI agents. Each tool is described with its parameters as reported by the server's tools/list.
Running queries is not available over MCP yet. Use the API or the CLI to run SQL.
Data sources & tables
List and inspect connections and their tables.
list_data_sources
List data sources (connections) in the current workspace. Returns names; use connection_id from context when calling list_tables.
list_tables
List tables for a connection. connection_id is the connection's public_id (e.g. from list_data_sources).
Parameters:
connection_id(string, required) — Connection public ID.
describe_table
Get table description: column metadata (name, type, nullable, default). schema is usually public.
Parameters:
connection_id(string, required) — Connection public ID.schema(string, required) — Schema name.table(string, required) — Table name.
get_tables_summary
List tables for a connection; optionally include row count and size for each (up to table_limit).
Parameters:
| Param | Type | Required | Description |
|---|---|---|---|
connection_id | string | Yes | Connection public ID. |
include_row_count | boolean | No | Include row count per table. Default false. |
include_size | boolean | No | Include size per table. Default false. |
table_limit | integer | No | Maximum number of tables to summarize. Default 20. |
get_column_stats
Get column statistics for a table: cardinality, nulls, min, max, and sample values. Use to guide filtering and joins.
Parameters:
connection_id(string, required) — Connection public ID.schema(string, required) — Schema name.table(string, required) — Table name.
Connections
Inspect and manage existing connections.
get_connection
Get connection details by id: name, source_type, table_count, discovery_status.
Parameters:
connection_id(string, required) — Connection public ID.
delete_connection
Delete a connection by id.
Parameters:
connection_id(string, required) — Connection public ID.
run_discovery
Re-run schema discovery for a connection by id. Use after the source schema changes.
Parameters:
connection_id(string, required) — Connection public ID.
purge_connection_cache
Purge cached schema and table data for a connection by id. Use to force a fresh read after upstream changes.
Parameters:
connection_id(string, required) — Connection public ID.
Metrics & queries
Inspect query metrics, latency, storage, and saved queries.
explain_workspace_metrics
Explain current workspace metrics (connection count, total queries, p50/p99 latency). Includes trend if available.
get_query_latency_trend
Get query latency trend for the last 24 hours. Returns p99 min/max/latest.
get_query_storage
Get visibility into query result storage: object count and total bytes for the workspace.
get_query_count
Get total query count for the workspace.
list_query_errors
List recent query errors in the workspace (time, SQL preview, status_code).
Parameters:
limit(integer, optional) — Maximum number of errors to return. Default10.
list_recent_queries
List recent queries in the workspace (time, SQL preview, latency_ms, execution_time_ms).
Parameters:
limit(integer, optional) — Maximum number of queries to return. Default10.
get_slow_queries
List slowest queries in the workspace by latency.
Parameters:
limit(integer, optional) — Maximum number of queries to return. Default5.
list_saved_queries
List saved (pinned) queries in the workspace.
Parameters:
limit(integer, optional) — Maximum number of saved queries to return. Default10.