@mcpcloud/cli 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -142,7 +142,8 @@ mcpsh servers logs <serverId> [--org <id>] [--limit <n>]
142
142
  ### Tools
143
143
 
144
144
  ```sh
145
- mcpsh tools list <serverId> [--org <id>]
145
+ mcpsh tools list --project <projectId> [--org <id>]
146
+ mcpsh tools list --server <serverId> [--org <id>] # looks up the project for you
146
147
  ```
147
148
 
148
149
  ### Skills
package/dist/index.js CHANGED
@@ -2393,6 +2393,11 @@ function registerProjectCommands(program2) {
2393
2393
  }
2394
2394
 
2395
2395
  // src/commands/servers.ts
2396
+ function formatEventTimestamp(ms) {
2397
+ if (typeof ms !== "number" || !Number.isFinite(ms))
2398
+ return "—".padEnd(24);
2399
+ return new Date(ms).toISOString();
2400
+ }
2396
2401
  function registerServerCommands(program2) {
2397
2402
  const servers = program2.command("servers").description("Manage MCP servers");
2398
2403
  servers.command("list").description("List servers").option("--org <organizationId>", "Organization ID").option("--project <projectId>", "Filter by project ID").option("--limit <n>", "Maximum results (default 25)", parsePositiveIntOption("limit"), "25").action(runAction(async (opts) => {
@@ -2474,20 +2479,33 @@ function registerServerCommands(program2) {
2474
2479
  return;
2475
2480
  }
2476
2481
  for (const event of data.events) {
2477
- const ts = new Date(event.createdAt).toISOString();
2478
- console.log(`${ts} [${event.type}] ${event.message}`);
2482
+ const ts = formatEventTimestamp(event.timestamp);
2483
+ const level = (event.level || "info").toUpperCase().padEnd(5);
2484
+ const stage = (event.stage || "").padEnd(8);
2485
+ console.log(`${ts} ${level} ${stage} ${event.message}`);
2479
2486
  }
2480
2487
  }));
2481
2488
  }
2482
2489
 
2483
2490
  // src/commands/tools.ts
2484
2491
  function registerToolCommands(program2) {
2485
- const tools = program2.command("tools").description("Inspect tools on an MCP server");
2486
- tools.command("list <serverId>").description("List tools for a server").option("--org <organizationId>", "Organization ID").action(runAction(async (serverId, opts) => {
2492
+ const tools = program2.command("tools").description("Inspect tools on a project or server");
2493
+ tools.command("list").description("List tools for a project (or pass --server to look up its project automatically)").option("--org <organizationId>", "Organization ID").option("--project <projectId>", "Project ID to list tools for").option("--server <serverId>", "Server ID — the CLI fetches the server's projectId before listing tools").action(runAction(async (opts) => {
2487
2494
  const orgId = await resolveOrgId(opts.org);
2495
+ if (!opts.project && !opts.server) {
2496
+ throw new Error("Pass either --project <projectId> or --server <serverId>.");
2497
+ }
2498
+ let projectId = opts.project;
2499
+ if (!projectId && opts.server) {
2500
+ const serverData = await api.get("/api/v1/server", {
2501
+ organizationId: orgId,
2502
+ serverId: opts.server
2503
+ });
2504
+ projectId = serverData.server.projectId;
2505
+ }
2488
2506
  const data = await api.get("/api/v1/project/tools", {
2489
2507
  organizationId: orgId,
2490
- serverId
2508
+ projectId
2491
2509
  });
2492
2510
  if (isJsonMode()) {
2493
2511
  printJson(data);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcpcloud/cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "The official CLI for MCPCloud — manage projects, servers, skills, and API keys from the terminal",
5
5
  "type": "module",
6
6
  "bin": {