Repository navigation
feat(cli): profile, client binding and access explain commands (Spec 108-g) - #1441
Merged
Merged
Conversation
… and show (Spec 108-g)
…ommands (Spec 108-g)
…show (Spec 108-g)
…lients warnings (Spec 108-g)
Deploying mcpproxy-docs with
|
| Latest commit: |
d57f8b6
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://23b6d2d7.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://108-g-cli-profiles-clients.mcpproxy-docs.pages.dev |
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Contributor
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 36780094243 --repo smart-mcp-proxy/mcpproxy-go
|
12 tasks
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.
Spec 108 (Profiles v3), PR 108-g: the command line for profiles, client bindings and access explain. Spec:
specs/108-profiles-v3(FR-005 stale-classification report, FR-008a guard exit and fixes, FR-021/021a/025/026/036, US4, US5-4, parity rows 1-5, 7-9, 11-14, 21, 23 and 24, CLI column). Audit findings addressed on the CLI surface: P2 (profiles manageable only in the config file), P3 (tool tier, unannotated handling and code execution on a profile), P4 (per-client identity and binding), P5 (why a tool is visible or hidden, and where a profile comes from) and P7 (tokens duplicating profiles).What changes for users
CLI (this PR adds no REST route, MCP tool, Go enum, Web UI or macOS change; 108-h, 108-i and 108-k carry those)
mcpproxy profile list|show|create|update|rename|delete|classify|try|anonymous.showprints every policy field with where its effective value comes from ("off (default under max tier read)", "on (inherited)");show --effectivelists every tool with callable, visible or hidden and the reason, and flags a classification that no longer applies ("classification ignored - tool is now annotated").trypreviews a draft profile (saved or brand new) against a query with--set key=valueoverrides and saves nothing.updateis a read-modify-write of the stored fields.deleteof a profile in use exits 1 and prints who uses it; the anonymous profile can only be deleted with--reassign-to. Enum inputas-writeandas-readis accepted and always stored asas_writeandas_read.mcpproxy client set-profile|lock|unlock|add|rotate|upgrade-admin-key-holders|forget. Without--lock/--switchablethe current mode is kept;allmeans All servers; the bulk form is--from-profile/--to-profile(skipped clients print to stderr, exit 0).addand a customrotateprint the new credential once with a header snippet. A supported-clientrotatepreviews the config change and asks to confirm (--yes; non-interactive without it exits 1 and sends nothing).upgrade-admin-key-holderspreviews, exits 1 without applying when the FR-008a guard would refuse, and ends with the remaining admin-key rotation step. A client without a client credential exits 1 withmcpproxy connect <id> --profile <p>.client listkeeps Spec 109's columns (including CONFIG PATH) and appendsCREDENTIAL PROFILE MODE SOURCE BLOCKED 24H;--profileand--clientfilter.client showadds the credential and binding lines and PROFILE/SOURCE session columns. Warnings print to stderr in table mode with the command that fixes them.mcpproxy access explain --tool <server:tool>with exactly one of--client,--token,--profile,--anonymous: the ordered chain, the verdict (exit 0 whenever an explanation is produced) and the fixes with the command that performs each.token create --profile <p>(scope comes from the profile;--servers/--permissionsoptional;--profile-pinstays as a hidden deprecated alias with a notice; legacy flags print a hint).token listcolumns are nowNAME PREFIX KIND CLIENT PROFILE MODE SERVERS PERMISSIONS LEGACY SCOPE REVOKED EXPIRESwith--profileand--tokenfilters;token list|showhonour-o json|yaml.mcpproxy doctorgains a "Profiles & clients" section and the additive JSON keyprofile_checks:profiles.binding_bypassandconnect.admin_key_in_client_config, both derived only from theGET /api/v1/clientswarnings (the same evaluator as the API refusal), so doctor never reads a client config. A daemon without/clientsreports them as skipped.connect's guard refusal now namesmcpproxy profile anonymous <p>instead of the config key.dataobject for-o json|yaml, and appear in--help-json.Tests
profile_cmd_test.go,client_binding_cmd_test.go,access_cmd_test.go,token_cmd_profile_test.go,doctor_profiles_test.go,daemon_rest_test.go,help_json_108_test.go(recording fake daemon: each test asserts the request the CLI sends and what it prints), andinternal/server/binding_guard_doctor_pair_v3_test.go(pins the doctor scenario pair against the one guard evaluator and the clients warning; it pins existing behaviour, so it is green on the base).testdata/cli109/client-list.golden,client-show.goldenandclient-list-help-json.golden(appended columns and new flags only; the first six client list columns are byte-identical, asserted by a test); newtestdata/cli108/*.TestConnectProfileFlags_DaemonGuardRefusalPrintsBothFixesAndExits1(new fix wording),TestRunTokenList_TableOutputandTestTokenCreateCmd_RequiredFlags(new columns and rules).cmd/mcpproxytest files reference commands that do not exist on the merge base, so that package does not compile there; that is the red state.Docs and spec
docs/cli-management-commands.md(profile, client, access explain, token, doctor) anddocs/features/agent-tokens.md; spec edits limited to Phase 8 oftasks.md(T078-T085 ticked),contracts/cli.md, the FR-036 line ofspec.md, the 108-g row ofquickstart.mdand research entry D33;ROADMAP.mdregenerated.Notes and follow-ups
profile update,profile classifyandclient lock|unlockare read-modify-write over REST, which has no ETag: a concurrent edit in the one-round-trip window is lost. Follow-up:If-MatchonPUT /profiles/{name}.allalways means All servers; a profile literally namedallcan still be assigned via REST, Web or macOS. Follow-up for the REST validator owner: reserveallnext toactiveandtry.client upgrade-admin-key-holdersalso exits 1 when some client could not be upgraded after printing the Failed list.