Skip to content

feat(cli): mcpjam projects commands for hosted projects#2592

Merged
chelojimenez merged 4 commits into
mainfrom
claude/brave-archimedes-5f32wy-cloud
Jun 11, 2026
Merged

feat(cli): mcpjam projects commands for hosted projects#2592
chelojimenez merged 4 commits into
mainfrom
claude/brave-archimedes-5f32wy-cloud

Conversation

@chelojimenez

@chelojimenez chelojimenez commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

PR 3 of 3 (depends on #2589 and #2591 — based on the #2591 branch).

Adds the mcpjam projects command group, connecting the CLI to hosted MCPJam projects via the shared platform operations from #2589 and the credentials from #2591:

mcpjam projects list
mcpjam projects servers --project <id-or-name>
mcpjam projects status  --project <id-or-name>
  • status runs the same show_servers operation the MCP worker exposes — project resolution by id/name/most-recent, one hosted doctor call per server at concurrency 3 — so the widget, the MCP tool, and the CLI report identical statuses from one implementation.
  • JSON output (default when piped) is the operation payload verbatim, for CI scripting; human output renders aligned tables, per-server status lines (//-/!) with details and primitive counts, a summary line, and other-project hints.
  • Exit code stays 0 even with unreachable servers — it's a status report, not an assertion; CI gating can parse summary from the JSON payload.
  • Credentials: --api-key > MCPJAM_API_KEY > stored mcpjam login session; unknown/ambiguous --project surfaces the operation's actionable NOT_FOUND message (with the available-project list) as the CLI error.
  • Naming: the group is projects (not cloud) — "projects" only exist on the platform so the word carries the hosted context by itself, and a top-level servers group would near-collide with the local mcpjam server commands.

Testing

cli/tests/projects.test.ts — in-process fixture serving /projects, /projects/:id/servers, and per-server /doctor (ready / OAUTH_REQUIRED envelope / 429 + Retry-After): JSON and human output for all three commands, bearer forwarding, project-by-name resolution, NOT_FOUND mapping, and the full status matrix (reachable/reachable (OAuth)/error (rate-limited, Retry after 7s)/skipped (stdio)) with summary counts.

Full CLI suite green: 233 tests, tsc --noEmit clean.

Changeset: @mcpjam/cli minor.

https://claude.ai/code/session_011awqJ5nNBHYGdN9qKF7CNy


Generated by Claude Code

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 11, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@dosubot dosubot Bot added the enhancement New feature or request label Jun 11, 2026
@chelojimenez

chelojimenez commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Comment thread cli/src/commands/cloud.ts Outdated
@chelojimenez chelojimenez force-pushed the claude/brave-archimedes-5f32wy-cli-auth branch from 7347237 to cb104c6 Compare June 11, 2026 06:06
@chelojimenez chelojimenez force-pushed the claude/brave-archimedes-5f32wy-cloud branch from 5daadd6 to afe8f4b Compare June 11, 2026 06:06
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Internal preview

Preview URL: https://mcp-inspector-pr-2592.up.railway.app
Deployed commit: 7f2f52e
PR head commit: 7c0d054
Backend target: staging fallback.
Health: ✅ Convex reachable
Access is employee-only in non-production environments.

Base automatically changed from claude/brave-archimedes-5f32wy-cli-auth to main June 11, 2026 07:01
@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jun 11, 2026
Add the cloud command group on top of the shared platform operations:

  mcpjam cloud projects list
  mcpjam cloud servers list --project <id-or-name>
  mcpjam cloud servers status --project <id-or-name>

status runs the same show_servers operation the MCP worker exposes —
project resolution by id/name/latest, one hosted doctor call per
server — so all surfaces report identical statuses. JSON output is
the operation payload verbatim for scripting; human output renders
aligned tables, per-server status lines with details, and a summary.
Exit code stays 0 for unreachable servers: it is a status report, not
an assertion. Credentials follow the established precedence
(--api-key > MCPJAM_API_KEY > stored login).

https://claude.ai/code/session_011awqJ5nNBHYGdN9qKF7CNy
@chelojimenez chelojimenez force-pushed the claude/brave-archimedes-5f32wy-cloud branch from afe8f4b to bd47013 Compare June 11, 2026 07:09
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Jun 11, 2026
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 366f0804-2b5e-446e-8d3e-129dadd4f6b0

📥 Commits

Reviewing files that changed from the base of the PR and between fb3ea28 and 7c0d054.

📒 Files selected for processing (7)
  • .changeset/cli-platform-login.md
  • .changeset/cli-projects-commands.md
  • cli/src/commands/projects.ts
  • cli/src/index.ts
  • cli/src/lib/platform-auth.ts
  • cli/src/lib/projects-render.ts
  • cli/tests/projects.test.ts
💤 Files with no reviewable changes (1)
  • cli/src/lib/projects-render.ts
✅ Files skipped from review due to trivial changes (3)
  • .changeset/cli-projects-commands.md
  • .changeset/cli-platform-login.md
  • cli/src/lib/platform-auth.ts

Walkthrough

This PR adds a projects command suite to the MCPJam CLI for querying hosted projects and their servers. It extends PlatformClientOptions with an optional timeoutMs parameter that flows through to PlatformApiClient, enabling timeout enforcement. The new registerProjectsCommands function wires three subcommands—list, servers, and status—via a shared runPlatformCommand helper that uses AbortController to enforce timeouts and maps abort signals to CLI timeout errors. Human output is rendered through specialized formatters that produce aligned tables and status glyphs; machine formats pass results verbatim through writeResult. Integration tests exercise the commands against an in-process HTTP fixture server with simulated platform endpoints and configurable delays, validating timeout behavior, error handling, and output consistency. Terminology in platform-auth is updated from "cloud commands" to "platform commands" for consistency. Two Changesets document the new projects commands and the separate OAuth login feature.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Propagate the global timeout into hosted cloud operations so slow platform calls abort consistently.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0ec481f. Configure here.

Comment thread cli/src/commands/projects.ts
…cts page through verbatim

The command-level deadline in runCloudCommand arms its AbortController
with a PlatformApiError(TIMEOUT), but depending on the fetch
implementation the rejection can be a bare AbortError that maps to
INTERNAL_ERROR. When our controller fired, throw its armed reason —
covered by a test where each request stays under the per-request
budget but the overall deadline trips mid-operation (Bugbot).

cloud projects list now emits the operation payload verbatim in JSON
mode, preserving pagination fields like nextCursor, matching the
sibling commands and the MCP tool (Bugbot).

https://claude.ai/code/session_011awqJ5nNBHYGdN9qKF7CNy

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cli/src/commands/cloud.ts`:
- Around line 40-61: The catch currently loses the custom timeout reason because
fetch throws a generic AbortError; update the catch in the function wrapping
execute/buildPlatformClient to inspect controller.signal.reason and, if it is a
PlatformApiError (or has code "TIMEOUT"), pass that structured error into
toCliError/throw instead of the generic caught error—i.e., check
controller.signal?.reason (and its instance/type or code), use that as the error
to convert with toCliError, otherwise fall back to toCliError(error); reference
the existing symbols controller, controller.signal.reason, PlatformApiError,
toCliError, execute, and buildPlatformClient to locate where to apply this
change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2bb347d6-98bb-498e-b245-4cd656e9dd4c

📥 Commits

Reviewing files that changed from the base of the PR and between bd47013 and 0ec481f.

📒 Files selected for processing (3)
  • cli/src/commands/cloud.ts
  • cli/src/lib/platform-client.ts
  • cli/tests/cloud.test.ts

Comment thread cli/src/commands/projects.ts
mcpjam cloud projects list        -> mcpjam projects list
mcpjam cloud servers list/status  -> mcpjam projects servers / status

"projects" carries the hosted-platform context on its own and avoids the
near-collision with the local `mcpjam server` group that a top-level
`servers` would create. Internal helpers renamed cloud->platform to match
platform-client/platform-auth.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@chelojimenez chelojimenez changed the title feat(cli): mcpjam cloud commands for hosted projects feat(cli): mcpjam projects commands for hosted projects Jun 11, 2026
@chelojimenez chelojimenez merged commit e69da62 into main Jun 11, 2026
12 checks passed
@chelojimenez chelojimenez deleted the claude/brave-archimedes-5f32wy-cloud branch June 11, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants