Hex MCP for AI Agents

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Hex MCP or direct API to list projects, inspect workspace resources, trigger project runs, and track analytics workflows through natural language.

Hex logoHex
Api Key

Hex is a collaborative data workspace for SQL, Python, and R notebooks. It helps teams build analytics, data apps, and data science workflows together.

32 Tools

Try Hex now

Type what you want done — sign in and watch it run live in the Tool Router playground.

TOOL ROUTER PLAYGROUND
Hex
Try asking
TOOLS

Supported Tools

Every Hex action and event your agent gets out of the box.

Cancel Run

Tool to cancel a project run that is in progress.

Create Cell

Tool to create a new cell in the draft version of a Hex project.

Create Collection

Tool to create a new collection in the Hex workspace.

Create Group

Tool to create a new group in the Hex workspace.

Deactivate User

Deactivates a user in the Hex workspace.

Delete Cell

Permanently delete a cell from the draft version of a project.

Delete Group

Deletes a group from the Hex workspace.

Delete Guide Draft

Deletes a guide draft by ID from Hex.

Edit Collection

Tool to edit a collection's name, description, and sharing settings in Hex.

Edit Group

Tool to edit a group's name and/or members in Hex.

Edit Project Sharing Collections

Tool to add a project to collections or remove it from collections.

Edit Project Sharing Groups

Tool to edit project sharing settings for groups in Hex.

Edit Project Sharing Settings

Tool to edit project sharing settings for workspace members and public web access.

Edit Project Sharing Users

Tool to edit project sharing settings for individual users in Hex.

Get Cell

Tool to get a single cell by ID from the draft version of a Hex project.

Get collection

Tool to get information about a specific collection in Hex.

Get Group

Tool to retrieve information about a specific Hex group.

Get Project

Tool to get metadata about a single Hex project.

Get Project Runs

Tool to retrieve the status of API-triggered runs for a specific Hex project.

Get Run Chart Image

Tool to retrieve a rendered chart image from a Hex project run.

Get Run Status

Tool to retrieve the status of a specific Hex project run.

List Cells

Tool to list all cells from the draft version of a Hex project.

List Collections

Tool to retrieve all collections in the workspace with pagination support.

List Data Connections

Tool to list all data connections in the Hex workspace with pagination support.

List groups

Tool to list all groups in the Hex workspace with pagination support.

List Hex Projects

Tool to list all viewable Hex projects with pagination and filtering support.

List Users

Tool to list all users in the Hex workspace with pagination support.

Publish Guide Drafts

Tool to publish all currently drafted guides or specific guides by ID.

Run Project

Tool to trigger a run of the latest published version of a Hex project.

Update Cell

Tool to update a cell's source code and/or data connection in Hex.

Update Project Status

Tool to add or remove a status (including endorsements) from a Hex project.

Upsert Guide Draft

Tool to update or create guide drafts by filePath.

SETUP GUIDE

Connect Hex MCP Tool with your Agent

1

Install Composio

typescript
npm install @composio/core ai @ai-sdk/mcp @ai-sdk/openai
Install the Composio SDK and your agent framework
2

Create a session with MCP enabled

typescript
import { Composio } from "@composio/core";

const composio = new Composio();
const { mcp } = await composio.create("your-user-id", {
  toolkits: ["hex"],
  mcp: true,
});
Create a session scoped to Hex and read its MCP URL and headers
3

Connect your agent to the MCP server

typescript
import { createMCPClient } from "@ai-sdk/mcp";
import { openai } from "@ai-sdk/openai";
import { generateText, stepCountIs } from "ai";

const client = await createMCPClient({
  transport: { type: "http", url: mcp.url, headers: mcp.headers },
});

const { text } = await generateText({
  model: openai("gpt-5.6-sol"),
  tools: await client.tools(),
  prompt: "List recent Hex projects in my workspace",
  stopWhen: stepCountIs(10),
});

console.log(text);
await client.close();
Pass the session's MCP URL and headers to your agent and run a Hex request
SETUP GUIDE

Connect Hex API Tool with your Agent

1

Install Composio

typescript
npm install @composio/core @composio/openai openai
Install the Composio SDK, the OpenAI provider, and the OpenAI SDK
2

Create a Composio session

typescript
import OpenAI from "openai";
import { Composio } from "@composio/core";
import { OpenAIResponsesProvider } from "@composio/openai";

const composio = new Composio({ provider: new OpenAIResponsesProvider() });
const client = new OpenAI();

const session = await composio.create("your-user-id", { toolkits: ["hex"] });
const tools = await session.tools();
Initialize Composio with the OpenAI Responses provider and create a session scoped to Hex
3

Run Hex tools with your agent

typescript
let response = await client.responses.create({
  model: "gpt-5.6-sol",
  tools,
  input: [{ role: "user", content: "List recent Hex projects in my workspace" }],
});

while (response.output.some((o) => o.type === "function_call")) {
  const outputs = await composio.provider.handleToolCalls(session, response.output);
  response = await client.responses.create({
    model: "gpt-5.6-sol",
    tools,
    previous_response_id: response.id,
    input: outputs,
  });
}

console.log(response.output_text);
Send a request, execute the Hex tool calls through the session, and print the final answer

Why Use Composio?

AI Native Hex Integration

  • Supports both Hex MCP and direct API based integrations
  • Structured, LLM-friendly schemas so agents can work with Hex projects more reliably
  • Useful coverage for listing projects, checking project metadata, and running analytics workflows

Managed Auth

  • Securely store Hex API keys without hard-coding them in your agent code
  • Central place to manage, scope, and revoke Hex access
  • Per user and per environment credentials, which keeps local testing and production clean

Agent Optimized Design

  • Tools are shaped for language models, so agents can choose the right Hex action with less guesswork
  • Comprehensive execution logs show what ran, when it ran, and on whose behalf
  • Clear tool responses make it easier for agents to explain Hex workflow results back to users

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access Hex
  • Scoped, least privilege access to Hex resources
  • Full audit trail of agent actions to support review and compliance
FAQ

Frequently asked questions

Yes, Hex requires you to configure your own API key. Once set up, Composio handles secure credential storage and API request handling for you.

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. Learn more.

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

Start with Hex.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Hex tool your agent needs.Free to start.

Start building