OAuth 2.1 sign-in for MCP servers in Laravel for Rust, so people can connect your app to Claude, ChatGPT, Cursor, VS Code and other AI assistants.
When someone adds your MCP server to their assistant, the assistant finds your sign-in page by itself. The person logs in with their normal account, approves the connection, and the assistant gets a token for your MCP route. No API keys to copy.
The crate gives your application:
- the discovery documents assistants look for (RFC 9728 and RFC 8414);
- client registration with Client ID Metadata Documents and dynamic registration;
- an approval page that uses your app's own sign-in, which you can restyle;
- tokens that rotate on every refresh and are revoked when one is reused;
McpAuthenticate, middleware for your MCP route, and theMcpGrantandMcpUserextractors;- a connections API for a "connected apps" page, events, commands and test helpers.
It works today with any route handler, including an rmcp service. The middleware is designed for Laravel's first-party MCP server, which is unreleased, and compatibility is still unverified.
| If you want to… | Read |
|---|---|
| Install the crate and connect your first assistant | Getting started |
| Protect your MCP route and use the grant in tools | Protecting routes |
| Change the approval page | The approval page |
| Understand which assistants can connect, and how | Clients |
| Show connections, revoke access, react to events | Tokens and connections |
| See every setting | Configuration |
| Keep tables you already have | Existing tables |
| Test your app | Testing |
| Know what the crate protects against | Security |
Community package, not affiliated with Laravel.