Public repository URL
https://github.com/tavily-ai/tavily-mcp
Upstream issue URL, if any
No separate upstream issue found. Upstream fix PR: tavily-ai/tavily-mcp#175
Bug or task summary
The published tavily-mcp@0.2.20 package exposes the tavily-mcp bin, but its top-level version flag returns unusable metadata:
tavily-mcp --version exits 0 and prints unknown.
tavily-mcp --help exits 0 and prints normal help.
Expected behavior: --version should print the installed package version. This makes npm metadata checks, CI smoke tests, and agent setup probes able to identify the installed package.
Root cause: the published bin runs through npm's .bin symlink path, and yargs cannot infer the package version in that installed-package execution path. The PR resolves the real entrypoint path, walks up to the installed package.json, binds that version explicitly, reuses the value for MCP server metadata, and adds a packed-tarball test that runs through npm exec.
Exact reproduction commands
npm exec --yes --package=tavily-mcp@0.2.20 -- tavily-mcp --version
npm exec --yes --package=tavily-mcp@0.2.20 -- tavily-mcp --help
Observed before the patch:
tavily-mcp --version
unknown
tavily-mcp --help
Options:
--version Show version number
--list-tools List all available tools and exit
--help Show help
File/function/test pointers
src/index.ts: resolves the real bin entrypoint, walks up to package.json, passes that value to yargs .version(...), and uses it for MCP server metadata.
tests/cli-metadata.test.mjs: builds the package, creates a tarball with npm pack, and runs npm exec --package=<tarball> -- tavily-mcp --version so the test covers the published-package path.
package.json: adds npm test.
Verification after patch
Run in the upstream checkout:
npm test
npm pack --pack-destination /tmp
npm exec --yes --package=/tmp/tavily-mcp-0.2.20.tgz -- tavily-mcp --version
npm exec --yes --package=/tmp/tavily-mcp-0.2.20.tgz -- tavily-mcp --help
git diff --check
Results:
- Red test first: packed tarball test failed before implementation with
unknown !== 0.2.20.
- Node test suite: 2 passed.
- Local tarball smoke: installed tarball prints
0.2.20 for --version.
- Local tarball help smoke: exits 0 and prints yargs help.
- Diff check: passed.
Duplicate or active-work check
Rule check
Payout details can be provided privately after selection.
Public repository URL
https://github.com/tavily-ai/tavily-mcp
Upstream issue URL, if any
No separate upstream issue found. Upstream fix PR: tavily-ai/tavily-mcp#175
Bug or task summary
The published
tavily-mcp@0.2.20package exposes thetavily-mcpbin, but its top-level version flag returns unusable metadata:tavily-mcp --versionexits 0 and printsunknown.tavily-mcp --helpexits 0 and prints normal help.Expected behavior:
--versionshould print the installed package version. This makes npm metadata checks, CI smoke tests, and agent setup probes able to identify the installed package.Root cause: the published bin runs through npm's
.binsymlink path, and yargs cannot infer the package version in that installed-package execution path. The PR resolves the real entrypoint path, walks up to the installed package.json, binds that version explicitly, reuses the value for MCP server metadata, and adds a packed-tarball test that runs through npm exec.Exact reproduction commands
Observed before the patch:
File/function/test pointers
src/index.ts: resolves the real bin entrypoint, walks up to package.json, passes that value to yargs.version(...), and uses it for MCP server metadata.tests/cli-metadata.test.mjs: builds the package, creates a tarball withnpm pack, and runsnpm exec --package=<tarball> -- tavily-mcp --versionso the test covers the published-package path.package.json: addsnpm test.Verification after patch
Run in the upstream checkout:
Results:
unknown !== 0.2.20.0.2.20for--version.Duplicate or active-work check
gh issue list --repo charles-openclaw/charles-microbounties --state all --search "tavily OR tavily-mcp"returned no existing issue before submission.gh pr list --repo tavily-ai/tavily-mcp --state all --search "version OR metadata OR --version OR unknown"returned no same-scope open PR before this PR.--versionpath still printsunknown.Rule check
Payout details can be provided privately after selection.