rodloboz

rodloboz

Hi all,

I’ve just released Sake 0.5.0, and I want to explain better what it’s for, because I think many Phoenix apps can use it now.

Why Sake

An MCP server that only you use locally is easy. The difficult part is a remote server that real users connect to with their own accounts. For that, you need an OAuth 2.1 authorization server: discovery, PKCE, dynamic client registration, consent, token rotation. Most MCP libraries leave that part to you.

Sake includes it. Your existing Phoenix login becomes the identity provider, so each tool call knows which user made it. If you already use Keycloak, Auth0, Okta or Entra ID, Sake validates their tokens instead.

defmodule MyApp.MCP.CloseIssue do
  use Sake.Tool, name: "close_issue", description: "Close an issue", scope: "issues:write"
  arg :id, :integer, required: true

  @impl true
  def execute(%{id: id}, ctx) do
    with {:ok, _} <- MyApp.Issues.close(ctx.scope, id), do: {:ok, "Closed ##{id}"}
  end
end

{Sake,
  secret_key_base: MyAppWeb.Endpoint.config(:secret_key_base),
  auth: [subject: MyApp.MCP.Subject,   # reads the signed-in user from the conn
  issuer: "https://myapp.example.com",
  servers: [MyApp.MCP],
  store: {Sake.Auth.Store.Ecto, 
  repo: MyApp.Repo}]
}

# router.ex
import Sake.Router
scope "/" do
  sake_endpoint "/mcp", server: MyApp.MCP
end

mix dev in the repo starts a full example app with a login form, the OAuth endpoints and sample tools.

What’s new

Tasks that survive a lost node. Before, a task run was a process on the node that started it. If that node went down, the task stayed working until it expired. Now each run holds a lease, and any node recovers a task whose lease lapses: it fails it, or it runs it again (recovery: {:retry, attempts}). You can also give task execution to a durable queue such as Oban (Sake.Tasks.Runner), or give a task to an external system that reports back with Sake.Tasks.complete/3. Sake adds no dependency for this.

Full JSON Schema 2020-12 validation. Before, a raw input_schema: was validated only for what arg lines generate. Now Sake validates the whole schema: $ref, allOf/anyOf/oneOf, if/then/else, unevaluatedProperties, prefixItems and the rest. A schema that cannot be valid is a compile error. Structured results are validated against output_schema: too, and Sake.Tool.Result lets a tool return structured content of any JSON type. With absent: :omit, a tool can tell a missing argument from null.

MCP extensions (SEP-2133). use Sake.Extension lets you implement an extension’s methods and notifications on a Sake server. They go through the same transports, auth, middleware, telemetry and tracing as core methods. Before, you could only advertise an extension.

Skills over MCP (SEP-2640, beta). A library or app can ship SKILL.md workflows with its tools. use Sake.Skill, dir: "..." compiles a skill directory at build time, with manifest and SHA-256 digests. Sake.Skill.Catalog serves skills at runtime. Sake.Client can list, get and verify skills too.

Resumable SSE streams on the session-based revisions. Each event has an ID. A call continues when its connection drops, and a GET with Last-Event-ID replays the events it missed, on any node when you use pubsub. The client resumes automatically.

Paged client lists. Sake.Client.list_tools_page/2 and the other *_page functions, reduce_list/5 for lazy enumeration of large catalogs, and cache metadata (ttlMs, cacheScope) on results.

Other parts of Sake:

  • One endpoint for all clients: the stateless 2026-07-28 revision and the older session-based revisions (2025-11-25, 2025-06-18, 2025-03-26) on the same path.
  • A client: Sake.Client does the full MCP auth flow against any server (discovery, registration, PKCE, refresh, step-up, DPoP).
  • Conformance: the official MCP conformance suite runs in CI on every commit.

Feedback

If you’re adding MCP to a Phoenix app, try Sake and tell me where it’s hard: setup, docs, a client that doesn’t connect, a missing feature. Issues, PRs and replies here are all welcome. I want to get to 1.0 with real apps behind it.

Where Next? Top

Trending in News & Updates Top

mat-hek
Popcorn, the library that runs Elixir code in the browser, is now stable :popcorn: This is possible because it now builds on a very stab...
New
bartblast
Hologram UI is in the works - the official component library for Hologram - and the waiting list is now open. A common reaction when I m...
New
bartblast
This thread is for updates on the Hologram website (docs, new pages, roadmap, feature status, etc.). You can watch this thread to get no...
New
mandar1045
Stampede 1.2 is out, and I finally got to try it at a bigger scale. What’s new --find-limit: instead of a fixed number of users, it add...
New
uzaydurdu
Hey Elixir folks, I’ve been working on Xenia 0.2.0, and it’s nearly ready. This release focuses on performance, easier integration, and...
New
rodloboz
Hi all, I’ve just released Sake 0.5.0, and I want to explain better what it’s for, because I think many Phoenix apps can use it now. Wh...
New
Potions
I’m working to make Potions the easiest way to deploy Elixir applications, and the next step in that journey is live: you can now bring y...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
raa-ziq
Hi everyone :waving_hand: I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New
kip
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews