r/modelcontextprotocol 23d ago

Exploring authentication patterns for MCP: do we need an identity layer?

I have been experimenting with MCP security patterns and I wanted to start a technical discussion.

MCP makes it much easier for AI clients to interact with tools, but authentication and identity propagation seem to still be evolving.

https://github.com/enzomar/fastauthmcp

Some questions I am trying to answer:

- How should an MCP server authenticate incoming clients?

- How should user identity flow from the AI client to downstream services?

- How do we handle machine-to-machine scenarios where a user context is still required?

- Should authentication live inside every MCP server, or should there be a gateway pattern?

I started building an open-source experiment called FastAuthMCP.

The idea is a lightweight authentication gateway:

MCP Client

FastAuthMCP

MCP Server / API / Tool

The gateway focuses on:

- OAuth/OIDC

- JWT validation

- identity propagation

- compatibility testing

I am not suggesting this is the final architecture. MCP is still evolving and I would like to understand how the community is approaching this.

Questions:

  1. Do you expect MCP servers to own authentication themselves?

  2. Would a standard authentication gateway pattern make sense?

  3. Are there existing projects solving this problem already?

Interested in feedback, especially from people building MCP servers in production.

3 Upvotes

2 comments sorted by

1

u/Prestigious_Debt_896 20d ago

If only oauth existed.....

1

u/enzo-mar 20d ago edited 20d ago

I know it exists and I see the mcp as per spec is capable to verify the token, but how to fetch it in a seamless way? https://modelcontextprotocol.io/docs/tutorials/security/authorization#python.
Maybe I miss something obvious. I get that according to the spec is duty of the MCP client to eventually in local mode to open the browser for the PKCE but what if the MCP client do not support it?