mix hex.docs.mcp (HexDocs MCP v0.1.0)

View Source

Fetches Hex docs for a package, converts HTML to markdown, creates semantic chunks, and generates embeddings by default.

Usage

$ mix hex.docs.mcp COMMAND [options] PACKAGE [VERSION]
  • COMMAND - Either fetch or search (required)
  • PACKAGE - Hex package name to work with (required for fetch/search)
  • VERSION - Package version to work with (optional, defaults to latest)

Options

--model MODEL    - Ollama model to use for embeddings (default: nomic-embed-text)
--query QUERY    - Query string for search command

Examples

$ mix hex.docs.mcp fetch phoenix              # Download, chunk docs and generate embeddings
$ mix hex.docs.mcp fetch --model all-minilm phoenix   # Use custom model for embeddings
$ mix hex.docs.mcp search --query "channels" phoenix  # Search in existing embeddings

The fetch command:

  1. Downloads docs using mix hex.docs
  2. Converts HTML to a single markdown file
  3. Chunks the markdown text for embedding in vector databases
  4. Generates embeddings using Ollama
  5. Automatically creates the database if it doesn't exist

The search command:

  1. Looks up existing embeddings for the specified package
  2. Performs a similarity search using the query
  3. Returns the most relevant results

Summary

Functions

Callback implementation for Mix.Task.run/1.

Functions

run(args)

Callback implementation for Mix.Task.run/1.