Skip to main content

A MCP server for Hex

Project description

hex-mcp MCP server

A MCP server for Hex

Components

Resources

The server implements a simple note storage system with:

  • Custom note:// URI scheme for accessing individual notes
  • Each note resource has a name, description and text/plain mimetype

Prompts

The server provides a single prompt:

  • summarize-notes: Creates summaries of all stored notes
    • Optional "style" argument to control detail level (brief/detailed)
    • Generates prompt combining all current notes with style preference

Tools

The server implements multiple tools to interact with the Hex API:

  • list_hex_projects: Lists available Hex projects
  • search_hex_projects: Search for Hex projects by pattern
  • get_hex_project: Get detailed information about a specific project
  • get_hex_run_status: Check the status of a project run
  • get_hex_project_runs: Get the history of project runs
  • run_hex_project: Execute a Hex project
  • cancel_hex_run: Cancel a running project

Installation

pip install hex-mcp

For development features:

pip install "hex-mcp[dev]"

Configuration

The Hex MCP server requires two environment variables:

  • HEX_API_KEY: Your Hex API key
  • HEX_API_URL: The Hex API base URL

You can set these in a .env file or pass them via command line arguments.

CLI Usage

The CLI uses Typer to provide a modern command-line interface:

hex-mcp [OPTIONS] COMMAND [ARGS]...

Commands

  • run: Run the MCP server normally (default if no command is specified)
  • dev: Run in development mode with the MCP Inspector

Global Options

These options apply to all commands:

  • --api-key TEXT: Set the Hex API key (overrides HEX_API_KEY environment variable)
  • --api-url TEXT: Set the Hex API URL (overrides HEX_API_URL environment variable)
  • --server-name TEXT: Set a custom name for the MCP server (default: "Hex MCP Server")
  • -v, --verbose: Enable verbose logging
  • --version: Show the version of hex-mcp and exit
  • --help: Show help message and exit

Command-specific Options

dev

  • --port INTEGER: Set the port for the development server (default: 8765)

Examples

Run the server with environment variables from .env file:

hex-mcp run
# or just
hex-mcp

Run with command line configuration:

hex-mcp --api-key your_api_key --api-url https://hex-api.example.com run

Run in development mode:

hex-mcp --verbose dev --port 9000

Show version:

hex-mcp --version

Show help:

hex-mcp --help
hex-mcp dev --help

Quickstart

Install

Claude Desktop

On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

Development/Unpublished Servers Configuration ``` "mcpServers": { "hex-mcp": { "command": "hex-mcp", "args": [ "--api-key", "your_api_key", "--api-url", "your_api_url", "run" ] } } ```
Published Servers Configuration ``` "mcpServers": { "hex-mcp": { "command": "hex-mcp", "env": { "HEX_API_KEY": "your_api_key", "HEX_API_URL": "your_api_url" } } } ```

Development

Building and Publishing

To prepare the package for distribution:

  1. Sync dependencies and update lockfile:
uv sync
  1. Build package distributions:
uv build

This will create source and wheel distributions in the dist/ directory.

  1. Publish to PyPI:
uv publish

Note: You'll need to set PyPI credentials via environment variables or command flags:

  • Token: --token or UV_PUBLISH_TOKEN
  • Or username/password: --username/UV_PUBLISH_USERNAME and --password/UV_PUBLISH_PASSWORD

Debugging

Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, use our built-in development mode:

hex-mcp dev

This will start the MCP Inspector web interface which allows you to:

  • See real-time requests and responses
  • Test tools and resources
  • Debug server behavior

For manual inspector usage:

npx @modelcontextprotocol/inspector hex-mcp

Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hex_mcp-0.1.5.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hex_mcp-0.1.5-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file hex_mcp-0.1.5.tar.gz.

File metadata

  • Download URL: hex_mcp-0.1.5.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.3

File hashes

Hashes for hex_mcp-0.1.5.tar.gz
Algorithm Hash digest
SHA256 bcfbb36fcbbc9674da29358fe78c3e4a4d22973ec383b8945876cca6a925f186
MD5 0a580d047b0a1c32a0b6ba8e9ccb5066
BLAKE2b-256 6bf6777a80d751bbe937906b91751ed40c313a26840e94adac49f31412eac0fd

See more details on using hashes here.

File details

Details for the file hex_mcp-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: hex_mcp-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.3

File hashes

Hashes for hex_mcp-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ca9d4a44ed6c60e5fac280e8e0770f7c2dea50a5b324cb0af473e21056bec9fa
MD5 82b93a2dea6e047c45351ad2eb97275c
BLAKE2b-256 ee3e6441d2fd4500af1555b5c2165aec6eae05d7396c7acb3f4c5a7186d4f579

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page