developer-toolsapi_key

Hex

Hex is a collaborative data workspace that combines SQL, Python, and R notebooks for analytics and data science

Verdict

Hex is a collaborative data workspace where analysts build notebooks that mix SQL, Python, and visualizations. This MCP lets your team manage Hex projects, runs, and workspace resources directly from Switchy. @mention Hex to create or delete cells in draft notebooks, trigger project runs, cancel long-running queries, organize projects into collections, or manage user groups and permissions. Most useful for data teams who want to orchestrate Hex workflows from chat without switching tabs. Note: you'll need an API key with appropriate workspace permissions — some tools require EDIT_PROJECT_CONTENTS or admin scopes.

Common use cases

  • Draft SQL cells in notebooks from chat
  • Trigger project runs and monitor status
  • Cancel long-running queries mid-execution
  • Organize projects into collections
  • Manage user groups and permissions

Integration

Vendor
Hex
Category
developer-tools
Auth
API_KEY
Tools
31
Composio slug
hex

Tools

  • 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.

  • 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.

  • Create Collection

    Tool to create a new collection in the Hex workspace. Use when you need to organize projects and resources into a collection.

  • 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.

  • Deactivate User

    Deactivates a user in the Hex workspace. Use this when you need to deactivate a user by their ID.

  • Delete Cell
    destructive

    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.

  • Delete Group
    destructive

    Deletes a group from the Hex workspace. Use this when you need to permanently remove a group by its ID.

  • Delete Guide Draft
    destructive

    Deletes a guide draft by ID from Hex. Use this when you need to permanently remove a draft guide.

  • 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.

  • 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.

  • 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 -> Wri

  • 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.

  • 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.

  • 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 permission

  • 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 assoc

  • 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.

  • 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.

  • 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.

  • 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.

  • 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

  • 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.

  • List Collections

    Tool to retrieve all collections in the workspace with pagination support. Use when you need to list or discover available collections.

  • 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 re

  • 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.

  • 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.

  • 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.

  • 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.

  • 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.

  • 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.

  • 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.

  • 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

Setup

Setup guide

  1. 11. In Switchy, open your workspace settings and navigate to the Integrations page. 2. Find Hex in the MCP catalog and click Connect. 3. You'll be prompted to enter a Hex API key — generate one in your Hex workspace under Settings > API Keys, selecting scopes that match the tools you need (EDIT_PROJECT_CONTENTS for cell edits, admin for user management). 4. Paste the key into Switchy and click Save. 5. Switchy will verify the connection and show a green checkmark when ready. 6. To test, open any Space and type '@Hex list my projects' — if you see project names returned, the integration is live. 7. From there, @mention Hex in any message to invoke tools like creating cells, triggering runs, or managing collections.

What teammates see: by default, memories from Hex are scoped to the Space (PROJECT visibility) - you can mark any memory PRIVATE or share it ORG-wide.

Works well with

Top models

Compatibility data appears once enough Spaces have used this MCP together with a given model.

How Switchy teams use it

Not enough Spaces yet to publish anonymised usage stats (we require ≥ 50 Spaces per week).

Starter prompts

Add SQL Cell

@Hex create a SQL cell in project [project_id] that queries the users table for signups in the last 30 days
Open in a Space →

Run Project

@Hex run project [project_id] and let me know the run ID so I can track progress
Open in a Space →

Cancel Stuck Run

@Hex cancel the run [run_id] — it's been running for 20 minutes and we need to revise the query
Open in a Space →

Create Collection

@Hex create a collection called 'Q1 Revenue Analysis' so we can group all the finance projects together
Open in a Space →

Deactivate User

@Hex deactivate user [user_id] — they left the company last week and we need to revoke access
Open in a Space →

Example outputs

Illustrative - representative of the model's voice and quality, not literal recordings.

Prompt

@hex list all projects in the 'Q1 Analytics' collection and show me which ones have runs that failed in the last 7 days

Output

Found 12 projects in the 'Q1 Analytics' collection. Of these, 3 have failed runs in the past week: 'Customer Churn Analysis' (failed 2 days ago with a SQL timeout error), 'Revenue Forecast Model' (failed 5 days ago due to missing data source), and 'Weekly KPI Dashboard' (failed yesterday with a Python dependency issue). The other 9 projects have either succeeded or haven't run recently. Would you like me to retrieve error logs for any of these failures?

Notes

This example demonstrates Hex's read capabilities across projects and run history. Requires API key with workspace read permissions. The MCP can surface project metadata and execution status, but detailed error logs may require additional tool calls or manual inspection in the Hex UI.

Prompt

@hex create a new SQL cell in the 'Sales Pipeline' project draft that queries our deals table for opportunities closed this month

Output

Created a new SQL cell in the draft version of 'Sales Pipeline' (project ID: prj_abc123). The cell has been added at the end of the notebook with a placeholder query structure. Cell ID is cell_xyz789. Note that this modifies the draft only—you'll need to publish the project version for the change to go live. The cell is ready for you to refine the query logic or add parameters as needed.

Notes

This showcases Hex's write capabilities for notebook authoring. Requires EDIT_PROJECT_CONTENTS permission on the target project. The MCP creates cells in draft mode only; publishing requires a separate action. Only CODE and SQL cell types are supported—markdown, input, and other cell types cannot be created via this tool.

Prompt

@hex my 'Customer Segmentation' project is stuck running—cancel it and then summarize what cells were executing when I stopped it

Output

Cancelled the in-progress run for 'Customer Segmentation' (run ID: run_def456). The run had been executing for 18 minutes when stopped. Based on the project structure, it was likely processing the third cell, a Python cell that performs K-means clustering on 2M customer records. The previous two cells (data load and feature engineering) had completed successfully. Cancelling mid-run means downstream cells won't execute, and any partial results won't be saved.

Notes

This example pairs an action (cancelling a run) with AI reasoning to interpret project state. Useful when runs hang due to resource limits or logic errors. Be aware that cancelling a run is immediate and irreversible—any in-progress computations are lost. The MCP can retrieve project structure to infer what was running, but exact cell execution order depends on dependencies.

Use-case deep-dives

Analyst onboarding at data teams

When Hex MCP handles new-hire notebook setup

A 6-person analytics team brings on a junior analyst who needs 12 templated SQL notebooks cloned from the senior's workspace. The Hex MCP wins here because Create Cell and Create Collection let you script the entire setup—copy the cell structure, wire the data connections, drop the new notebooks into a "Q1 Onboarding" collection—without opening the Hex UI. The 31-tool surface means you can also script group membership (Create Group) and deactivate contractors (Deactivate User) in the same workflow. The threshold: if your templates live outside Hex or need custom Python logic beyond CODE/SQL cells, you'll hit the cell-type limit and need manual steps. For teams running Hex as the single source of truth for SQL analysis, this MCP collapses a 90-minute onboarding checklist into a 5-minute script.

Weekly exec dashboard refresh

Why this MCP isn't the call for scheduled reports

A 3-person ops team runs a weekly executive dashboard in Hex that pulls Salesforce and Stripe data, then emails a PDF to leadership. The Hex MCP is the wrong tool for this job. Cancel Run and the project-run tools suggest you could orchestrate execution from Switchy, but Hex's native scheduler already handles cron triggers and email delivery without API overhead. The MCP shines when you need to intervene mid-run (Cancel Run if a query hangs) or audit which notebooks fired last week, but for steady-state scheduled work, you're adding latency and auth complexity for no upside. Use this MCP when your refresh cadence is ad-hoc or triggered by external events—Slack alerts, support tickets, sales calls—not when the calendar is the only input.

Customer support knowledge cleanup

When Hex MCP scales internal doc deprecation

A 10-person support team has 200+ Hex guides documenting product workflows, and half are outdated after a UI redesign. The Hex MCP's Delete Guide Draft tool makes bulk cleanup tractable: you can script a sweep that checks last-modified dates, flags guides referencing deprecated endpoints, and deletes drafts that never shipped. The API_KEY auth means one support lead can run the script without coordinating 10 logins. The catch: this only works if your team uses Hex guides as the knowledge base. If your docs live in Notion or Confluence and Hex is just for data pulls, the MCP's guide-management tools are dead weight. For teams that treat Hex as both analytics platform and internal wiki, this MCP turns a month-long audit into a weekend project.

Frequently asked

What does the Hex MCP let me do in Switchy?

It connects your Hex workspace so you can manage data projects, notebooks, and runs directly from Switchy. You can create and delete cells in draft projects, trigger or cancel runs, manage collections and groups, and handle user permissions. Think of it as remote-controlling your Hex environment without opening the Hex UI.

Do I need admin access to connect Hex via API key?

Yes. The API key needs workspace-level permissions to perform actions like creating groups, deactivating users, and editing project contents. A standard user key won't work for most of the 31 tools this MCP exposes. Generate the key from your Hex workspace settings under API tokens.

Can the Hex MCP run SQL queries or execute Python code directly?

No. It creates CODE and SQL cells in draft projects, but it doesn't execute them. You still trigger runs using the Cancel Run or equivalent tool, then poll for results. If you need to run arbitrary queries on the fly, use a direct database MCP instead of routing through Hex.

How is this different from just using Hex's web app or API?

The MCP wraps Hex's API into natural-language tools your AI agents can call. Instead of writing curl commands or Python scripts to manage projects, you describe what you want in Switchy and the MCP handles the API calls. It's faster for ad-hoc admin tasks but won't replace Hex's notebook UI for exploratory analysis.

Should our data analyst or workspace admin connect this?

Your workspace admin should connect it first, since the API key needs elevated permissions. Once connected in Switchy, any team member can ask the AI to perform Hex tasks within the scope of that key. Just remember: the MCP acts with the key's full permissions, so audit who can trigger actions in Switchy.

Data last verified 607 hours ago.Sources aggregated hourly to weekly. See docs/architecture/model-directory.md.