The approval page

laravel-rust-mcp-oauth Alpha Laravel for Rust

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 isBecauseThe page says
VerifiedThe 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 programA 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.”
UnreviewedNothing 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-alikeIt 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:

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

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

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:

FieldWhat
service_nameYour APP_NAME
app.nameThe verified name, or the host
app.verdict"Verified", "LocalProgram", "Unreviewed" or "Lookalike"
app.hostWhere the app's details come from
app.localWhether the callback is a program on this computer
app.claimed_nameFor LocalProgram, the known name the program claims. Otherwise, the name supplied by an unreviewed or look-alike app
app.imitatesFor a look-alike, the name it imitates
username and email, or nothing for a guest
availableWhether this person may approve
scopesA list of scope and label
sign_in_url, register_urlThe guest links
decide_url, csrf_tokenThe 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).