From 2330fdf98c93f386e419c204d56f251a0bbcacbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vi=CC=81ctor=20Falco=CC=81n?= Date: Fri, 17 Jul 2026 17:50:46 +0200 Subject: [PATCH] feat(mcp): on-brand OAuth consent screen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Register Passport::authorizationView with our own Blade view and rework the published consent screen: use the app's favicon/theme tokens, name the connecting client and its redirect host, and state plainly that the connection can only read and analyse finance data — never modify it — matching the read-only decision for OAuth connections. Strings localised with es.json entries. --- app/Providers/AppServiceProvider.php | 5 + lang/es.json | 11 +- resources/views/mcp/authorize.blade.php | 157 ++++++++++++++++++++++++ 3 files changed, 172 insertions(+), 1 deletion(-) create mode 100644 resources/views/mcp/authorize.blade.php diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 9de64c83..f6594c70 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -15,6 +15,7 @@ use Illuminate\Support\Facades\RateLimiter; use Illuminate\Support\ServiceProvider; use Laravel\Cashier\Cashier; use Laravel\Fortify\Contracts\RegisterResponse as RegisterResponseContract; +use Laravel\Passport\Passport; class AppServiceProvider extends ServiceProvider { @@ -55,5 +56,9 @@ class AppServiceProvider extends ServiceProvider RateLimiter::for('emails', function (object $job): Limit { return Limit::perSecond(30); }); + + // Render the OAuth consent screen (Claude Desktop / ChatGPT connecting + // to the MCP server) with our own on-brand Blade view. + Passport::authorizationView(fn (array $parameters) => view('mcp.authorize', $parameters)); } } diff --git a/lang/es.json b/lang/es.json index a61252f1..db9e2652 100644 --- a/lang/es.json +++ b/lang/es.json @@ -2273,5 +2273,14 @@ "Here is your connection URL. Use it with a token you created above.": "Esta es tu URL de conexión. Úsala con un token que hayas creado arriba.", "Run this, using one of your tokens in place of .": "Ejecuta esto, usando uno de tus tokens en lugar de .", "Claude Desktop & ChatGPT": "Claude Desktop y ChatGPT", - "Coming soon. These apps sign in with OAuth, which we are still building, so a token will not work with them yet. Use Claude Code for now.": "Muy pronto. Estas apps inician sesión con OAuth, que todavía estamos construyendo, así que de momento un token no funciona con ellas. Usa Claude Code por ahora." + "Coming soon. These apps sign in with OAuth, which we are still building, so a token will not work with them yet. Use Claude Code for now.": "Muy pronto. Estas apps inician sesión con OAuth, que todavía estamos construyendo, así que de momento un token no funciona con ellas. Usa Claude Code por ahora.", + "Connect to :app": "Conectar con :app", + "Connect :client to :app": "Conectar :client con :app", + ":client is asking to read and analyse your finance data.": ":client solicita leer y analizar tus datos financieros.", + "Signed in as": "Sesión iniciada como", + "Sends you back to": "Te devuelve a", + "This connection can:": "Esta conexión puede:", + "Read and analyse your transactions, balances, categories and spending.": "Leer y analizar tus transacciones, saldos, categorías y gastos.", + "It cannot create, edit or delete anything. You can disconnect it at any time from your account settings.": "No puede crear, editar ni eliminar nada. Puedes desconectarla cuando quieras desde los ajustes de tu cuenta.", + "Connecting…": "Conectando…" } diff --git a/resources/views/mcp/authorize.blade.php b/resources/views/mcp/authorize.blade.php new file mode 100644 index 00000000..133044e1 --- /dev/null +++ b/resources/views/mcp/authorize.blade.php @@ -0,0 +1,157 @@ + + ($appearance ?? 'system') == 'dark'])> + + + + + {{-- Inline script to detect system dark mode preference and apply it immediately --}} + + + + + {{ __('Connect to :app', ['app' => config('app.name', 'Whisper Money')]) }} + + + + + + + + + + + @vite(['resources/css/app.css']) + + +@php + $redirectHost = parse_url($request->get('redirect_uri', ''), PHP_URL_HOST); +@endphp +
+
+ +
+ +
+
+ + + + +
+ +

+ {{ __('Connect :client to :app', ['client' => $client->name, 'app' => config('app.name', 'Whisper Money')]) }} +

+ +

+ {{ __(':client is asking to read and analyse your finance data.', ['client' => $client->name]) }} +

+
+ + +
+ +
+

{{ __('Signed in as') }}

+

{{ $user->email }}

+ @if($redirectHost) +

{{ __('Sends you back to') }}

+

{{ $redirectHost }}

+ @endif +
+ + +
+

{{ __('This connection can:') }}

+ +
    +
  • +
    +
    +
    + + {{ __('Read and analyse your transactions, balances, categories and spending.') }} + +
  • +
+ +

+ {{ __('It cannot create, edit or delete anything. You can disconnect it at any time from your account settings.') }} +

+
+
+ + +
+ +
+ @csrf + @method('DELETE') + + + + +
+ + +
+ @csrf + + + + +
+
+
+
+
+ + + +