Skip to content

Quick start

Sesamcp runs as a container, configured by one YAML file. This puts it in front of an API that has an OpenAPI spec and per-person API keys.

1. The config file

sesamcp.yaml
service_name: Pets
openapi:
  api_url: http://pets:8000/api              # where the spec's paths are
  spec: {url: http://pets:8000/openapi.json} # the app's own spec
fields:
  - {name: api_key, label: API key, type: password, required: true}
login:
  verify:                                    # a key is good if this answers 2xx
    request: {url: "http://pets:8000/api/me", headers: {X-Api-Key: "{api_key}"}}
static_tokens: api_key                       # a raw key works as a token, too
upstream_headers: {X-Api-Key: "{api_key}"}   # added to every call to the API

Check it with docker run --rm -v ./sesamcp.yaml:/c.yaml ghcr.io/marceltov/sesamcp sesamcp check /c.yaml.

2. The container

compose.yaml
services:
  sesamcp:
    image: ghcr.io/marceltov/sesamcp:0.1
    environment:
      MCP_BASE_URL: https://pets-mcp.example.org   # its public URL, the OAuth issuer
      MCP_OAUTH_SECRET: ${MCP_OAUTH_SECRET}        # openssl rand -hex 32
      SESAMCP_CONFIG: /config/sesamcp.yaml
    volumes:
      - ./sesamcp.yaml:/config/sesamcp.yaml:ro
      - ./data:/data                               # the encrypted logins
    ports: ["8081:8081"]

Put it behind your reverse proxy with HTTPS at MCP_BASE_URL.

3. Connect

In claude.ai: Settings → Connectors → Add custom connector, the URL https://pets-mcp.example.org/mcp. Claude opens the sign-in page; the person pastes their own key, and from then on every tool call is theirs.

Next: add single sign-on, or put Sesamcp in front of an MCP server you already have.