lane-mcp-auth
OAuth 2.1 resource server and consent gate for an MCP server behind Lane — the
Python distribution of @getonlane/mcp-auth.
Docs — overview · quickstart · the gate · reference
pip install lane-mcp-auth # core
pip install 'lane-mcp-auth[fastmcp]' # + the FastMCP helpers
Your server verifies bearer tokens, publishes the discovery document clients need, and refuses every tool until the caller holds a recorded, revocable grant.
from lane_mcp_auth import LaneMcpAuth
auth = LaneMcpAuth(
resource="https://acme.example/mcp",
connections=connections, # yours: this is server-side state
exchanger=exchanger,
)
The three tiers
| tier | reached by | declared |
|---|---|---|
| authenticated only | — | not registrable |
| any connected caller | completing the step-up | no scope |
| a specific authority | the step-up granting it | scope="…" |
Registration is the floor. Omitting a scope means any connected caller, never anyone: a session that has not registered has nothing anyone can revoke, so a tool answering it would be answering something nobody can withdraw.
With FastMCP
from lane_mcp_auth.fastmcp import register_step_up_tool, guarded
register_step_up_tool(mcp, auth)
@mcp.tool()
@guarded(auth, "read_orders", scope="email")
async def read_orders(ctx) -> str:
return await orders_for(ctx)
Never authorize on the token's scopes
claims.scopes is the token's own claim: empty before the step-up, stale after.
Authority lives in the connection and is reachable only through has_scope() /
effective_scopes(), because Lane decides it at exchange time and can refuse an
exchange it would previously have allowed. A signed claim cannot be withdrawn.
Parity with the TypeScript
Same invariants, same names where Python idiom allows. The TypeScript package is
the reference implementation; where the two could drift — scope filtering, the
metadata paths, the gate's decision table — see SCOPE.md for what is
implemented here and what is not yet.
Licence
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lane_mcp_auth-0.1.3.tar.gz.
File metadata
- Download URL: lane_mcp_auth-0.1.3.tar.gz
- Upload date:
- Size: 140.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ea5f5a93ad545b22df509d8d09aeee60c5547315c1fe6951bcf068636249e3c
|
|
| MD5 |
03cc641663822ed84628930808085f0c
|
|
| BLAKE2b-256 |
78b42254d0700b5fb35f1fbcd5bc7d4a22c192b424ffdd7d2b71affe0a0d56e4
|
Provenance
The following attestation bundles were made for lane_mcp_auth-0.1.3.tar.gz:
Publisher:
publish-mcp-auth.yml on Lane-Technologies-Inc/lane
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lane_mcp_auth-0.1.3.tar.gz -
Subject digest:
7ea5f5a93ad545b22df509d8d09aeee60c5547315c1fe6951bcf068636249e3c - Sigstore transparency entry: 2544330610
- Sigstore integration time:
-
Permalink:
Lane-Technologies-Inc/lane@7e0af3088e2722df92e4463d500934f68eb9cfa1 -
Branch / Tag:
refs/heads/agent/derive-at-draft-20260813-b7e2 - Owner: https://github.com/Lane-Technologies-Inc
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-mcp-auth.yml@7e0af3088e2722df92e4463d500934f68eb9cfa1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lane_mcp_auth-0.1.3-py3-none-any.whl.
File metadata
- Download URL: lane_mcp_auth-0.1.3-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38a7e63df441a0f47f7b3f2aa10a60abbee28da866feda8e44a6efb76acd2128
|
|
| MD5 |
166f5972a88d35a20bde73d996bbb448
|
|
| BLAKE2b-256 |
53957fcaa1ffb0e7e006118bdad6dc680ba5681920103a8e16e57dd07df5c05c
|
Provenance
The following attestation bundles were made for lane_mcp_auth-0.1.3-py3-none-any.whl:
Publisher:
publish-mcp-auth.yml on Lane-Technologies-Inc/lane
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lane_mcp_auth-0.1.3-py3-none-any.whl -
Subject digest:
38a7e63df441a0f47f7b3f2aa10a60abbee28da866feda8e44a6efb76acd2128 - Sigstore transparency entry: 2544330729
- Sigstore integration time:
-
Permalink:
Lane-Technologies-Inc/lane@7e0af3088e2722df92e4463d500934f68eb9cfa1 -
Branch / Tag:
refs/heads/agent/derive-at-draft-20260813-b7e2 - Owner: https://github.com/Lane-Technologies-Inc
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-mcp-auth.yml@7e0af3088e2722df92e4463d500934f68eb9cfa1 -
Trigger Event:
push
-
Statement type: