explaingit

enzomar/fastauthmcp

Analysis updated 2026-05-18

1PythonAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

Adds login, identity, and secure token forwarding to AI agent tool servers with one config file and no changes to existing tools.

Mindmap

mindmap
  root((FastAuthMCP))
    What it does
      Identity for AI tools
      Token forwarding
      Role checks
    Tech stack
      Python
      FastMCP
      OIDC
    Login modes
      Browser login
      Token exchange
      Machine to machine
    Providers
      Auth0
      Okta
      Azure Entra
      Keycloak
    Use cases
      Secure MCP servers
      Per user API access
      Admin only tools

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add login so an AI agent knows which human is making each tool call.

USE CASE 2

Forward a user's own access token to an internal or third party API from inside a tool function.

USE CASE 3

Restrict certain tools to admin or specific roles with a single decorator.

USE CASE 4

Connect an MCP server to an existing identity provider like Auth0, Okta, or Azure without writing OAuth code.

What is it built with?

PythonFastMCPOAuth2OIDC

How does it compare?

enzomar/fastauthmcp0xustaz/streamgatea-bissell/unleash-lite
Stars111
LanguagePythonPythonPython
Setup difficultymoderatehardhard
Complexity3/54/54/5
Audiencedeveloperdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Needs an OIDC identity provider (like Auth0 or Keycloak) configured to get real authentication working.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

FastAuthMCP adds identity and authentication to MCP servers, the tool interfaces that let AI agents like Claude or Gemini call functions in your codebase. Normally, when an AI agent calls one of your tools, there is no built in way to know which human is behind that request, what they are allowed to do, or how to pass their credentials along to another service. Every team building these servers ends up building that logic from scratch. FastAuthMCP is meant to remove that repeated work. It sits between the AI client and your tool functions. You install it with pip, then change a single import line so your existing tools use it instead of plain FastMCP. Without any extra setup it behaves exactly like a normal MCP server. Add a small YAML config file naming an identity provider, and your tool functions gain two helpers: one that tells you who is calling, and one that hands you a valid, automatically refreshed token to forward to another API on that person's behalf. A decorator lets you restrict a tool to specific roles, like admin only. It supports three login patterns: a browser based login for desktop apps like Claude Desktop or Cursor, a token exchange flow for cloud based agents such as Gemini where no browser is available, and a machine to machine mode using a client ID and secret for unattended services. It is compatible with common identity providers including Zitadel, Keycloak, Auth0, Azure Entra ID, Okta, and Google Cloud, each with a setup guide. The project includes an automated test suite of 34 scenarios checking that authentication, role based authorization, and security cases like expired or mismatched tokens behave correctly across providers. It requires Python 3.11 or newer and is released under the Apache 2.0 license. It is a new, single star project as of mid July 2026, so it should be treated as early stage software rather than a widely proven tool.

Copy-paste prompts

Prompt 1
Show me how to add FastAuthMCP to an existing FastMCP server with a single import change.
Prompt 2
Write a fastauthmcp.yaml config for connecting to Auth0 using authorization code login.
Prompt 3
Explain how access_token() and identity() work inside a FastAuthMCP tool function.
Prompt 4
How do I restrict a tool to admin users only using require_roles in FastAuthMCP?

Frequently asked questions

What is fastauthmcp?

Adds login, identity, and secure token forwarding to AI agent tool servers with one config file and no changes to existing tools.

What language is fastauthmcp written in?

Mainly Python. The stack also includes Python, FastMCP, OAuth2.

What license does fastauthmcp use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is fastauthmcp to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is fastauthmcp for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.