import Link from "next/link"; import CopyButton from "./copy-button"; export const dynamic = "force-dynamic"; /** * /auth/cli-callback — OAuth redirect target for clients that can't open a * loopback port (e.g. Claude Code in a sealed container). * * The page is intentionally unauthenticated: the user arrives here as part * of an in-progress OAuth flow, before any session exists. The code is * single-use and proof of possession (PKCE on the client side) is still * required to exchange it. Showing it on this page does NOT grant access * by itself. */ interface SearchParams { code?: string; state?: string; error?: string; error_description?: string; iss?: string; } export default async function CliCallbackPage({ searchParams, }: { searchParams: Promise; }) { const params = await searchParams; if (params.error) { return (

Sign-in failed

{params.error} {params.error_description ? <> — {params.error_description} : null}

Switch back to your terminal, cancel the in-progress prompt, and retry the claude mcp add command. If the error persists, check that the redirect URI matches what your OIDC provider has registered.

← home

); } if (!params.code) { return (

OAuth callback

This page is the manual-fallback redirect target for the shared-memory MCP server. It only does something useful in the middle of an OAuth sign-in flow that couldn't reach a loopback callback on your machine.

If you're trying to connect an MCP client, start over from your terminal with the claude mcp add command shown in the README.

← home

); } const fullUrl = `?code=${encodeURIComponent(params.code)}${ params.state ? `&state=${encodeURIComponent(params.state)}` : "" }${params.iss ? `&iss=${encodeURIComponent(params.iss)}` : ""}`; return (

Sign-in complete

Switch back to your terminal where Claude Code (or whichever MCP client) is waiting, and paste one of the values below.

Authorization code

Most clients ask for just the code:

        {params.code}
      

Full callback URL

Some clients ask you to paste the entire URL their loopback timed out on:

        {fullUrl}
      
{params.state ? ( <>

State (verification)

Your terminal client may show its expected state; it should match this value. If it doesn't, stop and start over — something is wrong with the flow.

{params.state}
) : null}

The code is single-use and expires in a few minutes. If you take too long, retry the claude mcp add command.

); }