Skip to content

fix(filesystem): read server version from package.json - #4578

Open
cyforkk wants to merge 2 commits into
modelcontextprotocol:mainfrom
cyforkk:fix/filesystem-package-version
Open

fix(filesystem): read server version from package.json#4578
cyforkk wants to merge 2 commits into
modelcontextprotocol:mainfrom
cyforkk:fix/filesystem-package-version

Conversation

@cyforkk

@cyforkk cyforkk commented Jul 29, 2026

Copy link
Copy Markdown

Description

Related: #360

The serverInfo.version returned during MCP initialization was hardcoded as "0.2.0" while package.json reports "0.6.3". This causes confusion when diagnosing client/server issues — the reported version looks like a very old release.

This PR reads the version at runtime from package.json, matching the approach used for the sequentialthinking server (PR #4576).

Changes

  • src/filesystem/version.ts (new): resolvePackageVersion() that works from both source and dist/ layouts
  • src/filesystem/index.ts: import SERVER_VERSION from version.js, replace hardcoded "0.2.0"
  • src/filesystem/__tests__/server-version.test.ts (new): asserts version matches package.json, plus stdio smoke test (skipped when dist/ is absent)

Checklist

Co-Authored-By: Claude Fable 5 noreply@anthropic.com

cyforkk and others added 2 commits July 29, 2026 20:49
mcp 2.0.0 renamed McpError to MCPError, breaking imports in
servers with no upper bound. Cap mcp to <2 in all three Python
servers (time, fetch, git) and regenerate lockfiles with the
default PyPI index.

Closes modelcontextprotocol#4560, modelcontextprotocol#4570

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The serverInfo.version was hardcoded as "0.2.0" while package.json
reports "0.6.3". Read the version at runtime so it stays in sync
with the published package, matching the approach used for
sequentialthinking (PR modelcontextprotocol#4576).

Related: modelcontextprotocol#360

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Ecocitizenz

Ecocitizenz commented Jul 29, 2026 via email

Copy link
Copy Markdown

@Ecocitizenz

Ecocitizenz commented Jul 29, 2026 via email

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants