Scan your whole stack
Are you using lumoauth-fastmcp?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.5.0
lumoauth-fastmcp was last scanned on 29 Nov 2026 at version 1.5.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.5.0 LATEST | 29 Nov 2026 | No rules fired |
| 1.4.0 | 19 Nov 2026 | No rules fired |
| 1.3.1 | 7 Nov 2026 | No rules fired |
| 1.3.0 | 5 Nov 2026 | Not shown |
| 1.2.0 | 31 Oct 2026 | Not shown |
Findings for v1.5.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 1.5.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Add sign-in and per-tool access control to a FastMCP server in three lines.
Quick start · How it works · Who is calling · Scopes and callers · Step-up approval (JIT) · Token Vault · Per-tool policy · Tracing · Troubleshooting · Docs
from fastmcp import FastMCP
from lumoauth_fastmcp import LumoAuthProvider
mcp = FastMCP("Invoices", auth=LumoAuthProvider())
Set LUMOAUTH_ORG_ID and LUMOAUTH_MCP_SERVER_ID, and that is the whole integration. LumoAuth signs users in and issues the tokens. Your server checks each token and runs the tool.
Standard discovery MCP clients read one well-known address on your server to find LumoAuth. No custom handshakes.
Sign-in and consent LumoAuth shows the sign-in and consent screens. Your server never handles a password.
Token checks on your server Each request is checked locally: signature, issuer, audience, expiry and DPoP binding.
The verified caller
current_caller() returns a person, an AI agent, or an agent that acts for a person.
Rules per tool Require a scope, a person or an agent capability with one argument.
Policy in LumoAuth Grant each tool to a person or an agent in LumoAuth. A change applies within 30 seconds, without a restart.
Step-up approval (JIT)
Require human approval (require_jit / ensure_jit) before an agent can run a high-risk tool or touch a specific record.
Token Vault for SaaS APIs
Fetch short-lived GitHub, Slack, or Jira tokens (auth.vault_token(...)) scoped automatically to the current caller.
Trace correlation
Propagate W3C traceparent headers so every tool authorization and Vault call links to your agent trace in LumoAuth's audit log.
You need Python 3.10 or later and a LumoAuth organization. Create an organization if you do not have one yet.
In the LumoAuth portal:
Invoices and Resource URI to http://localhost:8000/mcp.mcp_…) from the top of the page.The Resource URI is the exact URL that clients connect to. A token for one Resource URI does not work at another.
pip install lumoauth-fastmcp
Save this as server.py:
from fastmcp import FastMCP
from lumoauth_fastmcp import LumoAuthProvider, current_caller
mcp = FastMCP("Invoices", auth=LumoAuthProvider())
@mcp.tool
def whoami() -> str:
"""Show who is calling."""
return current_caller().sub
if __name__ == "__main__":
mcp.run(transport="http", port=8000)
Start it with your organization's slug and the server id from step 1. The slug is the part after /orgs/ in the portal's URL.
export LUMOAUTH_ORG_ID=acme
export LUMOAUTH_MCP_SERVER_ID=mcp_0123456789abcdef01234567
python server.py
For the EU region, also set LUMOAUTH_URL=https://eu.app.lumoauth.dev.
$ curl -i http://localhost:8000/mcp
HTTP/1.1 401 Unauthorized
www-authenticate: Bearer scope="mcp:read", resource_metadata="http://localhost:8000/.well-known/oauth-protected-resource/mcp"
Your server now rejects calls without a token. The 401 tells MCP clients where to find LumoAuth.
First, create an application for the client in the portal:
Local MCP client and Redirect URI to http://localhost:8765/callback.openid profile email offline_access mcp:read. Click Save configuration.Then save this as client.py, with your client ID:
import asyncio
from fastmcp import Client
from fastmcp.client.auth import OAuth
auth = OAuth(client_id="client_0123456789abcdef0123456789abcdef", callback_port=8765)
async def main():
async with Client("http://localhost:8000/mcp", auth=auth) as client:
result = await client.call_tool("whoami")
print(result.data)
asyncio.run(main())
Run it in a second terminal:
$ python client.py
01a18f7f-fe26-7f38-b46a-ac6bfabfbb78
Your browser opens on the LumoAuth sign-in page. After you sign in and approve, the script prints your user id. Your tool read that id from the verified token.
Claude Code needs no application. It identifies itself with its Client ID Metadata Document, which LumoAuth reads when you sign in. This works while Client ID metadata documents (CIMD) is on for your organization, which is the default (Security → Sign-in settings → Platform security):
claude mcp add --transport http invoices http://localhost:8000/mcp
claude mcp login invoices
When your organization has CIMD off, use the application from above instead:
claude mcp add --transport http \
--client-id client_0123456789abcdef0123456789abcdef \
--callback-port 8765 \
invoices http://localhost:8000/mcp
claude mcp login invoices
Your browser opens on the same sign-in page. Then claude mcp list shows the connection:
invoices: http://localhost:8000/mcp (HTTP) - ✔ Connected
Other MCP clients connect the same way: with a metadata document, or with a client ID and a callback port. Troubleshooting explains the errors that you may see.
https:// address. LumoAuth accepts plain http:// only for localhost, 127.0.0.1 and [::1].LumoAuth is the authorization server. It shows the consent screen and issues access tokens whose audience is your server's Resource URI. Your FastMCP server stays a resource server, and the provider gives it what the MCP specification asks of one:
/.well-known/oauth-protected-resource/.... This document names your LumoAuth organization as the authorization server.401 with a WWW-Authenticate header that points to that document. The challenge names the scopes that the registration advertises. It also states the real reason when a token is rejected: expired, wrong audience, replayed DPoP proof, and so on.at+jwt type, and no portal test tokens. A DPoP-bound token must arrive with the DPoP scheme and a fresh proof for this request.The provider reads the server's registration from LumoAuth once at start-up: the Resource URI, the advertised scopes, and whether only DPoP-bound tokens are accepted. Restart the server after you change the registration.
Authentication applies to HTTP transports. A server that runs over stdio is started by the user's own MCP client and has no OAuth step.
current_caller() returns the verified claims of the current request as lumoauth.verify.AccessTokenClaims. This is the same object that verify_access_token in the LumoAuth Python SDK returns.
from lumoauth_fastmcp import current_caller
@mcp.tool
def list_invoices() -> list[dict]:
caller = current_caller()
if caller.is_agent:
log.info("agent %s", caller.agent_id) # "agt_…"
elif caller.is_delegated:
log.info("agent %s for user %s", caller.actor, caller.sub)
return invoices_for(caller.sub)
current_caller() returns None on transports without OAuth, such as stdio and in-memory clients.
| Property | Meaning |
|---|---|
caller.sub |
The user ID, or agent_agt_… for an autonomous agent |
caller.is_agent, caller.agent_id |
True for an AI agent, and its agt_… ID |
caller.is_delegated, caller.actor |
True when an agent acts on behalf of the user caller.sub |
caller.scopes, caller.capabilities |
Granted OAuth scopes and agent capabilities |
caller.is_dpop_bound, caller.dpop_thumbprint |
True when the token is bound to a DPoP key, and the key's JWK SHA-256 thumbprint (cnf.jkt, RFC 7638), else None |
caller.is_jit, caller.authorization_details |
True when the caller holds a Just-in-Time (RFC 9396) approval, and its granted details |
caller.traceparent, caller.trace_id |
The validated W3C traceparent header and 32-character trace ID of the request |
Pass the checks to FastMCP's auth= argument or to AuthMiddleware:
from fastmcp.server.middleware import AuthMiddleware
from lumoauth_fastmcp import require_agent, require_scopes, require_user
@mcp.tool(auth=require_scopes("invoices:refund"))
def refund(invoice_id: str) -> str: ...
@mcp.tool(auth=require_user()) # people only, no agents
def change_bank_details(iban: str) -> str: ...
@mcp.tool(auth=require_agent("reminders:send")) # agents with this capability
def send_reminder(invoice_id: str) -> str: ...
require_user(allow_delegation=True) also admits an agent that acts for a person.
Add a new scope in two places: the server's Scopes, and the Scopes of each application that may ask for it. The checks follow LumoAuth's rule: a granted scope that ends in :* (such as invoices:*) covers the scopes under it, such as invoices:refund. Every other scope compares exactly. Prefer narrow scopes, because the MCP security best practices list wildcard scopes as a common mistake.
A component-level check hides the component from callers who fail it. To get an insufficient_scope step-up instead, put the scope check in AuthMiddleware. The client can then ask the user for the missing scope.
mcp = FastMCP(
"Invoices",
auth=LumoAuthProvider(),
middleware=[AuthMiddleware(auth=require_scopes("invoices:read"))],
)
Why it is useful: Some tools—such as refunding an invoice, wiring money, or deleting a production database—are too risky for an AI agent to run with a standing token alone. With Just-in-Time (JIT) authorization (RFC 9396 Rich Authorization Requests), your tool requires a short-lived approval for that specific action or record. When an agent calls the tool without one, the server rejects the call with an insufficient_authorization_details hint telling the agent exactly what approval to ask a human for (for example, via Slack or mobile push).
The hint is one authorization_details object, the shape that POST /jit/request takes. The error carries it in authorization_details_hint, in the Insufficient-Authorization-Details value (base64 JSON) and in its text (authorization_details_hint={…}). When more than one approval is missing, the hint names the first one; the agent asks for it, calls again, and gets the next one.
require_jit and ensure_jitUse require_jit() on @mcp.tool(auth=...) for static action requirements, and ensure_jit() inside the tool body when the required identifier or locations depend on the runtime arguments passed to the tool:
from lumoauth_fastmcp import ensure_jit, require_jit
# 1. Declarative check: hides the tool until the caller has a "payment_initiation" grant
@mcp.tool(auth=require_jit("payment_initiation", actions=["refund"]))
def refund(invoice_id: str) -> str:
# 2. Argument-bound check: ensures the JIT approval covers THIS specific invoice_id
ensure_jit("payment_initiation", actions=["refund"], identifier=invoice_id)
return f"Refunded {invoice_id}"
If you want agents to see the tool in tools/list with their normal MCP token and receive the insufficient_authorization_details step-up hint when they call tools/call, either call ensure_jit(...) inside the tool body or configure jit= on auth.tool_policy():
auth = LumoAuthProvider()
mcp = FastMCP(
"Invoices",
auth=auth,
middleware=[
auth.tool_policy(
jit={"refund": {"type": "payment_initiation", "actions": ["refund"]}}
)
],
)
The agent asks LumoAuth for the approval (POST /jit/request), a person approves it, and the agent gets the JIT token (POST /jit/request/{id}/token, JITContext.get_token() in the lumoauth package). It sends that token with its normal MCP access token, in the X-LumoAuth-Jit-Token header:
Authorization: Bearer <MCP access token>
X-LumoAuth-Jit-Token: <JIT token>
LumoAuthProvider accepts the JIT token only when all of these are true:
typ: JWT, signed with a key of your organization (RS*, PS* or ES*).iss is your organization's issuer, and its aud is your organization's slug. Set LUMOAUTH_ORG_ID when you configure only the issuer of a custom domain.jit: true and has not expired.sub is the caller's sub, and the agent that it names (permissions.agent_id) is the caller's agent (act.sub of a delegated token, else sub).Then its permissions.authorization_details are added to current_caller().authorization_details. A JIT token that fails a check is ignored. The JIT check of the tool then refuses the call, and its error ends with the reason, for example The X-LumoAuth-Jit-Token header was not accepted: the JIT token has expired.
The provider checks the token locally. LumoAuth can revoke a JIT token before it expires, for example when the agent completes its task. A JIT token lives 15 minutes at most. For an action with consequences, also ask token introspection in the tool.
authorization_details are also read from the MCP access token itself. LumoAuth does not issue MCP access tokens with them today, so the header is the way to send an approval.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.