FastestMCP

FastestMCP is a BEAM-native MCP toolkit for Elixir.

It keeps the useful FastMCP concepts familiar: tools, resources, prompts, middleware, auth, providers, background tasks, and streamable HTTP. The major difference is ownership. FastestMCP is built as an OTP system with supervised runtime trees, explicit request, session, and task lifetimes, and module-first server startup that fits normal Elixir applications.

Installation

Add FastestMCP to your dependencies:

def deps do
  [
    {:fastest_mcp, "~> 0.1.0"}
  ]
end

Then fetch dependencies:

mix deps.get

Quick Start

Start with a module-owned server:

defmodule MyApp.MCPServer do
  use FastestMCP.ServerModule,
    http: [port: 4100, allowed_hosts: :localhost]

  alias FastestMCP.Context

  def server(opts) do
    base_server(opts)
    |> FastestMCP.add_tool("sum", fn %{"a" => a, "b" => b}, _ctx -> a + b end)
    |> FastestMCP.add_tool("visit", fn _arguments, ctx ->
      visits = Context.get_state(ctx, :visits, 0) + 1
      :ok = Context.set_state(ctx, :visits, visits)
      %{visits: visits, server: ctx.server_name}
    end)
  end
end

children = [
  MyApp.MCPServer
]

FastestMCP.call_tool(MyApp.MCPServer, "sum", %{"a" => 20, "b" => 22})
# => 42

The full onboarding path, including transport startup and the first connected client call, lives in docs/onboarding.md.

Guides

Public API

FastestMCP keeps the public surface curated for the first Hex release.

Current Scope

FastestMCP currently ships:

The main deferred items remain:

Standalone SSE is intentionally unsupported. HTTP means streamable HTTP only.

When To Use FastestMCP

FastestMCP is a good fit when:

It is not the right choice yet if you need: