Skip to main content

mcp-login-oauth

OAuth 2.1 browser login for FastMCP servers that sit in front of another service. Clients that can't send a token header, such as claude.ai, the Claude desktop and mobile apps, log in once with a form. The form is checked by the service behind the server, for example a Trilium password, an InvoiceNinja email, password and 2FA code, or a Paperless username and password. The client then only holds opaque OAuth tokens. Your server turns each login into a grant, such as a service token minted at login, and reads it back in tool code.

The library provides:

  • dynamic client registration, PKCE, refresh rotation and revocation, including revocation for public clients, which the MCP SDK's own /revoke rejects;
  • a Fernet-encrypted file store that survives restarts;
  • the login page with configurable fields, hints and collapsed sections for alternative logins, and honest dead-end pages for broken flows;
  • tokens bound to this server (RFC 8707 resource indicators) and the issuer named on the code redirect (RFC 9207);
  • protection against password guessing: a delay after each failed login, and login links that end after 5 failures or 10 minutes;
  • optional static header tokens next to OAuth.

What this library stands for and where it is going are on the documentation site.

TypeScript? This library is Python only; TypeScript apps sign in with Better Auth, see Coming from TypeScript.

Used by trilium-mcp, invoiceninja-mcp, paperless-ngx-mcp and the recall engine in trilium-llm-wiki.

Install

From PyPI:

uv add mcp-login-oauth

Needs Python ≥ 3.12 and FastMCP ≥ 4.1.3.

Documentation: mcp-login-oauth.marceltov.de: getting started, the reference, behaviour, development and the design decisions.

License

Copyright © 2026 Marcel Bruckner.

Licensed under the MIT License. Releases up to 0.2.2 were AGPL-3.0-or-later and stay so.

Metadata

Release files for mcp-login-oauth 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-login-oauth 0.2.3
File Size Uploaded Provenance Actions
mcp_login_oauth-0.2.3.tar.gz 16.7 kB With provenance Details for mcp_login_oauth-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mcp-login-oauth 0.2.3
File Interpreter ABI Platform Actions
mcp_login_oauth-0.2.3-py3-none-any.whl Python 3 none any Details for mcp_login_oauth-0.2.3-py3-none-any.whl

Total release size: 30.0 kB

Release files / mcp_login_oauth-0.2.3.tar.gz

Download URL mcp_login_oauth-0.2.3.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2d72ea0d00c5d70c71bcf8c0a0793dd824b6363603a5390641ae14ca896767cd
BLAKE2b-256 checksum
How to use checksums
52d304061a1569b3bd7e0fdc40b6dcc3407e7f51658c3b96637ff88622ceea4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Release files / mcp_login_oauth-0.2.3-py3-none-any.whl

Download URL mcp_login_oauth-0.2.3-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
566035664ad0914bfdac85d89dd040607dd2589f8cb1c243b8453620bc0f3dcc
BLAKE2b-256 checksum
How to use checksums
581c36a197bd059a13f43d999e601f10c3beca3a262be008864395ff8d958a48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Security for mcp-login-oauth 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mcp_login_oauth-0.2.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page