Skip to content
Back to search

mcpauth

Authentication for MCP Servers

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/mcpauth--mcpauth/badge.svg)](/listings/mcpauth--mcpauth)

HTML

<a href="/listings/mcpauth--mcpauth"><img src="/api/listings/mcpauth--mcpauth/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 75 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # @mcpauth/auth
  2. **A full-featured, self-hostable OAuth 2.0 server designed for the Modern AI-era and the [Model-Context-Protocol (MCP)](https://modelcontextprotocol.io/).**
  3. `@mcpauth/auth` empowers you to secure your MCP applications with a robust and flexible OAuth 2.0 implementation that you control.
  4. ## Live Demo
  5. Check out the live demo of `@mcpauth/auth` in action, deployed on Vercel:
  6. [**https://mcpauth-nextjs.vercel.app/**](https://mcpauth-nextjs.vercel.app/)
  7. The source code for this demo is available in the [`apps/nextjs`](./apps/nextjs) directory of this repository.
  8. For more live examples, see the [Examples page](https://mcpauth-docs.vercel.app/docs/examples) in the documentation.
  9. ## Docs
  10. The documentation for `@mcpauth/auth` is available at [https://mcpauth-docs.vercel.app/](https://mcpauth-docs.vercel.app/).
  11. ## Why @mcpauth/auth?
  12. ### Own Your Data and Your Authentication
  13. With `@mcpauth/auth`, you host the server, you own the data. No separate authorization server. No vendor lock-in.
  14. ### Required for Modern MCP Clients
  15. Major MCP clients like OpenAI's ChatGPT require OAuth 2.0 for authenticating users and authorizing access to tools and resources. `@mcpauth/auth` provides the compliant, secure server you need to integrate with these modern clients.
  16. ### Seamlessly Integrate Your Existing Auth
  17. The biggest challenge with adopting a new authentication system is integrating it with your existing user management. `@mcpauth/auth` solves this with a single, powerful function: `authenticateUser`.
  18. This function allows you to plug in _any_ existing authentication logic. Whether your users are authenticated via a session cookie, a bearer token, or an external system, you can validate them and link them to the OAuth flow with just a few lines of code.
  19. For example, if you're using `@auth/express` for session management, your implementation is as simple as this:
  20. ```typescript
  21. authenticateUser: async (request: Request) => {
  22. // Grab the user's existing session from a cookie
  23. const session = await getSession(request, authConfig);
  24. // Return the user object if they are authenticated, or null if not
  25. return (session?.user as OAuthUser) ?? null;
  26. },
  27. ```
  28. This flexibility means you can add a compliant MCP OAuth layer to your application without rebuilding your entire authentication stack.
  29. ## Compatibility
  30. `@mcpauth/auth` is designed to be adaptable to your existing stack. Here's a summary of our currently supported frameworks and database stores:
  31. | Type | Supported | Notes |
  32. | :-------- | :----------------------- | :--------------------------------------------------------------------- |
  33. | Framework | **Next.js**, **Express** | Adapters provide seamless integration with popular Node.js frameworks. |
  34. | Database | **Prisma**, **Drizzle** | Stores handle all the database interactions for OAuth entities. |
  35. Don't see your preferred framework or database? [**Request a new adapter or store by opening an issue on GitHub.**](https://github.com/mcpauth/mcpauth/issues/new?assignees=&labels=enhancement,adapter-request&template=feature_request.md&title=Feature%20Request:%20New%20Adapter/Store%20for%20[Framework/Database])
  36. ## Note for ChatGPT Deep Research Connectors
  37. [ChatGPT's Deep Research Custom Connector](https://help.openai.com/en/articles/11487775-connectors-in-chatgpt) is a new feature that allows you to use OpenAI's ChatGPT with your own data. It's a great way to get started with MCP, and requires an OAuth 2.0 server to authenticate users and authorize access to tools and resources.
  38. `@mcpauth/auth` provides the compliant, secure server you need to integrate with ChatGPT's Deep Research Custom Connector.
  39. There are a few issues with ChatGPT's Custom Connectors (across all MCP servers). They have been actively fixing many of these issues, but some remain. For example, after adding a new custom connector, you'll frequently get a "This connector does not implement our schema" error. This is a known issue, and refreshing your page often fixes it.
  40. ## Contributing
  41. We're open to all community contributions!
  42. ## License
  43. ISC

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.