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/openai @ai-sdk/mcp
Install the Composio SDK for Python or TypeScript
2

Initialize Client and Create Tool Router Session

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

const composio = new Composio({ apiKey: 'your-api-key' });
const session = await composio.create('your-user-id');
console.log(`Tool Router session created: ${session.mcp.url}`);
Import and initialize the Composio client, then create a Tool Router session for Hex
3

Connect to AI Agent

typescript
import { openai } from '@ai-sdk/openai';
import { experimental_createMCPClient as createMCPClient } from '@ai-sdk/mcp';
import { generateText } from 'ai';

const client = await createMCPClient({
  transport: {
    type: 'http',
    url: session.mcp.url,
    headers: {
      'x-api-key': 'your-composio-api-key',
    },
  },
});

const tools = await client.tools();
const { text } = await generateText({
  model: openai('gpt-4o'),
  tools,
  messages: [{
    role: 'user',
    content: 'Run the weekly revenue Hex project and report its status'
  }],
  maxSteps: 5,
});

console.log(`Agent: ${text}`);
Use the MCP server with your AI agent (Anthropic Claude or Mastra)
SETUP GUIDE

Connect Hex API Tool with your Agent

1

Install Composio

typescript
npm install @composio/openai
Install the Composio SDK
2

Initialize Composio and Create Tool Router Session

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

const composio = new Composio({
  provider: new OpenAIResponsesProvider(),
});
const openai = new OpenAI({});
const session = await composio.create('your-user-id');
Import and initialize Composio client, then create a Tool Router session
3

Execute Hex Tools via Tool Router with Your Agent

typescript
const tools = session.tools;
const response = await openai.responses.create({
  model: 'gpt-4.1',
  tools: tools,
  input: [{
    role: 'user',
    content: 'List recent Hex projects in my workspace'
  }],
});
const result = await composio.provider.handleToolCalls(
  'your-user-id',
  response.output
);
console.log(result);
Get tools from Tool Router session and execute Hex actions with your Agent

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

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