Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/cli/src/commands/packages/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import type { CacheMetadata } from "../../utils/cache.js";
import { ConfigManager } from "../../utils/config-manager.js";

export interface RunOptions {
update?: boolean;
noCache?: boolean;
local?: string; // Path to local .mcpb file
}

Expand Down Expand Up @@ -367,7 +367,7 @@ export async function handleRun(

cacheDir = getLocalCacheDir(bundlePath);
const needsExtract =
options.update ||
options.noCache ||
localBundleNeedsExtract(bundlePath, cacheDir);

if (needsExtract) {
Expand Down Expand Up @@ -407,12 +407,12 @@ export async function handleRun(
cachedMeta = getCacheMetadata(cacheDir);

// Check if we have a cached version
if (cachedMeta && !options.update) {
if (cachedMeta && !options.noCache) {
if (requestedVersion) {
// Specific version requested - check if cached version matches
needsPull = !isSemverEqual(cachedMeta.version, requestedVersion);
} else {
// Latest requested - use cache (user can --update to refresh)
// Latest requested - use cache (user can --no-cache to refresh)
needsPull = false;
}
}
Expand All @@ -424,7 +424,7 @@ export async function handleRun(
if (
cachedMeta &&
isSemverEqual(cachedMeta.version, downloadInfo.bundle.version) &&
!options.update
!options.noCache
) {
needsPull = false;
}
Expand Down
6 changes: 4 additions & 2 deletions packages/cli/src/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ export function createProgram(): Command {
program
.command("run [package]")
.description('Run an MCP server (alias for "bundle run")')
.option("--update", "Force re-download even if cached")
.option("--no-cache", "Always re-extract, skip cache")
.option("-l, --local <path>", "Run a local .mcpb bundle file")
.action(async (packageSpec, options) => {
options.noCache = options.cache === false;
await handleRun(packageSpec || "", options);
});

Expand Down Expand Up @@ -130,9 +131,10 @@ export function createProgram(): Command {
bundle
.command("run [package]")
.description("Run an MCP server from the registry")
.option("--update", "Force re-download even if cached")
.option("--no-cache", "Always re-extract, skip cache")
.option("-l, --local <path>", "Run a local .mcpb bundle file")
.action(async (packageSpec, options) => {
options.noCache = options.cache === false;
await handleRun(packageSpec || "", options);
});

Expand Down
Loading