fix(mcp): read version from package.json instead of hardcoding#1270
Open
webdevpraveen wants to merge 1 commit intoruvnet:mainfrom
Open
fix(mcp): read version from package.json instead of hardcoding#1270webdevpraveen wants to merge 1 commit intoruvnet:mainfrom
webdevpraveen wants to merge 1 commit intoruvnet:mainfrom
Conversation
system_status and system_info tools return a hardcoded '3.0.0-alpha' version string, but the actual npm package is v3.5.2. This causes confusion when users check the running server version against the installed package version. Replace the hardcoded string with a getPackageVersion() helper that reads the version field from the root package.json at runtime. Falls back to 'unknown' if the file cannot be read. Fixes ruvnet#1253
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the hardcoded '3.0.0-alpha' version string in
system_statusandsystem_infoMCP tools with a dynamic read frompackage.json
Problem
The
system_statusandsystem_infotools both returnversion: '3.0.0-alpha', but the actual installed npm package isv3.5.2. This causes confusion when users check the running server version against the installed package:Fix
Added a
getPackageVersion()helper that reads theversionfield from the rootpackage.json at runtime. Falls back to
'unknown'if the file cannot be read. Both hardcoded occurrences (lines 97 and 291) are replaced with calls to this helper.File changed: v3/@claude-flow/cli/src/mcp-tools/system-tools.ts
Why this is safe
readFileSyncandexistsSyncthat are already imported in the file.process.cwd()which is standard for CLI tools and matches how the rest of the system resolves project-relative paths (e.g., getSystemDir() on line 34).'unknown'- no crash if package.json is missing.Fixes Issue #1253