Every command in this recording really runs: Grafana behind oauth2-proxy, dex and Traefik forwardAuth, with the released albauth from Homebrew. Only the browser sign-in is scripted. Re-record it yourself.
Why it exists
Plenty of internal APIs sit behind a login proxy. A browser can finish that login; an MCP client cannot. It follows the redirect, lands on a sign-in page, and stops.
The cookie the proxy wants is only issued to a browser that has finished your identity provider's flow, with its passwords, second factors and device checks. Scripting that breaks, and an ID token doesn't help.
So albauth does what works: it opens a real browser, lets you sign in, keeps the resulting session in your OS keychain, and replays it on every request the model makes.
What it does
One login, many calls
Sign in once. When the session expires, the next request opens the browser again and picks up where it left off.
Both layers
Getting past the proxy isn't the same as being let in. Per-domain headers carry the application's own token, and a 401 from the app comes back as the app's answer, not as a lost session.
Sets itself up
albauth config add-domain probes the API, detects its identity provider and how the proxy behaves, and writes the config for you.
Safe by default
Read-only unless you allow write methods per domain. Session cookies never appear in tool output, and stdout carries nothing but MCP.
Works with
- AWS ALB
authenticate-oidc - oauth2-proxy
- Traefik
forwardAuth - Any identity provider your browser can sign in to
Get started
1. Install
brew install dhanesh/tap/albauth
Or use the install script, which checks the archive against SHA256SUMS before installing:
curl -fsSL https://raw.githubusercontent.com/dhanesh/albauth/main/install.sh | sh
Archives for every platform are on the releases page.
2. Add a domain and log in
albauth config add-domain internal-api \
--base-url https://api.example.com
albauth auth login internal-api
A browser window opens on your identity provider. Sign in as usual; it closes by itself.
3. Connect your MCP client
claude mcp add albauth -- albauth serve
Then the model calls the API directly:
http_request { "url": "/v1/users",
"domain": "internal-api" }