# Hex

```json
{
  "name": "Hex",
  "slug": "hex",
  "url": "https://composio.dev/toolkits/hex",
  "markdown_url": "https://composio.dev/toolkits/hex.md",
  "logo_url": "https://logos.composio.dev/api/hex",
  "categories": [
    "analytics & data"
  ],
  "is_composio_managed": false,
  "updated_at": "2026-06-18T09:32:55.865Z"
}
```

![Hex logo](https://logos.composio.dev/api/hex)

## Description

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.

## Summary

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

## Categories

- analytics & data

## Toolkit Details

- Tools: 32

## Images

- Logo: https://logos.composio.dev/api/hex

## Authentication

- **Api Key**
  - Type: `api_key`
  - Description: Api Key authentication for Hex.
  - Setup:
    - Configure Api Key credentials for Hex.
    - Use the credentials when creating an auth config in Composio.

## Suggested Prompts

- List recent Hex analytics projects
- Run weekly revenue Hex project
- Check latest Hex project status

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `HEX_CANCEL_RUN` | Cancel Run | Tool to cancel a project run that is in progress. Use when you need to stop a currently executing Hex project run before it completes. |
| `HEX_CREATE_CELL` | Create Cell | Tool to create a new cell in the draft version of a Hex project. Use when adding CODE or SQL cells to a project. Only CODE and SQL cell types are supported. Requires EDIT_PROJECT_CONTENTS permission. |
| `HEX_CREATE_COLLECTION` | Create Collection | Tool to create a new collection in the Hex workspace. Use when you need to organize projects and resources into a collection. |
| `HEX_CREATE_GROUP` | Create Group | Tool to create a new group in the Hex workspace. Use when you need to organize users into groups for collaboration and access control. |
| `HEX_DEACTIVATE_USER` | Deactivate User | Deactivates a user in the Hex workspace. Use this when you need to deactivate a user by their ID. |
| `HEX_DELETE_CELL` | Delete Cell | Permanently delete a cell from the draft version of a project. Requires EDIT_PROJECT_CONTENTS permission. Use when you need to remove a cell from a Hex project's draft. |
| `HEX_DELETE_GROUP` | Delete Group | Deletes a group from the Hex workspace. Use this when you need to permanently remove a group by its ID. |
| `HEX_DELETE_GUIDE_DRAFT` | Delete Guide Draft | Deletes a guide draft by ID from Hex. Use this when you need to permanently remove a draft guide. |
| `HEX_EDIT_COLLECTION` | Edit Collection | Tool to edit a collection's name, description, and sharing settings in Hex. Use when you need to update collection metadata or change sharing permissions. |
| `HEX_EDIT_GROUP` | Edit Group | Tool to edit a group's name and/or members in Hex. Use when you need to update group details, add users to a group, or remove users from a group. |
| `HEX_EDIT_PROJECT_SHARING_COLLECTIONS` | Edit Project Sharing Collections | Tool to add a project to collections or remove it from collections. Use when you need to update project sharing by adding or modifying collection access. Workspace tokens need Collections -> Write access scope in addition to Projects -> Write access scope. |
| `HEX_EDIT_PROJECT_SHARING_GROUPS` | Edit Project Sharing Groups | Tool to edit project sharing settings for groups in Hex. Use when you need to add or modify group access to a project. Supports up to 25 groups per request. |
| `HEX_EDIT_PROJECT_SHARING_ORG_AND_PUBLIC` | Edit Project Sharing Settings | Tool to edit project sharing settings for workspace members and public web access. Use when you need to control who can access a Hex project and what permissions they have. |
| `HEX_EDIT_PROJECT_SHARING_USERS` | Edit Project Sharing Users | Tool to edit project sharing settings for individual users in Hex. Add or modify user access to a project by specifying access levels (NONE, APP_ONLY, CAN_VIEW, CAN_EDIT, FULL_ACCESS). Use when you need to grant or update project permissions for specific users. Maximum 25 users per request. |
| `HEX_GET_CELL` | Get Cell | Tool to get a single cell by ID from the draft version of a Hex project. Use when you need to retrieve cell details including source contents for CODE and SQL cells. Returns complete cell information including cell type, contents, and associated metadata. |
| `HEX_GET_COLLECTION` | Get collection | Tool to get information about a specific collection in Hex. Returns collection details including name, description, creator, and sharing settings. Use when you need to retrieve metadata about a collection by its ID. |
| `HEX_GET_GROUP` | Get Group | Tool to retrieve information about a specific Hex group. Use when you need to get details about a group including its ID, name, and creation date. |
| `HEX_GET_PROJECT` | Get Project | Tool to get metadata about a single Hex project. Use when you need to retrieve project details including title, description, creator, owner, status, categories, analytics, schedules, and sharing information. |
| `HEX_GET_PROJECT_RUNS` | Get Project Runs | Tool to retrieve the status of API-triggered runs for a specific Hex project. Use when you need to check the execution status, timing, or history of project runs. Returns a paginated list of runs with detailed status information. |
| `HEX_GET_RUN_CHART_IMAGE` | Get Run Chart Image | Tool to retrieve a rendered chart image from a Hex project run. Use when you need to get a visual representation of a chart cell from a completed run. Only supports chart-type cells that have executed successfully without errors. Rate limited to 20 requests per minute. |
| `HEX_GET_RUN_STATUS` | Get Run Status | Tool to retrieve the status of a specific Hex project run. Use when you need to check the current state, timing, or completion status of a project execution. Returns detailed information including start/end times, elapsed time, status, and notification details. |
| `HEX_LIST_CELLS` | List Cells | Tool to list all cells from the draft version of a Hex project. Use when you need to retrieve cells with source code for SQL and CODE cells. Returns paginated results with cell details including type, label, and contents. |
| `HEX_LIST_COLLECTIONS` | List Collections | Tool to retrieve all collections in the workspace with pagination support. Use when you need to list or discover available collections. |
| `HEX_LIST_DATA_CONNECTIONS` | List Data Connections | Tool to list all data connections in the Hex workspace with pagination support. Use when you need to retrieve, browse, or audit data connections configured in Hex. Supports filtering by sort criteria and cursor-based pagination for large result sets. |
| `HEX_LIST_GROUPS` | List groups | Tool to list all groups in the Hex workspace with pagination support. Use when you need to retrieve groups with optional sorting and pagination. |
| `HEX_LIST_PROJECTS` | List Hex Projects | Tool to list all viewable Hex projects with pagination and filtering support. Use when you need to retrieve projects sorted by creation date or filter by status, categories, creator, owner, or collection. |
| `HEX_LIST_USERS` | List Users | Tool to list all users in the Hex workspace with pagination support. Returns user details including names, emails, roles, and last login dates. Use when you need to retrieve users, filter by group, or paginate through large user lists. |
| `HEX_PUBLISH_GUIDE_DRAFTS` | Publish Guide Drafts | Tool to publish all currently drafted guides or specific guides by ID. Use when you need to make draft guides publicly available. Specify either publishAllDraftGuides=true or provide specific guide IDs. |
| `HEX_RUN_PROJECT` | Run Project | Tool to trigger a run of the latest published version of a Hex project. Use when you need to execute a project programmatically. Rate limited to 20 requests per minute and 60 requests per hour. |
| `HEX_UPDATE_CELL` | Update Cell | Tool to update a cell's source code and/or data connection in Hex. Use when you need to modify the contents of a code cell or SQL cell. Requires EDIT_PROJECT_CONTENTS permission. |
| `HEX_UPDATE_PROJECT` | Update Project Status | Tool to add or remove a status (including endorsements) from a Hex project. Use when you need to update the project's status or remove an existing status by setting it to null. |
| `HEX_UPSERT_GUIDE_DRAFT` | Upsert Guide Draft | Tool to update or create guide drafts by filePath. Creates a new guide if it doesn't exist, creates a draft if the guide exists without a draft, or updates an existing draft. Use when you need to programmatically manage guide content in Hex. |

## Supported Triggers

None listed.

## Installation and MCP Setup

### Path 1: SDK Installation

#### Path 1, Step 1: Install Composio

Install the Composio SDK
```python
pip install composio_openai
```

```typescript
npm install @composio/openai
```

#### Path 1, Step 2: Initialize Composio and Create Tool Router Session

Import and initialize Composio client, then create a Tool Router session
```python
from openai import OpenAI
from composio import Composio
from composio_openai import OpenAIResponsesProvider

composio = Composio(provider=OpenAIResponsesProvider())
openai = OpenAI()
session = composio.create(user_id='your-user-id')
```

```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');
```

#### Path 1, Step 3: Execute Hex Tools via Tool Router with Your Agent

Get tools from Tool Router session and execute Hex actions with your Agent
```python
tools = session.tools
response = openai.responses.create(
  model='gpt-4.1',
  tools=tools,
  input=[{
    'role': 'user',
    'content': 'List recent Hex projects in my workspace'
  }]
)
result = composio.provider.handle_tool_calls(
  response=response,
  user_id='your-user-id'
)
print(result)
```

```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);
```

### Path 2: MCP Server Setup

#### Path 2, Step 1: Install Composio

Install the Composio SDK for Python or TypeScript
```python
pip install composio claude-agent-sdk
```

```typescript
npm install @composio/core ai @ai-sdk/openai @ai-sdk/mcp
```

#### Path 2, Step 2: Initialize Client and Create Tool Router Session

Import and initialize the Composio client, then create a Tool Router session for Hex
```python
from composio import Composio
from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions

composio = Composio(api_key='your-composio-api-key')
session = composio.create(user_id='your-user-id')
url = session.mcp.url
```

```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}`);
```

#### Path 2, Step 3: Connect to AI Agent

Use the MCP server with your AI agent (Anthropic Claude or Mastra)
```python
import asyncio

options = ClaudeAgentOptions(
    permission_mode='bypassPermissions',
    mcp_servers={
        'tool_router': {
            'type': 'http',
            'url': url,
            'headers': {
                'x-api-key': 'your-composio-api-key'
            }
        }
    },
    system_prompt='You are a helpful assistant with access to Hex tools.',
    max_turns=10
)

async def main():
    async with ClaudeSDKClient(options=options) as client:
        await client.query('Run the weekly revenue Hex project and report its status')
        async for message in client.receive_response():
            if hasattr(message, 'content'):
                for block in message.content:
                    if hasattr(block, 'text'):
                        print(block.text)

asyncio.run(main())
```

```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}`);
```

## Why Use Composio?

### 1. 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

### 2. 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

### 3. 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

### 4. 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

## Use Hex with any AI Agent Framework

Choose a framework you want to connect Hex with:

- [Claude Cowork](https://composio.dev/toolkits/hex/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/hex/framework/codex)

## Related Toolkits

- [Firecrawl](https://composio.dev/toolkits/firecrawl) - Firecrawl automates large-scale web crawling and data extraction. It helps organizations efficiently gather, index, and analyze content from online sources.
- [Tavily](https://composio.dev/toolkits/tavily) - Tavily offers powerful search and data retrieval from documents, databases, and the web. It helps teams locate and filter information instantly, saving hours on research.
- [Exa](https://composio.dev/toolkits/exa) - Exa is a data extraction and search platform for gathering and analyzing information from websites, APIs, or databases. It helps teams quickly surface insights and automate data-driven workflows.
- [Serpapi](https://composio.dev/toolkits/serpapi) - SerpApi is a real-time API for structured search engine results. It lets you automate SERP data collection, parsing, and analysis for SEO and research.
- [Peopledatalabs](https://composio.dev/toolkits/peopledatalabs) - Peopledatalabs delivers B2B data enrichment and identity resolution APIs. Supercharge your apps with accurate, up-to-date business and contact data.
- [Snowflake](https://composio.dev/toolkits/snowflake) - Snowflake is a cloud data warehouse built for elastic scaling, secure data sharing, and fast SQL analytics across major clouds.
- [Posthog](https://composio.dev/toolkits/posthog) - PostHog is an open-source analytics platform for tracking user interactions and product metrics. It helps teams refine features, analyze funnels, and reduce churn with actionable insights.
- [Amplitude](https://composio.dev/toolkits/amplitude) - Amplitude is a digital analytics platform for product and behavioral data insights. It helps teams analyze user journeys and make data-driven decisions quickly.
- [Bright Data MCP](https://composio.dev/toolkits/brightdata_mcp) - Bright Data MCP is an AI-powered web scraping and data collection platform. Instantly access public web data in real time with advanced scraping tools.
- [Browseai](https://composio.dev/toolkits/browseai) - Browseai is a web automation and data extraction platform that turns any website into an API. It's perfect for monitoring websites and retrieving structured data without manual scraping.
- [ClickHouse](https://composio.dev/toolkits/clickhouse) - ClickHouse is an open-source, column-oriented database for real-time analytics and big data processing using SQL. Its lightning-fast query performance makes it ideal for handling large datasets and delivering instant insights.
- [Coinmarketcal](https://composio.dev/toolkits/coinmarketcal) - CoinMarketCal is a community-powered crypto calendar for upcoming events, announcements, and releases. It helps traders track market-moving developments and stay ahead in the crypto space.
- [Control d](https://composio.dev/toolkits/control_d) - Control d is a customizable DNS filtering and traffic redirection platform. It helps you manage internet access, enforce policies, and monitor usage across devices and networks.
- [Databox](https://composio.dev/toolkits/databox) - Databox is a business analytics platform that connects your data from any tool and device. It helps you track KPIs, build dashboards, and discover actionable insights.
- [Databricks](https://composio.dev/toolkits/databricks) - Databricks is a unified analytics platform for big data and AI on the lakehouse architecture. It empowers data teams to collaborate, analyze, and build scalable solutions efficiently.
- [Dataforseo](https://composio.dev/toolkits/dataforseo) - Dataforseo is an SEO data and analytics platform for SERP data, backlinks, keywords, and competitive intelligence. It gives teams reliable search data APIs to power SEO research, rank tracking, and market analysis.
- [Datagma](https://composio.dev/toolkits/datagma) - Datagma delivers data intelligence and analytics for business growth and market discovery. Get actionable market insights and track competitors to inform your strategy.
- [Delighted](https://composio.dev/toolkits/delighted) - Delighted is a customer feedback platform based on the Net Promoter System®. It helps you quickly gather, track, and act on customer sentiment.
- [Dovetail](https://composio.dev/toolkits/dovetail) - Dovetail is a research analysis platform for transcript review and insight generation. It helps teams code interviews, analyze feedback, and create actionable research summaries.
- [Dub](https://composio.dev/toolkits/dub) - Dub is a short link management platform with analytics and API access. Use it to easily create, manage, and track branded short links for your business.

## Frequently Asked Questions

### Do I need my own developer credentials to use Hex with Composio?

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

### Can I use multiple toolkits together?

Yes! Composio's Tool Router enables agents to use multiple toolkits. [Learn more](https://docs.composio.dev/tool-router/overview).

### Is Composio secure?

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. [Learn more](https://trust.composio.dev).

### What if the API changes?

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

---
[See all toolkits](https://composio.dev/toolkits) · [Composio docs](https://docs.composio.dev/llms.txt)
