Skip to content

CLI args are not handled for protocol builds #2623

@danbarr

Description

@danbarr

Bug description

When using protocol builds, CLI arguments added to a thv run command using -- <args> are not passed into the resulting MCP server container/entrypoint in any way.

The generated Dockerfile contains an entrypoint.sh but there's nothing actually passing CLI args from the container layer down into the entrypoint, so they aren't appended.

Steps to reproduce

This was discovered because the LaunchDarkly MCP server built in Dockyard, which uses the same protocol code to generate Dockerfiles, requires a start argument to run. But passing this arg still does not allow it to run.

thv run launchdarkly

# The container goes into an error loop, outputting its usage instructions

thv run launchdarkly -- start

# Same result - the start command is not sent through to the `npx` command
# But this works:

npx @launchdarkly/mcp-server start

We can demonstrate this with the Context7 server too:

# This correctly throws an error:
npx @upstash/context7-mcp --transport faketransport

# Output: Invalid --transport value: 'faketransport'. Must be one of: stdio, http.

# So this should also throw the same error:
thv run npx://npx://@upstash/context7-mcp@latest -- --transport faketransport

# But it doesn't:
thv logs upstash-context7-mcp-latest

# Output: Context7 Documentation MCP Server running on stdio ...

Expected behavior

CLI args should be appended to the command in the entrypoint script.

Actual behavior

CLI args are not passed through, meaning any MCP server that relies on CLI args cannot be run using protocol handlers or via Dockard.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcliChanges that impact CLI functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions