An MCP server for Lotus, built on Sake: it lets an MCP client (Claude Code, Claude Desktop, an agent) explore your data sources, run read-only queries, run saved queries and dashboards, and save queries, charts and dashboards, as the person signed in to your app.
Compiled only when the host depends on :sake. Serve it on an endpoint of
its own, or mount it in your app's own Sake server:
# router.ex
sake_endpoint "/lotus/mcp", server: Lotus.MCP, auth: true
# or
defmodule MyApp.MCP do
use Sake.Server, name: "my-app", version: "1.0.0"
mount Lotus.MCP, prefix: "lotus"
endScopes
lotus:read— list data sources, schemas, tables and columns, saved queries and dashboards.lotus:query— run read-only statements, saved queries and dashboards, and read a column's distinct values.lotus:write— save and change queries, charts and dashboards.
Every statement runs read-only, whatever config :lotus, read_only: says,
and through Lotus's visibility rules and middleware with the person as the
actor; a statement that writes is not saved either. Nothing is deleted
through MCP. Nobody may use it until config :lotus, :mcp, authorize:
says who.
Configuration
config :lotus, :mcp,
# Required: who may use Lotus over MCP. Takes the signed-in
# principal, returns true to allow. Without it, nobody may.
authorize: {MyApp.Reporting, :lotus_user?},
# The :context and :scope Lotus gets for the signed-in principal
# (default: the principal as both).
actor: {MyApp.Reporting, :lotus_actor},
# Only these data sources (default: all).
data_sources: ["analytics"],
# The most rows a tool returns at once (default: 500).
max_rows: 500See the MCP guide for authorization and connecting Claude Code.