Today I Learned

hashrocket A Hashrocket project

Anubis MCP: Build MCP Tools in Elixir

Today I discovered Anubis MCP, an excellent Elixir SDK for building Model Context Protocol (MCP) servers and clients.

What Makes It Special

Unlike most MCP implementations in Python/TypeScript, Anubis brings Elixir's concurrency model and fault tolerance to MCP. The API is incredibly clean:

defmodule MyApp.MCPServer do
  use Anubis.Server,
    name: "My Server",
    capabilities: [:tools]

  def handle_tool("echo", %{text: text}, frame) do
    {:reply, text, frame}
  end
end

Key Features

  • Full client and server implementations
  • Multiple transports: HTTP, SSE, streamable HTTP
  • Schema validation with input_schema
  • Phoenix and Plug integration
  • Great docs and examples

The library cleverly uses Elixir's GenServer pattern for lifecycle management and supervision for fault tolerance. Perfect for building production-ready MCP tools!

Check out the documentation for more examples.

See More #elixir TILs
Looking for help? At Hashrocket, we 💜 Elixir! From our many Elixir client projects, to sponsoring the Chicago Elixir Meetup, to the source code for this application, we are invested in this community. Contact us today to talk about your Elixir project.