Skip to content

The service

The image ghcr.io/marceltov/sesamcp serves what one config file describes. It has two modes, decided by the file: openapi or upstream.

OpenAPI mode

openapi:
  api_url: http://app:8000/api
  spec: {url: http://app:8000/api/schema/}
  toolsets: [documents, tags]      # on by default; MCP_TOOLSETS=default,mail adds more, `all` every one
  never_exposed: [/api/users, /api/token]
  guides:
    documents_list: Filter on the server; never page through every document.

At start-up Sesamcp loads the spec (retrying while the app boots, up to spec.wait seconds), turns each selected operation into a tool, and serves them behind the sign-in. Each call carries upstream_headers, filled from the person's login, and nothing the client sent. A spec that can't be loaded starts an error server instead, whose startup_error tool says why.

Proxy mode

upstream: http://trilium:8080/mcp

For an MCP server that already exists but takes only a static token, or no login at all. Sesamcp answers the OAuth side, then streams every request through, with the person's credential in upstream_headers; event streams and long calls stay open. instructions is added to the server's initialize answer. Files written for mcp-login-proxy load unchanged.

flowchart LR
  C[MCP client] -- Sesamcp token --> S
  subgraph S[Sesamcp]
    G[sign-in and gate] --> F[forward]
  end
  F -- the person's credential --> U[MCP server or API]

The token from the client stops at the gate; only upstream_headers go on.

Commands

Command Does
sesamcp serves SESAMCP_CONFIG (default /config/proxy.yaml)
sesamcp check <file> loads a config as the service would, says which mode and which ways in
sesamcp hash asks for a password twice and prints its argon2id hash, for login.users

Endpoints

Path What
/mcp the MCP server, behind the sign-in
/health no sign-in; in proxy mode with health set, it also says whether the upstream answers
/favicon.ico a redirect to favicon, so a client shows the app's icon
/.well-known/…, /register, /authorize, /token, /revoke, /login the OAuth side, found by clients on their own