Hex MCP server for AI agents and assistants

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
FRAMEWORKS

Use Hex with any AI Agent Framework

Choose a Framework you want to connect Hex with

Rolling this out across your team?

Give your team centralized access control across every framework with Composio’s MCP Gateway.

EXPLORE MCP GATEWAY
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.

Yes. Composio is SOC 2 Type II compliant and is built to keep your Hex connection and credentials secure. OAuth tokens and API keys are encrypted, and sensitive customer data is protected at rest and in transit.

Composio also undergoes independent security testing and continuously monitors its systems for security threats. You can review the latest reports and policies in the Composio Trust Center.

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

Create the key in your Hex account settings, then paste it once on Composio's connection page. Composio stores it encrypted and uses it only for the Hex actions your agent runs. Nobody else in your workspace can read it, and you can revoke it inside Hex at any time.

When you connect a Hex account through Composio, every action runs under that account, so anything the agent creates, sends, or changes shows up in Hex as done by you. Keep an approval step in your prompt for actions with side effects, such as sending or deleting, and have the agent draft first.

Whatever the credentials you connect allow inside Hex. If Hex lets you scope a key to specific permissions, create a scoped one so the agent can only do what you intend. You can revoke the key inside Hex at any time.

Yes. Composio supports multiple connected accounts for the same app, and that works in Claude, ChatGPT, or any other assistant you connect through Composio. Give each Hex connection a name such as work or personal, and the assistant uses the one you mention in the request. Each account keeps its own credentials and nothing is merged.

The connection stops working the moment Hex rejects the old key. Create a new key in Hex and reconnect the account from the Composio dashboard or by asking your agent to reconnect Hex. Nothing else changes.

Composio's free plan includes 100,000 tool calls per month with no credit card, which covers most personal Hex use. Paid plans add higher limits and team features. Your Hex plan and its API limits still apply as usual.

Built-in connectors usually give one AI access to a limited set of apps. Many people use Composio because it lets their AI connect to more apps than it normally supports, or connect to multiple accounts for the same app (e.g. connect Claude to multiple Hex accounts).

With Composio, you connect Hex once and then use it across different AI assistants without setting it up separately in each one. Connect your apps to Composio once, then connect Composio to whichever AI you use, whether that's Claude, ChatGPT, Hermes, or your own custom assistant.

Start with Hex.It takes 30 seconds.

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

Start building