Repository navigation
feat(connect): per-client credentials, bindings service and connect guard (Spec 108-c2) - #1430
Merged
Merged
Conversation
…e activity type (Spec 108-c2)
…ntity and connect credentials (Spec 108-c2)
…in key (Spec 108-c2)
…t credentials (Spec 108-c2)
…binding guard runtime rows (Spec 108-c2)
…dentials in connect (Spec 108-c2)
…; keep tests build-tag clean (Spec 108-c2)
… tests build-tag clean (Spec 108-c2)
Deploying mcpproxy-docs with
|
| Latest commit: |
4cef4a8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://24033bad.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://108-c2-client-credential-bin.mcpproxy-docs.pages.dev |
luna:3.1 (medium, confirmed): a reconnect of an EXPIRED kind=client credential with no explicit profile/mode fell into the fresh-mint branch and silently re-minted a locked client as All servers/switchable. issueLocked now keeps the recorded binding for expired credentials as well as active ones. A revoked credential was cut off deliberately, so it still restarts at the defaults; documented in rest-api.md. Test added first (failed before the fix).
Contributor
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 36714905059 --repo smart-mcp-proxy/mcpproxy-go
|
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
… approve-block settle window
…d discovery per poll; give unix unit tests a 20m timeout
…sted profile A binding request for a client with no active credential that names an unknown profile now returns 409 no_client_credential instead of 400 unknown profile.
5 tasks
This was referenced Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second half of PR 108-c of Spec 108 (
specs/108-profiles-v3): connect stops writing the instance admin API key, every client gets its ownmcp_cli_credential bound to a profile, and that binding can be reassigned server-side without touching the client's config.This fixes UX-audit finding P4 (backend): before this change every connected client held either no credential or the admin key that opens the whole REST API, so Cursor's calls could not be told from Codex's and a client could not be bound to a profile.
Security-sensitive: everything here fails closed. A named binding that could be escaped by omitting the credential while
require_mcp_authis off is refused on every path that could create it.User-visible changes per surface
Core and REST
POST /api/v1/connect/{client}mints a per-client credential (mcp_cli_...) instead of embedding the admin key, in both auth modes. The body acceptsprofile,modeandkeyless; the result reports the masked credential, token name, binding and, for a reconnect over an active credential,rotation: finalized. A reconnect over an active credential is a staged rotation, so the old secret keeps working until the new config has been written. A request withoutprofilemeans All servers for a fresh credential and keeps the existing binding on a reconnect, so a plain reconnect never silently widens a locked client.GET /api/v1/connect/{client}/previewmasks the credential asmcp_cli_••••and echoes the requested intent;contains_api_keyis now alwaysfalse. The precondition token binds the intent and the auth toggle through a fixed placeholder, so the real secret never enters the digest.GET /api/v1/connect/{client}classifies what a client's entry carries (client,admin_key,none,revoked,expired); the stat-only listing reportsunknownbecause it never reads a config. Both stay administrator-only.POST /api/v1/connect/{client}/undois now "as if the connect never happened": the credential the connect minted is revoked unless the restored config still holds it (credential_revoked).PUT /api/v1/clients/{client}/binding(personal edition only) reassigns profile and/or mode for a client with an active credential. It clears the storedset_profileselection of every live session of that credential, sendsnotifications/tools/list_changedto each on the server instance that serves it, publishes the administrator-onlyclient.binding_changedevent and writes oneprofile_changeactivity record. A client without an active credential is refused with409 no_client_credential; nothing is ever minted implicitly.PATCH /config,POST /config/applyandPATCH /config/docker-isolation(all funnelled throughServer.ApplyConfig), connect and the binding route now answer409 binding_bypassable_without_authwith the bindings and fixes when the candidate state would leave a named binding bypassable, and write nothing. The check and the write run under one mutex, so two individually safe concurrent writes cannot combine into a bypassable state. Hand edits are still covered by the existing runtime anonymous guard.409withconflicting_tokenwhenclient-<id>is held by a regular agent token;400 {error, field}for an unknown profile, bad mode or keyless misuse.profile_changeactivity type (contract enums, TypeScript labels and macOS filter list updated) with actor kind, actor name and surface (X-MCPProxy-Surface, or derived fromX-MCPProxy-Client).MCP
CLI
mcpproxy connectgains--profile <name|all>,--lock,--switchableand--keyless, applies to--alltoo, and printsCredential: mcp_cli_•••• (token client-cursor, profile ro, locked)between the result line and the existingConfig:andNext:lines. With a daemon it goes through the daemon; without one it runs the same service locally with the strictest guard. A guard refusal prints the refusal text and aFixes:list and exits 1.Web UI and macOS
contains_api_keyis now false; the profile picker and updated credential copy land with 108-i and 108-k. TypeScript types gain the additive fields, and the macOS activity-type filter list gainsprofile_change.Audit findings fixed
P4 (backend): connect no longer writes the admin key on any surface.
Spec
specs/108-profiles-v3: decisions D1 to D26 recorded in spec.md, data-model.md, contracts and quickstart; tasks T027a, T028a, T029, T030a, T030b, T031, T032, T033, T033a, T035, T036, T038, T039, T040, T040a, T041 and T043 marked done; T042 removed from this phase and split into T042w (Web, 108-i) and T042m (macOS, 108-k). 108-d merged before this PR, so the FR-009a gate is open and the guard offers both fixes.Tests added
Server.ApplyConfig, runtime guard end to end, concurrent config and binding writes under-race.tools/list_changedfan-out; resolver cycle and reassignment rows; anonymous confinement gaps./mcpand REST, and the rollback test against frozen pre-108 middleware branches.Notes for reviewers
Runtime.LockBindingWritesis held across guard check and write; it is never held across a client config write (connect mints, releases, writes the file, then commits or aborts).require_mcp_authis off; it is only ever stricter than the daemon.