lumoauth 1.2.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,7 +16,7 @@
16
16
  [![HTTP and stdio](https://img.shields.io/badge/servers-HTTP%20%C2%B7%20stdio-111)](#what-it-does)
17
17
  [![License: MIT](https://img.shields.io/badge/license-MIT-111)](#license)
18
18
 
19
- [Quick start](#quick-start) · [What it does](#what-it-does) · [Per-tool policy](#per-tool-policy) · [Options](#options) · [Troubleshooting](#troubleshooting) · [Docs](https://docs.lumoauth.dev/mcp/)
19
+ [Quick start](#quick-start) · [What it does](#what-it-does) · [Per-tool policy](#per-tool-policy) · [Step-up approval (JIT)](#step-up-approval-for-sensitive-tools---jit) · [Token Vault](#injecting-third-party-api-tokens-from-token-vault---vault) · [Tracing](#distributed-tracing-traceparent) · [Kubernetes & Envoy](#kubernetes-sidecar-and-envoy-ext_authz) · [Options](#options) · [Troubleshooting](#troubleshooting) · [Docs](https://docs.lumoauth.dev/mcp/)
20
20
 
21
21
  </div>
22
22
 
@@ -31,6 +31,9 @@ npx lumoauth secure --upstream http://127.0.0.1:8000/mcp -- python server.py
31
31
 
32
32
  # A stdio MCP server, served over HTTP behind LumoAuth
33
33
  npx lumoauth secure --stdio -- npx -y @modelcontextprotocol/server-everything
34
+
35
+ # Run as an Envoy HTTP ext_authz check service in Kubernetes / service mesh
36
+ npx lumoauth ext-authz --port 9001 --tool-policy
34
37
  ```
35
38
 
36
39
  [LumoAuth](https://lumoauth.dev) signs users in and issues the tokens. `lumoauth` checks each token before anything reaches your server. It works with a server in any language. Building with the official TypeScript SDK? [`@lumoauth/mcp`](https://www.npmjs.com/package/@lumoauth/mcp) does the same inside your code.
@@ -141,6 +144,9 @@ Other MCP clients connect the same way if they let you set a client ID and a cal
141
144
  | `X-LumoAuth-Actor` | The agent acting for the user |
142
145
  | `X-LumoAuth-Client-Id` | The OAuth client |
143
146
  | `X-LumoAuth-Scopes` | The granted scopes |
147
+ | `X-LumoAuth-Trace-Id` | The 32-character W3C trace ID, when `traceparent` is present |
148
+ | `X-LumoAuth-Is-Jit` | `true` when the request carries a verified Just-in-Time approval |
149
+ | `X-LumoAuth-Vault-<Slug>-Token` | Short-lived SaaS token fetched from LumoAuth's Token Vault (when `--vault` is used) |
144
150
 
145
151
  **HTTP mode** works with any MCP server and any protocol revision. It reads JSON-RPC only to apply the tool policy, and it streams everything else.
146
152
 
@@ -165,6 +171,63 @@ With the policy on, `lumoauth` asks LumoAuth about each tool and hides the tools
165
171
 
166
172
  Relationships are part of the Fine-grained authorization add-on. Without it, every tool is denied.
167
173
 
174
+ ## Step-up approval for sensitive tools (`--jit`)
175
+
176
+ **Why it is useful:** Some tools—such as refunding an invoice, wiring funds, or deleting production data—should never run with a standing token alone. With `--jit`, the proxy inspects `tools/call` requests before they reach your server and requires a short-lived Just-in-Time approval (RFC 9396 `authorization_details`). If the caller does not have one, the proxy answers with an `insufficient_authorization_details` tool error and an `Insufficient-Authorization-Details` header so the agent can ask a human for approval (via Slack or mobile push) and retry.
177
+
178
+ ```bash
179
+ npx lumoauth secure \
180
+ --upstream http://127.0.0.1:8000/mcp \
181
+ --jit refund=payment_initiation:refund \
182
+ --jit delete_user=user_management:delete,purge
183
+ ```
184
+
185
+ Clients can present the JIT approval either inside the MCP access token (`authorization_details`) or in the `X-LumoAuth-Jit-Token` HTTP header.
186
+
187
+ ## Injecting third-party API tokens from Token Vault (`--vault`)
188
+
189
+ **Why it is useful:** If your upstream MCP server calls GitHub, Slack, Jira, or Google Workspace, you do not need to hardcode shared API keys or modify the server to integrate with LumoAuth's SDK. With `--vault <slug>=<connection_id>`, `lumoauth` fetches a short-lived access token from LumoAuth's Token Vault for the verified caller (automatically passing `user_id` when the caller is a person or an agent acting for a person) and injects it into the upstream request as `X-LumoAuth-Vault-<Slug>-Token`:
190
+
191
+ ```bash
192
+ export LUMOAUTH_AGENT_TOKEN=agk_...
193
+
194
+ npx lumoauth secure \
195
+ --upstream http://127.0.0.1:8000/mcp \
196
+ --vault github=conn_github_prod \
197
+ --vault slack=conn_slack_workspace
198
+ ```
199
+
200
+ Your upstream server simply reads the `X-LumoAuth-Vault-Github-Token` and `X-LumoAuth-Vault-Slack-Token` headers. Any client-supplied `X-LumoAuth-*` headers are always stripped first.
201
+
202
+ ## Distributed tracing (`traceparent`)
203
+
204
+ **Why it is useful:** When an AI agent runs a multi-step workflow traced in Langfuse, LangSmith, Arize, or OpenTelemetry, you want to connect the agent trace to the exact tool authorization and Token Vault events in LumoAuth's audit log.
205
+
206
+ **How it works:** When a request arrives with a W3C `traceparent` HTTP header (or `params._meta.traceparent` inside a JSON-RPC request body), `lumoauth` validates it, forwards `traceparent` to LumoAuth on `/tools/authorize` and Token Vault requests, and passes both `traceparent` and `X-LumoAuth-Trace-Id` to your upstream server.
207
+
208
+ ## Kubernetes sidecar and Envoy `ext_authz`
209
+
210
+ **Why it is useful:** Platform teams running dozens of internal MCP servers in Kubernetes can secure them declaratively as a sidecar container or through an Envoy / Istio service mesh without touching application containers.
211
+
212
+ ### Envoy `ext_authz` mode
213
+
214
+ Run `npx lumoauth ext-authz` (or `npx lumoauth secure --ext-authz`) to start an Envoy HTTP `ext_authz` check server:
215
+
216
+ ```bash
217
+ npx lumoauth ext-authz --port 9001 --tool-policy --jit refund=payment_initiation:refund
218
+ ```
219
+
220
+ For each incoming request forwarded by Envoy (`envoy.filters.http.ext_authz`):
221
+ - Returns `200 OK` for public health paths (`--public /healthz`) and serves RFC 9728 discovery documents at `/.well-known/*`.
222
+ - Returns `401` or `403` with `WWW-Authenticate` challenges when the Bearer or DPoP token is missing or invalid.
223
+ - Inspects buffered JSON-RPC `tools/call` bodies (`with_request_body` in Envoy) to enforce LumoAuth's per-tool policy and `--jit` step-up requirements before the request reaches the upstream pod.
224
+ - Returns `200 OK` with `X-LumoAuth-*`, `X-LumoAuth-Vault-*-Token`, and `traceparent` headers for Envoy to inject into the upstream request.
225
+
226
+ Ready-to-use deployment manifests are included in the repository:
227
+ - [`Dockerfile`](../../Dockerfile) — multi-stage non-root (`65532:65532`) container image with `/healthz` healthcheck.
228
+ - [`deploy/kubernetes-sidecar.yaml`](../../deploy/kubernetes-sidecar.yaml) — Kubernetes Deployment running `lumoauth` as a sidecar in front of a loopback MCP container.
229
+ - [`deploy/envoy-ext-authz.yaml`](../../deploy/envoy-ext-authz.yaml) — Envoy configuration with `with_request_body` JSON-RPC inspection and upstream identity header injection.
230
+
168
231
  ## Check the setup
169
232
 
170
233
  `npx lumoauth check` prints what the registration says, the discovery document and the `401` challenge. It also prints what the authorization server advertises: PKCE, client metadata documents and dynamic registration.
@@ -191,10 +254,13 @@ Run `npx lumoauth --help` for all of them. The common ones:
191
254
  | `--lumoauth-url` | `LUMOAUTH_URL` | `https://eu.app.lumoauth.dev` for the EU region |
192
255
  | `--upstream` | | The MCP endpoint to protect |
193
256
  | `--stdio` | | The command after `--` is a stdio server |
257
+ | `--ext-authz` | | Run as an Envoy HTTP `ext_authz` check server |
194
258
  | `--port`, `--host` | `PORT` | Where to listen (default `0.0.0.0:8080`) |
195
259
  | `--path` | | Public path of the MCP endpoint (default: the Resource URI's path) |
196
260
  | `--scope` | | A scope that every request needs (repeatable) |
197
261
  | `--public` | | A path that needs no token, such as `/health` (repeatable) |
262
+ | `--jit` | | Require a JIT/RAR grant for a tool, e.g. `refund=payment:refund` (repeatable) |
263
+ | `--vault` | `LUMOAUTH_AGENT_TOKEN` | Inject `X-LumoAuth-Vault-<Slug>-Token` from Token Vault, e.g. `github=conn_123` (repeatable) |
198
264
 
199
265
  ## Troubleshooting
200
266