fix: sync server version from package.json; correct tool count in docs#19
Merged
Conversation
The server advertised a hardcoded version '0.2.0' while package.json was at 0.3.0 — the literal had drifted and would drift again on every release. Read the version from package.json at startup (via the same ESM __dirname pattern loader.ts uses) so there is one source of truth. Resolves to the package root in dev, compiled (dist/), and installed-as-dependency layouts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
architecture.md said ds-mcp serves "nine lookup tools", but eleven tools are registered — the nine lookup tools plus the two generation tools (get-generation-context, validate-ui) added since. Match the README's "eleven read-only tools" count and name the two additions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses two audit findings: eliminating version drift by sourcing the MCP server version from package.json, and correcting the documented tool count to match the actual registered tools.
Changes:
- Read the server version from
package.jsoninstead of using a hardcoded literal increateServer. - Update architecture documentation to reflect 11 registered read-only tools (9 lookup + 2 additional tools).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/server.ts | Removes hardcoded server version and derives it from package.json at runtime. |
| docs/architecture.md | Updates the stated tool count and enumerates the two additional tools. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+19
to
+23
| const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
| // Single source of truth for the server version: package.json at the package root. | ||
| const { version: SERVER_VERSION } = JSON.parse( | ||
| readFileSync(join(__dirname, '..', 'package.json'), 'utf-8'), | ||
| ) as { version: string }; |
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.
Two independent commits — the two in-passing items flagged during the version-drift audit.
1. Server version drifted (
src/server.ts:28)The MCP server advertised a hardcoded
version: '0.2.0'whilepackage.jsonis0.3.0. Rather than bump the literal (which would drift again next release), read the version frompackage.jsonat startup using the same ESM__dirnamepatternloader.tsuses. Verified it resolves to the package root in dev (vitest), compiled (dist/), and installed-as-dependency layouts.2. Stale tool count (
docs/architecture.md:16)The doc said ds-mcp serves "nine lookup tools", but eleven are registered — the nine lookup tools plus
get-generation-contextandvalidate-ui. Now reads "eleven read-only tools (nine lookup tools plus …)", matching the README's canonical count.Verification
npm run build(tsc) clean; runtime check confirms the server reports0.3.0.npm test— 93/93 pass.registerToolcalls (9 lookup + 2 generation).🤖 Generated with Claude Code