Installation

Add Hermes MCP to your Elixir project.

Add Dependency

In mix.exs:

def deps do
  [
    {:hermes_mcp, "~> 0.10.1"} # x-release-please-version
  ]
end

Then:

mix deps.get

Client Setup

Define a client module:

defmodule MyApp.MCPClient do
  use Hermes.Client,
    name: "MyApp",
    version: "1.0.0",
    protocol_version: "2024-11-05",
    capabilities: [:roots, :sampling]
end

Add to your supervision tree:

defmodule MyApp.Application do
  use Application

  def start(_type, _args) do
    children = [
      # MCP client with STDIO transport
      {MyApp.MCPClient, 
       transport: {:stdio, command: "python", args: ["-m", "mcp.server", "my_server.py"]}}
    ]

    opts = [strategy: :one_for_all, name: MyApp.Supervisor]
    Supervisor.start_link(children, opts)
  end
end

Server Setup

For MCP servers, see Server Quick Start.

Client Module Options

When defining a client module with use Hermes.Client:

OptionTypeDescriptionRequired
:namestringClient name to advertiseYes
:versionstringClient versionYes
:protocol_versionstringMCP protocol versionYes
:capabilitieslistClient capabilitiesYes

Transport Options

When starting the client:

TransportOptionsExample
STDIOcommand, args{:stdio, command: "python", args: ["-m", "server"]}
SSEbase_url{:sse, base_url: "http://localhost:8000"}
WebSocketurl{:websocket, url: "ws://localhost:8000/ws"}
HTTPurl{:streamable_http, url: "http://localhost:8000/mcp"}

Next Steps