# The approval page (laravel-rust-mcp-oauth)

> The approval page is where a person decides whether an assistant may use your app with their account; it uses your sign-in and you can restyle it.

- 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/approval-page/
- Source: https://github.com/bowerbird-si/laravel-rust-mcp-oauth/blob/8b1d066397c9f1a1cf02d444a910a1c65585c159/docs/approval-page.md

The approval page is where a person decides whether an assistant may use your app with their account; it uses your sign-in and you can restyle it.

## What it shows

The page shows the evidence for the selected callback and labels claims separately.

| The app is | Because | The page says |
| --- | --- | --- |
| **Verified** | The selected HTTPS callback comes from a known client's metadata document or is on that client's known callback list | "Connect Claude to Your App?", and where its details come from |
| **Local program** | A known registration uses a loopback or private-use callback | “Connect a program on this computer to Your App?” and “It says it is Codex. Only continue if you just started it yourself.” |
| **Unreviewed** | Nothing proves who it is | "Connect an app to Your App?", the name it calls itself, its host, and "only continue if you just added Your App to this app yourself" |
| **A look-alike** | It isn't verified, and its name imitates a known client or a protected name, also with look-alike letters from other alphabets | "This app isn't Claude" and tells the person to cancel |

The name check matches protected names as whole words after folding look-alike letters. It also checks the entire name with separators removed, so “Claude Helper” and “C-l-a-u-d-e” trigger the warning. The page also flags local callbacks for unreviewed and look-alike apps.

The service name comes from `APP_NAME`.

## Guests

A visitor who isn't signed in sees **Log in** and, if you set a register page, **Create an account**:

```rust
McpOAuthServiceProvider::<model::Users<User>>::new()
    .register_url("/register")
```

**Log in** goes through a route behind the framework's `Authenticate` middleware, which remembers the page and sends the guest to your login page. A login handler that ends with `Redirect::intended(..)` brings them back to the approval page.

## Who may approve

```rust
McpOAuthServiceProvider::<model::Users<User>>::new()
    .can_approve(|user: User| async move { Ok(user.email_verified_at.is_some()) })
```

A person who may not approve sees the page without the **Connect** button.

## Names and wording

```rust
use laravel_rust_mcp_oauth::UserDisplay;

McpOAuthServiceProvider::<model::Users<User>>::new()
    .user_display(|user: &User| UserDisplay { name: user.name.clone(), email: user.email.clone() })
    .scope_label("mcp", "Read your projects and tasks")
    .protect_name("Your Company")
```

- `user_display`: the framework's `Authenticatable` only has an ID, so the page needs you to say what to show. Without it the page says "Your account".
- `scope_label`: what each scope lets the app do, in your words.
- `protect_name`: more names an unreviewed app may not use. "Anthropic", "OpenAI" and the known clients' names are protected already.

## Your own design

The crate ships two MiniJinja views: `mcp-oauth::approve` and `mcp-oauth::problem`. Put your own in `resources/views/vendor/mcp-oauth/approve.html` and `problem.html`, in any engine your app registers with the framework's views.

`approve` gets:

| Field | What |
| --- | --- |
| `service_name` | Your `APP_NAME` |
| `app.name` | The verified name, or the host |
| `app.verdict` | `"Verified"`, `"LocalProgram"`, `"Unreviewed"` or `"Lookalike"` |
| `app.host` | Where the app's details come from |
| `app.local` | Whether the callback is a program on this computer |
| `app.claimed_name` | For `LocalProgram`, the known name the program claims. Otherwise, the name supplied by an unreviewed or look-alike app |
| `app.imitates` | For a look-alike, the name it imitates |
| `user` | `name` and `email`, or nothing for a guest |
| `available` | Whether this person may approve |
| `scopes` | A list of `scope` and `label` |
| `sign_in_url`, `register_url` | The guest links |
| `decide_url`, `csrf_token` | The form: `POST` to `decide_url` with `_token` and `decision` set to `approve`, `deny` or `switch` |

`problem` gets `error_description`. It shows when the request can't be trusted enough to send the person back to the app, such as an unknown client or a callback that was never registered or has since been removed.

The page is sent with `Content-Security-Policy: frame-ancestors 'none'`, `X-Frame-Options: DENY`, `Cache-Control: private, no-store` and `Referrer-Policy: same-origin`, so it can't be framed or cached. Keep the form's `_token` field: the framework's CSRF check protects it.

## The decision

- **Connect** sends the browser back to the app with a one-time code. An active grant is reused when the person, the app and the approved scope set all match. A different scope set gets a separate grant.
- **Cancel** sends it back with `error=access_denied`.
- **Use another account** signs the person out and returns to the page.

At most `MCP_OAUTH_APPROVALS_PER_HOUR` approvals per account (10 by default).
