Hex MCP Server
Connect AI agents to Hex's collaborative data notebooks — query data and run Threads via natural language.
Updated
What is Hex MCP?
The Hex MCP server is a Model Context Protocol server that lets AI assistants interact directly with your Hex workspace — searching projects and running natural-language data questions through Hex's agentic Threads.
It is an official, Hex-hosted remote server reachable at https://app.hex.tech/mcp and authenticated over OAuth, so your AI client connects to your existing Hex workspace without a separate API key. Threads created through the MCP server behave like Threads in the Hex app: the agent automatically selects among the data connections the user has access to in order to answer a question, searching the workspace's default connection first.
The server is currently in beta and available on Hex's Team and Enterprise plans. Users need the Explorer workspace role or higher, and the server works with standard MCP clients including Claude Code, Claude Desktop, Cursor, and ChatGPT. Enterprise customers (single-tenant, EU, or HIPAA) replace app.hex.tech with their custom Hex URL.
Tools the Hex MCP server exposes
| Tool | What it does |
|---|---|
| search_projects | Find projects within your Hex workspace. |
| create_thread | Start a new agentic Thread to ask a data question in natural language. |
| get_thread | Retrieve the messages and results of an existing Thread. |
| continue_thread | Add a follow-up question to an existing Thread conversation. |
Connect the Hex MCP server
Claude Code
- 1
Add the server
Run: claude mcp add --transport http hex https://app.hex.tech/mcp
- 2
Authenticate
Run /mcp inside Claude Code, select hex, and complete the OAuth flow in your browser (choosing a workspace if you have more than one).
- 3
Use it
Ask data questions in natural language — Claude calls search_projects and the Thread tools against your Hex data connections.
Remote HTTP server with OAuth; requires a Hex Team/Enterprise plan and Explorer role.
Cursor
- 1
Open MCP settings
Go to Settings → Cursor Settings → Tools & MCP, or edit ~/.cursor/mcp.json directly.
- 2
Add Hex
Add a remote MCP server with URL https://app.hex.tech/mcp — e.g. {"mcpServers":{"hex":{"url":"https://app.hex.tech/mcp"}}}
- 3
Connect
Back in Settings, click Connect to start the OAuth flow and approve the connection (and pick a workspace if prompted).
Add as a remote MCP server URL; connect via OAuth.
Sample use cases
Security & permissions
The Hex MCP server authenticates over OAuth — your AI client is redirected to Hex's authentication provider to approve the connection, and (for multi-workspace users) to choose a workspace. No long-lived API key is stored in the client.
The agent operates with the permissions of the connecting user: it can only reach the data connections that user already has access to in Hex, and a minimum Explorer workspace role is required. Access is scoped to searching projects and creating/reading/continuing Threads — the server answers text prompts only and cannot upload files. Enterprise customers can point the connection at a single-tenant, EU, or HIPAA-compliant Hex URL.
Using Hex MCP with Gamut
In a Gamut workflow, the Hex MCP server is wired in as a connected tool so an automated agent can pull answers from your governed data on a schedule or in response to an event — for example, a scheduled agent that opens a Thread to ask "what was yesterday's signup conversion?", reads the result, and posts a summary to Slack. Gamut manages the OAuth connection and credential lifecycle, and the agent only reaches the Hex projects and data connections the authorizing user can access. Because the server answers text prompts (it cannot ingest uploaded files), it suits read-and-report and data-Q&A steps rather than file-processing tasks.
Frequently asked questions
Can the Hex MCP server run SQL queries directly?
The MCP server triggers Hex project runs, which can include SQL cells connected to your warehouse. It doesn't execute raw SQL outside Hex — all queries run through your configured Hex connections.
Does it support Hex's Python and R cells?
Yes. When you trigger a Hex project run via MCP, all cell types execute — SQL, Python, R, and no-code cells — just like running the project manually.
Can I pass parameters to a Hex project run?
Yes. Hex input parameters can be set when triggering a run, so your agent can customize the analysis (date ranges, filters, thresholds) per execution.
Are Hex project run results available in real time?
Runs execute asynchronously. The MCP server can poll for completion and retrieve results once the run finishes — timing depends on your analysis complexity.
What Hex plan is required for API access?
API access is available on Hex's Team and Enterprise plans. Check Hex's pricing page for current plan details and API rate limits.
Can I create new Hex projects via MCP?
The MCP server primarily focuses on running existing projects and retrieving results. Project creation and editing are typically done in the Hex UI.
Does Hex MCP support scheduling recurring runs?
You can use your AI agent to trigger runs on any schedule you configure — the agent acts as the scheduler, calling the Hex MCP server at your chosen interval.