# laravel-rust-mcp-oauth documentation

> 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.

- Package: laravel-rust-mcp-oauth (Laravel for Rust, alpha), crates: `laravel-rust-mcp-oauth`
- Maintenance: active; Latest release: 0.1.0 (2026-12-05); Framework: laravel-rust 0.2.x; MSRV: Rust 1.99 or later; Licence: MIT
- Links: [Repository](https://github.com/bowerbird-si/laravel-rust-mcp-oauth), [crates.io](https://crates.io/crates/laravel-rust-mcp-oauth/0.1.0), [docs.rs](https://docs.rs/laravel-rust-mcp-oauth/0.1.0), [Changelog](https://oss.bowerbird.si/mcp-oauth/docs/changelog/), [Contributing](https://github.com/bowerbird-si/laravel-rust-mcp-oauth/blob/8b1d066397c9f1a1cf02d444a910a1c65585c159/CONTRIBUTING.md), [Security policy](https://github.com/bowerbird-si/laravel-rust-mcp-oauth/blob/8b1d066397c9f1a1cf02d444a910a1c65585c159/SECURITY.md)
- Based on: [Laravel MCP](https://github.com/laravel/mcp): The public flow of Mcp::oauthRoutes(): discovery, client registration, an approval screen in your app and bearer tokens for the MCP server.; [Laravel Passport](https://github.com/laravel/passport): The authorization server Laravel MCP builds on. This crate needs no Passport, supports Client ID Metadata Documents and uses opaque, hashed tokens instead of JWTs.; [MCP authorization specification](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization): The sign-in flow MCP clients expect, with Client ID Metadata Documents preferred over dynamic registration.
- Community package, not affiliated with Laravel.
- HTML version: https://oss.bowerbird.si/mcp-oauth/docs/
- Source: https://github.com/bowerbird-si/laravel-rust-mcp-oauth/blob/8b1d066397c9f1a1cf02d444a910a1c65585c159/docs/index.md

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 the `McpGrant` and `McpUser` extractors;
- 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](https://github.com/laravel/rust-framework/pull/321), which is unreleased, and compatibility is still unverified.

| If you want to… | Read |
| --- | --- |
| Install the crate and connect your first assistant | [Getting started](https://oss.bowerbird.si/mcp-oauth/docs/getting-started/) |
| Protect your MCP route and use the grant in tools | [Protecting routes](https://oss.bowerbird.si/mcp-oauth/docs/protecting-routes/) |
| Change the approval page | [The approval page](https://oss.bowerbird.si/mcp-oauth/docs/approval-page/) |
| Understand which assistants can connect, and how | [Clients](https://oss.bowerbird.si/mcp-oauth/docs/clients/) |
| Show connections, revoke access, react to events | [Tokens and connections](https://oss.bowerbird.si/mcp-oauth/docs/tokens-and-connections/) |
| See every setting | [Configuration](https://oss.bowerbird.si/mcp-oauth/docs/configuration/) |
| Keep tables you already have | [Existing tables](https://oss.bowerbird.si/mcp-oauth/docs/existing-tables/) |
| Test your app | [Testing](https://oss.bowerbird.si/mcp-oauth/docs/testing/) |
| Know what the crate protects against | [Security](https://oss.bowerbird.si/mcp-oauth/docs/security/) |

Community package, not affiliated with Laravel.
