HexDocs MCP
About
Semantic search for Hex package documentation. Requires local Elixir and Mix installation.
Details
- Author
- bradleygolden
- Categories
- Search, Knowledge Base, Other
Jump to
Setup
Install HexDocs MCP in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/bradleygolden/hexdocs-mcp
Follow the installation instructions in the repository README, then restart your MCP client.
HexDocs MCP is a project that provides semantic search capabilities for Hex package documentation, designed specifically for AI applications. It consists of two main components:
- An Elixir binary that downloads, processes, and generates embeddings from Hex package documentation
- A TypeScript server implementing the Model Context Protocol (MCP) that calls the Elixir binary to fetch and search documentation
[!CAUTION]This documentation reflects the current development state on the main branch.For documentation on the latest stable release, please see thelatest release pageand thelatest release branch.
The TypeScript MCP server implements theModel Context Protocol (MCP)and is designed to be used by MCP-compatible clients such as Cursor, Claude Desktop App, Continue, and others. The server provides tools for semantic search of Hex documentation. For a complete list of MCP-compatible clients, see theMCP Clients documentation.
Add this to your client's MCP json config:
{ "mcpServers": { "hexdocs-mcp": { "command": "npx", "args": [ "-y", "hexdocs-mcp@0.5.0" ] } } }
This command will automatically download the elixir binaries to both fetch_docs and search documentation. While the server handles downloading the binaries, you still need Elixir and Mix installed on your system for the HexDocs fetching functionality to work properly.
Alternatively, you can useSmitheryto automatically add the MCP server to your client config.
For example, for Cursor, you can use the following command:
npx -y @smithery/cli@latest install @bradleygolden/hexdocs-mcp --client cursor
Alternatively, you can add the hexdocs_mcp package to your project if you don't want to use the MCP server.
{:hexdocs_mcp, "~> 0.5.0", only: :dev, runtime: false}
And if you use floki or any other dependencies that are marked as only available in another environment, update them to be available in the:devenvironment as well.
For example floki is commonly used in:test:
{:floki, ">= 0.30.0", only: :test}
But you can update it to be available in the :dev environment:
{:floki, ">= 0.30.0", only: [:dev, :test]}
- Ollama- Required for generating embeddings
- Runollama pull mxbai-embed-largeto download the recommended embedding model
- Ensure Ollama is running before using the embedding features
- Installed automatically in CI environments
- Required locally for development
Breaking Change: Model Migration (v0.6.0+)
⚠️ IMPORTANT: Version 0.6.0 introduces a breaking change with the default embedding model.
- Default model changed fromnomic-embed-text(384 dimensions) tomxbai-embed-large(1024 dimensions)
- Existing embeddings are incompatible and will be cleared during upgrade
Your existing embeddings will be automatically cleared when you first run any command
Regenerate embeddings for your packages:
Why this change:mxbai-embed-largeprovides significantly better semantic search quality and consistent dimensions across all platforms (Windows/macOS/Linux).
The following environment variables can be used to configure the tool:
# Set custom storage location export HEXDOCS_MCP_PATH=/path/to/custom/directory # Configure common project paths to avoid specifying --project flag each time export HEXDOCS_MCP_MIX_PROJECT_PATHS="/path/to/project1/mix.exs,/path/to/project2/mix.exs"
You can also configure environment variables in the MCP configuration for the server:
{ "mcpServers": { "hexdocs-mcp": { "command": "...", "args": [ "..." ], "env": { "HEXDOCS_MCP_PATH": "/path/to/custom/directory", "HEXDOCS_MCP_MIX_PROJECT_PATHS": "/path/to/project1/mix.exs,/path/to/project2/mix.exs" } } } }
The MCP server can be used by any MCP-compatible AI tooling. The server will automatically fetch documentation when needed and store it in the configured data directory.
Note that large packages make take time to download and process.
The SQLite database for vector storage and retrieval is created automatically when needed.
Fetch documentation, process, and generate embeddings for a package:
Fetch documentation for a specific version:
mix hex.docs.mcp fetch_docs phoenix 1.5.9
Fetch documentation for a package using the version from your project:
mix hex.docs.mcp fetch_docs phoenix --project path/to/mix.exs
Configure project paths to avoid specifying them every time:
export HEXDOCS_MCP_MIX_PROJECT_PATHS="/path/to/project1/mix.exs,/path/to/project2/mix.exs" mix hex.docs.mcp fetch_docs phoenix # Will use the first path from HEXDOCS_MCP_MIX_PROJECT_PATHS
mix hex.docs.mcp semantic_search phoenix --query "channels"
Check if embeddings exist for a package:
mix hex.docs.mcp check_embeddings phoenix mix hex.docs.mcp check_embeddings phoenix 1.7.0
- hex2text- For the initial idea and as a reference
This project usesmise(formerly rtx) to manage development tools and tasks. Mise provides consistent tool versions and task automation across the project.
-
Install mise (if you don't have it already):
# macOS with Homebrew brew install mise # Using the installer script curl https://mise.run | sh
Clone the repository and setup the development environment:
git clone https://github.com/bradleygolden/hexdocs-mcp.git cd hexdocs-mcp mise install # Installs the right versions of Elixir and Node.js
Mise defines several useful development tasks:
- mise build- Build both Elixir and TypeScript components
- mise test- Run all tests
- mise mcp_inspect- Start the MCP inspector for testing the server
- mise start_mcp_server- Start the MCP server (primarily for debugging)
If you prefer not to use mise, you'll need:
Then, you can run these commands directly:
# Instead of mise run setup_elixir mix setup # Instead of mise run setup_ts npm install # Instead of mise run build mix compile --no-optional-deps --warnings-as-errors npm run build # Instead of mise run test mix test mix format --check-formatted mix deps --check-unused mix deps.unlock --all mix deps.get mix test # Instead of mise run mcp_inspect MCP_INSPECTOR=true npx @modelcontextprotocol/inspector node dist/index.js
This project includes custom instructions for AI assistants to help optimize your workflow when working with Hex documentation.
You can find sample custom instructions in the repository:
- Cursor rules- Custom rules for Cursor editor
- GitHub Copilot- Custom instructions for GitHub Copilot
When working with Elixir projects that use Hex packages: ## HexDocs MCP Workflow 1. Use search to find relevant documentation 2. Use fetch to fetch documentation for a package
When preparing a new release, please follow these guidelines to ensure consistency:
-
SemVer Compliance: FollowSemantic Versioningstrictly:
- MAJOR: incompatible API changes
- MINOR: backward-compatible functionality
- PATCH: backward-compatible bug fixes
- Hex package version (inmix.exs) and npm package version (inpackage.json) MUST be identical
- Update both files when changing the version
- Formatting and Comments:
- Follow the Elixir formatter rules defined in .formatter.exs
- Do not add comments to code unless strictly necessary for context
- Self-documenting code with clear function names is preferred
- Use module and function documentation (@moduledoc and @doc) instead of inline comments
- Document all changes under the appropriate heading (Added, Changed, Fixed, etc.)
- Include the new version number and date
- Keep an [Unreleased] section for tracking current changes
- Follow theKeep a Changelogformat
- Use present tense, imperative style (e.g., "Add feature" not "Added feature")
- Include issue/PR numbers where applicable
- Group related changes
- Runmix testto ensure all tests pass
- Runmix formatto ensure code is properly formatted
- Verify CHANGELOG.md is updated
- Create a version bump commit that updates:
- mix.exs
- package.json
- CHANGELOG.md (move [Unreleased] to new version)
- Add a new [Unreleased] section to CHANGELOG.md
- Update version links at the bottom of CHANGELOG.md
These guidelines apply to both human contributors and AI assistants working on this project.
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under MIT - see theLICENSEfile for details.
Search global news using natural language. Webz.io News Search API returns the most relevant articles and content, with filters for source, country, language, date, sentiment, and category.
Retrieve and process documentation using vector search to provide context for AI assistants.
Retrieve and process documentation using vector search to provide relevant context for AI assistants.
Search and query Teleport's documentation using embeddings stored in a local Chroma vector database.
MCP server for Apache AGE graph databases on PostgreSQL. 21 MCP tools — the most comprehensive Apache AGE MCP server (graph CRUD, Cypher queries, batch transactions, semantic search, Graph RAG, vis.js visualization, export/import) - F#/.NET — the only non-Python Apache AGE MCP server, installs as a single dotnet tool - Production-grade — BenchmarkDotNet-verified performance (cached queries in 62 ns, Cypher in 1 ms) - Open source — MIT license, published on NuGet - Documentation — full docs site at neftedollar.com/age-mcp
Local semantic search over React Native docs for AI agents — no API key
Discovery & reputation layer for AI agents: semantic search over 15,000+ agents and MCP servers, cross-registry reputation, remote MCP over Streamable HTTP, no auth.
An MCP server providing semantic search capabilities for APLCart data.
MCP server for Christian scholarship and research — scripture, Greek/Hebrew word data, cross-references, patristic texts, and semantic search,
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




