Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
2306fb8
feat(oauth): opt-in switch and default-off gate for browser login (Sp…
Dumbris Nov 22, 2026
e0dc9b9
fix(oauth): refuse browser login in every server-edition build (Spec …
Dumbris Nov 22, 2026
bfcc550
feat(oauth): protocol logic for browser login (Spec 132 PR-1b)
Dumbris Nov 22, 2026
1251d0a
fix(oauth): tighten redirect matching and bound in-memory state (Spec…
Dumbris Nov 22, 2026
fb7d861
fix(oauth): align code and request expiry, make limiter admission ato…
Dumbris Nov 22, 2026
8f51f22
feat(oauth): storage for browser logins and one binding writer (Spec …
Dumbris Nov 22, 2026
6d74c98
test(oauth): scope the no-storage check to browser-login state (Spec …
Dumbris Nov 22, 2026
143494c
fix(oauth): harden browser-login storage after review (Spec 132 PR-1c)
Dumbris Nov 22, 2026
8ecda0a
fix(oauth): validate bindings only where a browser-login copy exists …
Dumbris Nov 22, 2026
5716d19
fix(oauth): restore pins by binding incarnation, keep connect snapsho…
Dumbris Nov 22, 2026
3bd6cdd
Merge remote-tracking branch 'origin/feat/client-oauth-login-switch' …
Dumbris Nov 22, 2026
f51b746
feat(oauth): browser-login service, client views and guard (Spec 132 …
Dumbris Nov 22, 2026
a592315
fix(oauth): close cancellation, token-endpoint and client-view gaps (…
Dumbris Nov 22, 2026
4981623
fix(oauth): close exchange/approve races and rollback guard gap (Spec…
Dumbris Nov 22, 2026
17c9397
fix(oauth): fence the exchange with config commits, atomic key creati…
Dumbris Nov 22, 2026
0761328
fix(oauth): fence refresh with config commits, complete key-file fall…
Dumbris Nov 22, 2026
dc01d1a
feat(oauth): browser-login endpoints and access-token auth (Spec 132 …
Dumbris Nov 22, 2026
6c66382
fix(oauth): close stream, cross-site and contract gaps after review (…
Dumbris Nov 23, 2026
f08df21
fix(oauth): end blocked streams on revoke, cancel across quick off/on…
Dumbris Nov 23, 2026
b89b95d
fix(oauth): order the disable epoch, per-run stream tracking (Spec 13…
Dumbris Nov 23, 2026
3f8eacb
fix(oauth): bump the disable epoch only on publish, bind streams to a…
Dumbris Nov 23, 2026
ff2b6e7
test(oauth): end-to-end script, docs and real-client record for brows…
Dumbris Nov 23, 2026
b62f508
test(oauth): harden the browser-login e2e script, correct docs (Spec …
Dumbris Nov 23, 2026
133210d
test(oauth): real-shaped forged tokens, isolate the manual check (Spe…
Dumbris Nov 23, 2026
44ac406
docs(oauth): qualify the server-edition 404 (Spec 132 PR-1f)
Dumbris Nov 23, 2026
5c0b698
docs(oauth): record the Claude Code real-client check (Spec 132 PR-1f)
Dumbris Nov 23, 2026
f118305
feat(oauth): consent page for browser login (Spec 132 PR-2a)
Dumbris Nov 23, 2026
60723ab
fix(oauth): consent page review round 1, backend (Spec 132 PR-2a)
Dumbris Nov 23, 2026
94fb487
fix(oauth): consent page review round 1, page and replace ownership (…
Dumbris Nov 23, 2026
db9a666
fix(oauth): consent page review round 2 (Spec 132 PR-2a)
Dumbris Nov 23, 2026
313f261
fix(oauth): consent page review round 3 (Spec 132 PR-2a)
Dumbris Nov 23, 2026
fef8406
fix(oauth): consent page review round 4 (Spec 132 PR-2a)
Dumbris Nov 23, 2026
0a0cd93
fix(oauth): consent page review round 5 (Spec 132 PR-2a)
Dumbris Nov 23, 2026
09b8281
test(oauth): Playwright spec for the consent page (Spec 132 PR-2a, T061)
Dumbris Nov 23, 2026
a0a84a8
fix(oauth): consent page security review fixes (Spec 132 PR-2a)
Dumbris Nov 23, 2026
4a2f24e
fix(oauth): normalise the initialize name like the registered name (S…
Dumbris Nov 23, 2026
ee47435
feat(oauth): manage browser logins in Clients hub, CLI and MCP (Spec …
Dumbris Nov 23, 2026
8a407ea
fix(oauth): refuse blank login ids and lock the revoke dialog while i…
Dumbris Nov 23, 2026
5bba11c
Merge origin/main into feat/client-oauth-login-storage
Dumbris Nov 23, 2026
2f17cd2
Merge storage slice and main into feat/client-oauth-login-runtime
Dumbris Nov 23, 2026
7c19092
test(oauth): fixture credential expiry follows the real clock (Spec 1…
Dumbris Nov 23, 2026
5b20ad1
Merge origin/main into feat/client-oauth-login-runtime
Dumbris Nov 23, 2026
a133327
Merge runtime slice and main into feat/client-oauth-login-http
Dumbris Nov 23, 2026
05e5080
test(auth): skip the key-file mode check on Windows (Spec 132 PR-1d)
Dumbris Nov 23, 2026
b90a6f8
test(storage): repin order test no longer depends on hash luck (Spec …
Dumbris Nov 23, 2026
54653b3
Merge runtime slice into feat/client-oauth-login-http
Dumbris Nov 23, 2026
41a51a6
Merge origin/main into feat/client-oauth-login-http
Dumbris Nov 23, 2026
fed24cd
Merge http slice into feat/client-oauth-login-e2e
Dumbris Nov 23, 2026
db811ed
Merge e2e slice into feat/client-oauth-login-consent
Dumbris Nov 23, 2026
9abd1c1
chore: drop review scratch files committed by mistake (Spec 132 PR-2b)
Dumbris Nov 23, 2026
9e6e6f7
Merge consent slice into feat/client-oauth-login-hub
Dumbris Nov 23, 2026
1c10156
fix(server): a stopped run no longer stops or unmarks the next run (S…
Dumbris Nov 23, 2026
bc5ae6f
fix(server): a stop in progress leaves a newly started run alone (Spe…
Dumbris Nov 23, 2026
c247595
Merge remote-tracking branch 'origin/feat/client-oauth-login-http' in…
Dumbris Nov 23, 2026
82da502
Merge remote-tracking branch 'origin/main' into feat/client-oauth-log…
Dumbris Nov 23, 2026
88bb54d
Merge remote-tracking branch 'origin/feat/client-oauth-login-e2e' int…
Dumbris Nov 23, 2026
34994a6
docs: trim the oldest Recent Changes entries from CLAUDE.md
Dumbris Nov 23, 2026
9811711
Merge remote-tracking branch 'origin/feat/client-oauth-login-e2e' int…
Dumbris Nov 23, 2026
6abbf43
Merge remote-tracking branch 'origin/main' into feat/client-oauth-log…
Dumbris Nov 23, 2026
e44f61b
Merge remote-tracking branch 'origin/feat/client-oauth-login-consent'…
Dumbris Nov 23, 2026
6d31703
test(oauth): run the consent spec in the Web UI sweep (Spec 132 PR-2a)
Dumbris Nov 23, 2026
16a09f5
Merge remote-tracking branch 'origin/feat/client-oauth-login-consent'…
Dumbris Nov 23, 2026
a72e91a
Merge remote-tracking branch 'origin/main' into feat/client-oauth-log…
Dumbris Nov 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/mcpproxy/client_binding_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const adminKeyDocsURL = "https://docs.mcpproxy.app/configuration/config-file"

func addClientBindingCommands(parent *cobra.Command) {
parent.AddCommand(newClientSetProfileCmd(), newClientLockCmd(true), newClientLockCmd(false),
newClientAddCmd(), newClientRotateCmd(), newClientUpgradeAdminKeyHoldersCmd(), newClientForgetCmd())
newClientAddCmd(), newClientRotateCmd(), newClientUpgradeAdminKeyHoldersCmd(), newClientForgetCmd(), newClientRevokeLoginCmd())
}

func clientPath(id string) string { return "/api/v1/clients/" + url.PathEscape(id) }
Expand Down
2 changes: 1 addition & 1 deletion cmd/mcpproxy/client_binding_cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ func TestClientForget_DisconnectAndError(t *testing.T) {

func TestClientCommands_NoDaemonExit1(t *testing.T) {
withNoDaemon(t)
for _, args := range [][]string{{"list"}, {"show", "x"}, {"set-profile", "x", "p"}, {"lock", "x"}, {"add", "x"}, {"rotate", "x"}, {"upgrade-admin-key-holders"}, {"forget", "x"}} {
for _, args := range [][]string{{"list"}, {"show", "x"}, {"set-profile", "x", "p"}, {"lock", "x"}, {"add", "x"}, {"rotate", "x"}, {"upgrade-admin-key-holders"}, {"forget", "x"}, {"revoke-login", "x", "g"}} {
_, _, err := runCLI(t, GetClientCommand, "table", args...)
require.Error(t, err, args)
require.Equal(t, ExitCodeGeneralError, classifyError(err))
Expand Down
9 changes: 8 additions & 1 deletion cmd/mcpproxy/client_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ type clientRow struct {
ProfileMissing bool `json:"profile_missing"`
ExpiresAt *time.Time `json:"expires_at"`
RotationPending bool `json:"rotation_pending"`
Sessions []struct {
// Credentials and BrowserLoginDisabled exist only once browser login was
// used (Spec 132).
Credentials []clientCredentialRow `json:"credentials"`
BrowserLoginDisabled *bool `json:"browser_login_disabled"`
Sessions []struct {
ID string `json:"id"`
WorkSessionID string `json:"work_session_id"`
StartedAt time.Time `json:"started_at"`
Expand Down Expand Up @@ -208,6 +212,9 @@ func runClientShow(_ *cobra.Command, args []string) error {
}
fmt.Printf("Blocked 24h: %d\n", row.Blocked24h)
}
if err := printClientCredentials(row.Credentials, row.BrowserLoginDisabled); err != nil {
return err
}
fmt.Printf("Sessions: %d\n", len(row.Sessions))
if len(row.Sessions) > 0 {
rows := make([][]string, 0, len(row.Sessions))
Expand Down
18 changes: 18 additions & 0 deletions cmd/mcpproxy/client_logins_blank_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package main

import (
"testing"

"github.com/stretchr/testify/require"
)

// Review: a blank client or grant id must never reach the daemon, where a
// trailing slash could be routed to another handler.
func TestClientRevokeLogin_BlankIDsNeverSendARequest(t *testing.T) {
rec := newRESTRecorder(t, map[string]cannedResponse{})
for _, args := range [][]string{{"", "g"}, {"cursor", ""}, {"cursor", " "}, {" ", "g"}} {
_, _, err := runCLI(t, GetClientCommand, "table", append([]string{"revoke-login"}, args...)...)
require.Error(t, err, "%q", args)
}
require.Empty(t, rec.requests)
}
129 changes: 129 additions & 0 deletions cmd/mcpproxy/client_logins_cmd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
package main

// Spec 132 PR-2b: the credentials of a client in `client show`, and
// `client revoke-login`. Both are thin clients of the /clients routes; the
// authorization (administrator only) lives server-side.

import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"strings"
"time"

"github.com/spf13/cobra"
)

// clientCredentialRow is one entry of a client's `credentials` list.
type clientCredentialRow struct {
Kind string `json:"kind"`
Prefix string `json:"prefix"`
GrantID string `json:"grant_id"`
State string `json:"state"`
ExpiresAt *time.Time `json:"expires_at"`
ApprovedAt *time.Time `json:"approved_at"`
LastUsedAt *time.Time `json:"last_used_at"`
ReportedName string `json:"reported_name"`
RedirectHost string `json:"redirect_host"`
ObservedName string `json:"observed_name"`
NameMismatch bool `json:"name_mismatch"`
}

func timeCell(t *time.Time) string {
if t == nil {
return "-"
}
return t.Format(time.RFC3339)
}

// printClientCredentials renders the credentials block of `client show`. It
// prints nothing while the payload has no credentials list, so an install that
// never used browser login shows exactly what it showed before. The reported
// and observed names come from the client, so they are escaped for the
// terminal.
func printClientCredentials(creds []clientCredentialRow, loginDisabled *bool) error {
if creds == nil && loginDisabled == nil {
return nil
}
fmt.Println("Credentials:")
if len(creds) == 0 {
fmt.Println(" none")
} else {
rows := make([][]string, 0, len(creds))
for _, c := range creds {
id := c.GrantID
if id == "" {
id = c.Prefix
}
detail := "-"
if c.Kind == "browser_login" {
detail = fmt.Sprintf("%s via %s", dashCell(sanitizeCell(c.ReportedName, 40)), dashCell(sanitizeCell(c.RedirectHost, 40)))
}
rows = append(rows, []string{c.Kind, sanitizeCell(id, 40), c.State, timeCell(c.ApprovedAt), timeCell(c.LastUsedAt), detail})
}
if err := printTable([]string{"KIND", "ID", "STATE", "APPROVED", "LAST USED", "NAME VIA HOST"}, rows); err != nil {
return err
}
}
for _, c := range creds {
if c.Kind == "browser_login" && c.NameMismatch {
fmt.Printf("Warning: login %s reported the name %q but its client introduced itself as %q\n",
sanitizeCell(c.GrantID, 40), sanitizeCell(c.ReportedName, 60), sanitizeCell(c.ObservedName, 60))
}
}
if loginDisabled != nil && *loginDisabled {
fmt.Println("Browser login: disabled (existing logins are listed; none can sign in)")
}
return nil
}

func dashCell(s string) string {
if s == "" {
return "-"
}
return s
}

func newClientRevokeLoginCmd() *cobra.Command {
return &cobra.Command{
Use: "revoke-login <id> <grant-id>",
Short: "Revoke one browser login of a client",
Long: `Revoke one browser login (a sign-in a person approved on the consent page).
It stops working on its next request. The client's API key, its other logins and
its profile binding stay. Find the grant id with: mcpproxy client show <id>

Examples:
mcpproxy client revoke-login cursor 3f9a1c2e7b44`,
Args: argsOrHelpJSON(cobra.ExactArgs(2)),
RunE: func(_ *cobra.Command, args []string) error {
// A blank id would build a path ending in a slash: refuse it here.
if strings.TrimSpace(args[0]) == "" || strings.TrimSpace(args[1]) == "" {
return flagValidationError{fmt.Errorf("both the client id and the grant id are required")}
}
sess, err := newRESTSession("client")
if err != nil {
return err
}
data, ref, err := sess.call(http.MethodDelete, clientPath(args[0])+"/logins/"+url.PathEscape(args[1]), nil)
if e := clientRefusal(ref, err, args[0], ""); e != nil {
return e
}
if structuredOutput() {
return printData(data)
}
var res struct {
Changed bool `json:"changed"`
}
if err := json.Unmarshal(data, &res); err != nil {
return err
}
if res.Changed {
fmt.Printf("Revoked login %s of %s\n", args[1], args[0])
} else {
fmt.Printf("Login %s of %s was already revoked\n", args[1], args[0])
}
return nil
},
}
}
72 changes: 72 additions & 0 deletions cmd/mcpproxy/client_logins_cmd_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package main

import (
"net/http"
"testing"

"github.com/stretchr/testify/require"
)

// Spec 132 PR-2b (T059): `client show` lists credentials and
// `client revoke-login` revokes one browser login.

const cursorWithLogins = `{"id":"cursor","display_name":"Cursor","kind":"supported","state":"connected_seen","connected":true,"config_path":"/c","display_path":"~/c","active_sessions":0,"calls_24h":0,"blocked_24h":0,"credential_state":"client","token_name":"client-cursor","profile":"dev","profile_mode":"locked","sessions":[],` +
`"credentials":[` +
`{"kind":"api_key","prefix":"mcp_cli_ab12","state":"active","expires_at":"2027-01-01T00:00:00Z","last_used_at":"2026-11-22T10:00:00Z"},` +
`{"kind":"browser_login","grant_id":"grantAAAA","state":"active","approved_at":"2026-11-20T10:00:00Z","last_used_at":"2026-11-22T11:00:00Z","reported_name":"Cursor IDE","redirect_host":"127.0.0.1","observed_name":"cursor-vscode","name_mismatch":true},` +
`{"kind":"browser_login","grant_id":"grantBBBB","state":"lapsed","approved_at":"2026-10-01T10:00:00Z","reported_name":"\u001b[31mEvil","redirect_host":"localhost","name_mismatch":false}` +
`],"browser_login_disabled":true}`

func TestClientShow_ListsCredentials(t *testing.T) {
newRESTRecorder(t, map[string]cannedResponse{"GET /api/v1/clients/cursor": okResp(cursorWithLogins)})
out, _, err := runCLI(t, GetClientCommand, "table", "show", "cursor")
require.NoError(t, err)
require.Contains(t, out, "Credentials:")
require.Contains(t, out, "api_key")
require.Contains(t, out, "mcp_cli_ab12")
require.Contains(t, out, "grantAAAA")
require.Contains(t, out, "lapsed")
require.Contains(t, out, "127.0.0.1")
require.Contains(t, out, "Cursor IDE")
require.Contains(t, out, "Browser login: disabled")
require.Contains(t, out, "cursor-vscode", "the mismatch is spelled out")
require.NotContains(t, out, "\x1b", "an untrusted name never reaches the terminal raw")
}

func TestClientShow_NoCredentialsFieldPrintsNothingNew(t *testing.T) {
newRESTRecorder(t, map[string]cannedResponse{"GET /api/v1/clients/cursor": okResp(cursorRow)})
out, _, err := runCLI(t, GetClientCommand, "table", "show", "cursor")
require.NoError(t, err)
require.NotContains(t, out, "Credentials:")
require.NotContains(t, out, "Browser login")
assertGolden108(t, "client-show.golden", out)
}

func TestClientRevokeLogin_DeletesOneLogin(t *testing.T) {
rec := newRESTRecorder(t, map[string]cannedResponse{"DELETE /api/v1/clients/cursor/logins/grantAAAA": okResp(`{"changed":true}`)})
out, _, err := runCLI(t, GetClientCommand, "table", "revoke-login", "cursor", "grantAAAA")
require.NoError(t, err)
require.Equal(t, http.MethodDelete, rec.only(t).Method)
require.Contains(t, out, "Revoked login grantAAAA")

newRESTRecorder(t, map[string]cannedResponse{"DELETE /api/v1/clients/cursor/logins/grantAAAA": okResp(`{"changed":false}`)})
out, _, err = runCLI(t, GetClientCommand, "table", "revoke-login", "cursor", "grantAAAA")
require.NoError(t, err)
require.Contains(t, out, "already revoked")
}

func TestClientRevokeLogin_UnknownLoginExitsNonZero(t *testing.T) {
newRESTRecorder(t, map[string]cannedResponse{"DELETE /api/v1/clients/cursor/logins/nope": refuse(http.StatusNotFound, `{"success":false,"error":"login not found"}`)})
_, _, err := runCLI(t, GetClientCommand, "table", "revoke-login", "cursor", "nope")
require.Error(t, err)
require.Equal(t, ExitCodeGeneralError, classifyError(err))
}

func TestClientRevokeLogin_NeedsDaemonAndTwoArgs(t *testing.T) {
_, _, err := runCLI(t, GetClientCommand, "table", "revoke-login", "cursor")
require.Error(t, err)
withNoDaemon(t)
_, _, err = runCLI(t, GetClientCommand, "table", "revoke-login", "cursor", "g")
require.Error(t, err)
require.Contains(t, err.Error(), "client requires running daemon")
}
5 changes: 4 additions & 1 deletion docs/api/rest-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1721,7 +1721,10 @@ reference: the Spec 132 contracts.
- `GET /api/v1/clients` and `GET /api/v1/clients/{client}` gain `credentials[]`
(the API key and each browser login: `kind`, `prefix`, `grant_id`, `state`,
times, `reported_name`, `redirect_host`, `observed_name`, `name_mismatch`) and
`browser_login_disabled` once browser login was used.
`browser_login_disabled` once browser login was used. Both reads are
administrator-only (an agent token or client credential gets `403`), so the
reported names and redirect hosts never reach a scoped caller. The strings a
client reported are untrusted text: render them as text.
- `DELETE /api/v1/clients/{client}/logins/{grant_id}` revokes one login (also
while the feature is off after use); `DELETE /api/v1/clients/{client}/api-key`
revokes the API key alone.
Expand Down
1 change: 1 addition & 0 deletions docs/cli/profile-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ A write that would let a client bound to a profile escape it while `require_mcp_
| `client add <id> [--display-name N] [--profile P] [--lock\|--switchable] [--expires-in 90d]` | A custom client (a script, a CI job) with its own credential, printed once with a header snippet |
| `client rotate <id> [--yes]` / `--finalize` | Replace a credential without cutting the client off. A supported client previews the config change and asks to confirm (`--yes` for scripts; a non-interactive run without it exits 1); a custom client gets the new secret once and stays pending until `--finalize` or 24 hours |
| `client upgrade-admin-key-holders [--profile P\|all] [--lock\|--switchable] [--yes]` | Replace the admin API key in every supported client's config with a per-client credential, after a preview. With `--profile` and `require_mcp_auth` off the guard can refuse: the command prints the preview and the refusal, exits 1 and changes nothing. It ends with the step that remains: rotate the admin API key |
| `client revoke-login <id> <grant-id>` | Revoke one [browser login](../features/client-oauth-login.md) of a client; its API key, its other logins and its binding stay. Find the grant id in `client show <id>`, which lists the client's credentials (API key and logins, with state, approval and last use, reported name and redirect host, and a note when the initialize name differs) once browser login was used |
| `client forget <id> [--disconnect]` | Revoke the credential without touching the client's config; with `--disconnect` also remove the config entry of a supported client |

`mcpproxy disconnect <client>` is the reverse of `connect`: it removes the config entry **and revokes the client's credential** (`client-<id>`), so a secret copied out of the config stops authenticating at once. With a running daemon the command calls `DELETE /api/v1/connect/{client}`; without one it revokes over `config.db`. It prints `Credential: revoked (token client-cursor)`, or `Credential: none to revoke` for a client that had none. If the entry was removed but the revoke failed, the command still exits 0, prints `Credential: NOT revoked (...)` and the fix is `mcpproxy client forget <id>`. Undoing a disconnect restores the config file only; the credential stays revoked and a later `connect` mints a new one. The revoked record keeps the client's prior profile pin and mode, so a `connect` that names no profile re-mints with that binding (a profile-locked client is never silently widened to All servers, and the reconnect preview shows it); pass `--profile` to choose a different one. With `require_mcp_auth` off, a named-profile binding is refused by the bypass guard (`binding_bypassable_without_auth`); enable `require_mcp_auth` or choose `--profile all` explicitly. The credential belongs to the client, so `--name <entry>` for a non-default entry revokes it too.
Expand Down
41 changes: 36 additions & 5 deletions docs/features/client-oauth-login.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ keywords: [oauth, browser login, mcp client, pkce, dynamic client registration,

MCPProxy can act as a small OAuth 2.1 authorization server so that an MCP client
that supports OAuth can sign in instead of carrying an API key in its config file.
It is **off by default** and **experimental**: in this release only the backend and
the administrator REST exist. There is no consent page yet, so an administrator
approves each sign-in through the REST API (see [Approving a sign-in](#approving-a-sign-in)).
It is **off by default** and **experimental**. An administrator approves each sign-in on
a consent page or through the REST API (see [Approving a sign-in](#approving-a-sign-in))
and manages the logins in the Clients page, the CLI or the `credentials` MCP tool
(see [Managing logins](#managing-logins)).

What it gives you:

Expand Down Expand Up @@ -119,9 +120,39 @@ handed over. Everything the app reports is shown as plain text.
- Without the admin API key in this browser the page asks you to open the request from the
MCPProxy tray or paste the key, and makes no request until then.

## Seeing and revoking logins
## Managing logins

`GET /api/v1/clients` and `GET /api/v1/clients/<id>` list each login under `credentials`
Everything here is for administrators. An agent token or a client credential cannot see
or revoke a login on any surface.

**Settings.** One switch, "Browser login for MCP clients", marked Experimental, in
Security & Access (the tray Settings window has the same switch). It takes effect without a
restart. While it is off and was never used, no other page mentions browser login.

**Clients page.** Expand a client to see its credentials: the API key and every login, each
with its state (`active`, `lapsed` when the refresh token expired, `revoked`), when it was
approved and last used, the name the app reported and the host it returns to. Those names
come from the app, so they are shown as plain text. A login whose client introduces itself
at `initialize` under a different name than the one it registered shows a "name mismatch"
note; it is advice, never a block. "Revoke login" revokes that one login, "Revoke API key"
revokes the key alone (the logins and the profile binding stay); both ask first. While the
switch is off after use, the page says browser login is disabled and still lists the
logins so they can be revoked.

**CLI.**

```bash
mcpproxy client show cursor # lists the API key and each login
mcpproxy client revoke-login cursor <grant-id>
```

**MCP.** The administrator `credentials` tool lists logins (`list` with `kind=browser_login`,
and they appear under `kind=all`), `get client=<id>` includes them under `logins`, and
`revoke client=<id> grant=<grant_id>` revokes one. `revoke client=<id>` without `grant`
revokes everything under the client. No operation creates a login: only the person on the
consent page can approve one. See [credential lifecycle over MCP](./mcp-credential-lifecycle.md).

**REST.** `GET /api/v1/clients` and `GET /api/v1/clients/<id>` list each login under `credentials`
(`kind: browser_login`, state `active`, `lapsed` or `revoked`, never the token). Revoke one
with `DELETE /api/v1/clients/<id>/logins/<grant_id>`; the next request on that login,
including on an open session, is refused. Forgetting a client removes all its logins.
Expand Down
10 changes: 7 additions & 3 deletions docs/features/mcp-credential-lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,15 @@ Reassigning a worker is the existing `profiles assign client=<id> profile=<other

| Operation | Arguments | Result |
|---|---|---|
| `list` | `kind?` (`client`, `token`, `all`), `profile?`, `state?` (`active`, `expired`, `revoked`, `all`) | `{credentials: [...], total}` |
| `get` | exactly one of `client` or `token` | `{credential, links}` |
| `list` | `kind?` (`client`, `token`, `browser_login`, `all`), `profile?`, `state?` (`active`, `expired`, `lapsed`, `revoked`, `all`) | `{credentials: [...], total}` |
| `get` | exactly one of `client` or `token` | `{credential, links, logins?}` |
| `create_client` | `client`, `profile`, `expires_in`, `mode?` (`locked` default, `switchable`), `display_name?`, `purpose?` | one-time delivery (below) |
| `create_token` | `name`, `profile`, `expires_in`, `purpose?` | one-time delivery (below) |
| `revoke` | exactly one of `client` or `token` | `{credential, changed, client_config_untouched?}` |
| `revoke` | exactly one of `client` or `token`; `grant?` with `client` | `{credential, changed, client_config_untouched?}` |

### Browser logins

When [browser login](./client-oauth-login.md) is in use, `list` also returns each login as a row with `kind: browser_login`, `id` = the grant id, `client`, `state` (`active`, `lapsed` when the refresh token expired, or `revoked`), `reported_name`, `redirect_host`, `observed_name` and `name_mismatch`; never a token or hash. `get client=<id>` adds the client's logins under `logins` when it has any. `revoke client=<id> grant=<grant_id>` revokes that one login (`identity_not_found` for an unknown grant or one that belongs to another client); `grant` needs `client`, and `revoke client=<id>` alone still revokes everything under the client. The tool never creates a login: `create_client` and `create_token` issue API-key credentials only, and a login exists only after a person approves it on the consent page. `reported_name` and the other client-supplied strings are untrusted text.

Every credential the tool issues:

Expand Down
Loading
Loading