The Hex API SDK includes built-in support for the Model Context Protocol (MCP), allowing you to use Hex functionality directly within Claude Desktop and Claude Code.
The Model Context Protocol is an open standard that enables AI assistants like Claude to interact with external tools and data sources. With the Hex API MCP server, Claude can:
- List and search your Hex projects
- Get project details and metadata
- Run Hex projects with parameters
- Monitor run status
- Cancel running projects
- Python 3.10 or higher
- Hex API key (get one from your Hex workspace settings)
- Claude Desktop and/or Claude Code installed
# Install with MCP support
pip install "hex-toolkit[mcp]"
# Or install with all features
pip install "hex-toolkit[all]"export HEX_API_KEY=your-api-key-here
# Optional: Set custom Hex instance URL
export HEX_API_BASE_URL=https://your-hex-instance.comhex mcp statusThis shows whether the MCP server is configured for Claude Desktop, Claude Code, and your current project.
# Auto-detect and install for all available Claude applications
hex mcp install
# Install for specific targets
hex mcp install --target claude-desktop
hex mcp install --target claude-code
# Install for Claude Code with specific scope
hex mcp install --target claude-code --scope project # Share with team via .mcp.json
hex mcp install --target claude-code --scope user # Available across all projects
hex mcp install --target claude-code --scope local # Current project onlyAfter installation:
- Claude Desktop: Quit and restart the application
- Claude Code: The MCP server is immediately available
Look for the 🔧 (tool) icon in Claude and try commands like:
- "List my Hex projects"
- "Run the sales dashboard project"
- "Check the status of my running projects"
- "Search for projects with 'analytics' in the name"
List and search Hex projects with filtering options.
Parameters:
limit: Number of results (1-100, default: 25)include_archived: Include archived projectsinclude_trashed: Include trashed projectscreator_email: Filter by creatorowner_email: Filter by ownersearch: Search projects by name or description
Get detailed information about a specific project.
Parameters:
project_id: The project's unique IDinclude_sharing: Include sharing/permission details
Run a Hex project with optional parameters.
Parameters:
project_id: The project's unique IDdry_run: Perform a dry runupdate_cache: Update cached resultsno_sql_cache: Skip SQL result cacheinput_params: JSON object with input parameters
Check the status of a project run.
Parameters:
project_id: The project's unique IDrun_id: The run's unique ID
Cancel a running project.
Parameters:
project_id: The project's unique IDrun_id: The run's unique ID
List recent runs for a project.
Parameters:
project_id: The project's unique IDlimit: Number of resultsoffset: Skip this many resultsstatus_filter: Filter by status
The installer automatically updates your Claude Desktop configuration at:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
For Claude Code, you can install at different scopes:
Available across all your projects:
hex mcp install --target claude-code --scope userShared with your team via .mcp.json:
hex mcp install --target claude-code --scope projectThis creates/updates .mcp.json in your project root:
{
"mcpServers": {
"hex-toolkit": {
"command": "hex",
"args": ["mcp", "serve"],
"env": {
"HEX_API_KEY": "${HEX_API_KEY}",
"HEX_API_BASE_URL": "${HEX_API_BASE_URL}"
}
}
}
}Available only in the current project:
hex mcp install --target claude-code --scope local# Default stdio transport (for Claude Desktop)
hex mcp serve
# SSE transport for remote access
hex mcp serve --transport sse --port 8080 --host 0.0.0.0# Remove from all detected Claude applications
hex mcp uninstall
# Remove from specific target
hex mcp uninstall --target claude-desktop
hex mcp uninstall --target claude-code --scope projectIf you see "HEX_API_KEY environment variable not set":
- Set the environment variable:
export HEX_API_KEY=your-key - Add it to your shell profile (
.bashrc,.zshrc, etc.) - For Claude Desktop on macOS, you may need to launch it from Terminal for env vars to work
- Ensure you've restarted Claude Desktop after installation
- Check the configuration file exists and contains the hex-toolkit entry
- Run
hex mcp statusto verify installation - Check Claude Desktop logs for errors
- On Windows, you may need to run the terminal as Administrator
- On macOS/Linux, ensure you have write permissions to the config directories
Tell Claude: "Run my daily sales report project and email me when it's complete"
Tell Claude: "Find all projects related to customer analytics that were modified this week"
Tell Claude: "Check the status of all my running projects and cancel any that have been running for more than an hour"
- API keys are stored as environment variables, not in configuration files
- The MCP server runs with your user permissions
- Only install MCP servers from trusted sources
- Project-scoped configurations (
.mcp.json) should not contain sensitive data
Found a bug or have a feature request? Please open an issue on our GitHub repository.
This MCP server is part of the hex-toolkit SDK and is released under the MIT license.