Skip to content

Commit d5a2b88

Browse files
authored
Add AI-agent help text to mcp and uv commands (#3545)
* JGC-504 - Add AI-agent help text to mcp and uv commands Complete GetAIDescription() coverage for the umbrella commands that landed after JGC-473 and were still falling back to the short description in AI mode: - mcp install / show / uninstall - uv Each help.go gains a GetAIDescription() following the JGC-473 template (when-to-use / prerequisites / runnable examples / gotchas / related), with examples validated against the commands' real flags. The four call sites in mcp/cli.go and buildtools/cli.go now route Usage/HelpName through corecommon.ResolveDescription so the AI text renders when JFROG_CLI_AI_HELP is truthy or an AI agent is auto-detected. Hidden/deprecated rt-namespace duplicates and unwired doc stubs (per issue #3544) are intentionally left out — their canonical visible commands are already covered, and they are excluded by the JGC-473 skip-hidden policy. * JGC-504 - Add AI help coverage check to static analysis
1 parent 59e741b commit d5a2b88

7 files changed

Lines changed: 105 additions & 8 deletions

File tree

.github/workflows/analysis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ jobs:
5252
- name: Run golangci linter
5353
uses: jfrog/.github/actions/golangci-lint@main
5454

55+
- name: Check AI help coverage
56+
uses: jfrog/.github/actions/ai-help-coverage@main
57+
with:
58+
# Commands still missing AI-oriented help. Remove from this list once a
59+
# GetAIDescription() is added and wired through ResolveDescription.
60+
skip-commands: |
61+
nix
62+
5563
Go-Sec:
5664
name: Go-Sec
5765
runs-on: ubuntu-latest

buildtools/cli.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@ func GetCommands() []cli.Command {
366366
{
367367
Name: "uv",
368368
Flags: cliutils.GetCommandFlags(cliutils.Uv),
369-
Usage: uvcommand.GetDescription(),
370-
HelpName: corecommon.CreateUsage("uv", uvcommand.GetDescription(), uvcommand.Usage),
369+
Usage: corecommon.ResolveDescription(uvcommand.GetDescription(), uvcommand.GetAIDescription()),
370+
HelpName: corecommon.CreateUsage("uv", corecommon.ResolveDescription(uvcommand.GetDescription(), uvcommand.GetAIDescription()), uvcommand.Usage),
371371
UsageText: uvcommand.GetArguments(),
372372
ArgsUsage: common.CreateEnvVars(),
373373
SkipFlagParsing: true,

docs/buildtools/uvcommand/help.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@ func GetDescription() string {
66
return "Run uv command"
77
}
88

9+
func GetAIDescription() string {
10+
return `Run a uv (Python package manager) command through JFrog CLI so dependencies resolve against Artifactory and build-info can be recorded. Arguments are forwarded to the uv binary unchanged; the jf-specific flags are the build-info and server options.
11+
12+
When to use:
13+
- Running 'uv pip install' / 'uv sync' / 'uv add' in a project that resolves through an Artifactory-backed index.
14+
- Capturing build-info for a uv-based Python build by passing --build-name and --build-number.
15+
16+
Prerequisites:
17+
- uv installed and available on PATH.
18+
- A configured JFrog Platform server (jf c add or jf login), or pass --server-id.
19+
20+
Common patterns:
21+
$ jf uv pip install -r requirements.txt
22+
$ jf uv sync --build-name=my-app --build-number=7
23+
$ jf uv add requests --build-name=my-app --build-number=7 --module=api
24+
25+
Gotchas:
26+
- All arguments after the uv sub-command are passed straight to uv (the command uses SkipFlagParsing); only --build-name, --build-number, --module, --project, and --server-id are interpreted by jf.
27+
- Build-info is collected only when --build-name and --build-number are provided; publish it afterwards with 'jf rt build-publish'.
28+
29+
Related: jf rt build-publish, jf pip-install`
30+
}
31+
932
func GetArguments() string {
1033
return ` sub-command
1134
Arguments and options for the uv command.`

docs/mcp/install/help.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,30 @@ func GetDescription() string {
66
return "Configure an AI agent (cursor or claude) to connect to the remote JFrog MCP server."
77
}
88

9+
func GetAIDescription() string {
10+
return `Add the remote JFrog MCP server to an AI agent's configuration so the agent can call JFrog Platform tools. Writes the MCP entry for Cursor or Claude Code; authentication is completed via OAuth in the agent itself, so no credentials are written to the agent config.
11+
12+
When to use:
13+
- Onboarding Cursor or Claude Code to the JFrog Platform MCP integration.
14+
- Adding the MCP server at project scope (default) or user scope (--global).
15+
16+
Prerequisites:
17+
- A configured JFrog Platform server (jf c add or jf login), or pass --server-id / --url.
18+
- The target agent (Cursor or Claude Code) installed locally.
19+
20+
Common patterns:
21+
$ jf mcp install --agent=cursor
22+
$ jf mcp install --agent=claude --global
23+
$ jf mcp install --agent=cursor --dry-run
24+
25+
Gotchas:
26+
- Before writing config, the command verifies the MCP server is reachable; pass --skip-check to bypass that probe.
27+
- After installing, complete the OAuth authorization in the agent (e.g. run /mcp in Claude Code, or approve the server in Cursor) to activate the connection.
28+
- Default scope is the current project; --global writes the user-level agent config instead.
29+
30+
Related: jf mcp show, jf mcp uninstall`
31+
}
32+
933
func GetArguments() string {
1034
return ` EXAMPLES
1135
# Configure Cursor for the current project

docs/mcp/show/help.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,27 @@ func GetDescription() string {
66
return "Print the remote MCP (Model Context Protocol) server endpoint for the configured JFrog Platform."
77
}
88

9+
func GetAIDescription() string {
10+
return `Print the remote MCP (Model Context Protocol) server endpoint for the configured JFrog Platform, derived as <platform-url>/mcp. Use this to discover the URL an AI agent should connect to, or to confirm which platform the MCP integration points at.
11+
12+
When to use:
13+
- Looking up the MCP endpoint to configure an agent manually (rather than via 'jf mcp install').
14+
- Verifying which platform / server the MCP integration resolves to before installing.
15+
16+
Prerequisites:
17+
- A configured JFrog Platform server (jf c add or jf login), or pass --server-id / --url.
18+
19+
Common patterns:
20+
$ jf mcp show
21+
$ jf mcp show --server-id=my-platform --format=json
22+
23+
Gotchas:
24+
- The endpoint defaults to <platform-url>/mcp; override it with --mcp-url or the JFROG_CLI_MCP_URL environment variable.
25+
- This is the remote, platform-hosted MCP server. It is unrelated to 'jf source-mcp', which runs a local MCP server for source-code analysis.
26+
27+
Related: jf mcp install, jf mcp uninstall`
28+
}
29+
930
func GetArguments() string {
1031
return ` EXAMPLES
1132
# Print the MCP endpoint for the default server

docs/mcp/uninstall/help.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,27 @@ func GetDescription() string {
66
return "Remove the JFrog MCP server entry previously added to an AI agent's configuration."
77
}
88

9+
func GetAIDescription() string {
10+
return `Remove the JFrog MCP server entry previously added to an AI agent's configuration (Cursor or Claude Code). Only the JFrog entry is removed; other configured MCP servers are left untouched.
11+
12+
When to use:
13+
- Disconnecting an agent from the JFrog Platform MCP integration.
14+
- Cleaning up before re-installing against a different platform or scope.
15+
16+
Prerequisites:
17+
- The agent (Cursor or Claude Code) with a JFrog MCP entry previously added by 'jf mcp install'.
18+
19+
Common patterns:
20+
$ jf mcp uninstall --agent=cursor
21+
$ jf mcp uninstall --agent=claude --global
22+
23+
Gotchas:
24+
- Match the scope used at install time: a --global install is removed with --global; a project install is removed from the project config.
25+
- If the entry was installed under a non-default name, pass --name to target it.
26+
27+
Related: jf mcp install, jf mcp show`
28+
}
29+
930
func GetArguments() string {
1031
return ` EXAMPLES
1132
# Remove the JFrog MCP server from Cursor (current project)

mcp/cli.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ func GetCommands() []cli.Command {
2525
{
2626
Name: "show",
2727
Flags: cliutils.GetCommandFlags(cliutils.McpShow),
28-
Usage: showDocs.GetDescription(),
29-
HelpName: corecommon.CreateUsage("mcp show", showDocs.GetDescription(), showDocs.Usage),
28+
Usage: corecommon.ResolveDescription(showDocs.GetDescription(), showDocs.GetAIDescription()),
29+
HelpName: corecommon.CreateUsage("mcp show", corecommon.ResolveDescription(showDocs.GetDescription(), showDocs.GetAIDescription()), showDocs.Usage),
3030
UsageText: showDocs.GetArguments(),
3131
ArgsUsage: common.CreateEnvVars(),
3232
BashComplete: corecommon.CreateBashCompletionFunc(),
@@ -35,8 +35,8 @@ func GetCommands() []cli.Command {
3535
{
3636
Name: "install",
3737
Flags: cliutils.GetCommandFlags(cliutils.McpInstall),
38-
Usage: installDocs.GetDescription(),
39-
HelpName: corecommon.CreateUsage("mcp install", installDocs.GetDescription(), installDocs.Usage),
38+
Usage: corecommon.ResolveDescription(installDocs.GetDescription(), installDocs.GetAIDescription()),
39+
HelpName: corecommon.CreateUsage("mcp install", corecommon.ResolveDescription(installDocs.GetDescription(), installDocs.GetAIDescription()), installDocs.Usage),
4040
UsageText: installDocs.GetArguments(),
4141
ArgsUsage: common.CreateEnvVars(),
4242
BashComplete: corecommon.CreateBashCompletionFunc("cursor", "claude"),
@@ -45,8 +45,8 @@ func GetCommands() []cli.Command {
4545
{
4646
Name: "uninstall",
4747
Flags: cliutils.GetCommandFlags(cliutils.McpUninstall),
48-
Usage: uninstallDocs.GetDescription(),
49-
HelpName: corecommon.CreateUsage("mcp uninstall", uninstallDocs.GetDescription(), uninstallDocs.Usage),
48+
Usage: corecommon.ResolveDescription(uninstallDocs.GetDescription(), uninstallDocs.GetAIDescription()),
49+
HelpName: corecommon.CreateUsage("mcp uninstall", corecommon.ResolveDescription(uninstallDocs.GetDescription(), uninstallDocs.GetAIDescription()), uninstallDocs.Usage),
5050
UsageText: uninstallDocs.GetArguments(),
5151
ArgsUsage: common.CreateEnvVars(),
5252
BashComplete: corecommon.CreateBashCompletionFunc("cursor", "claude"),

0 commit comments

Comments
 (0)