Skip to content

fix: sync server version from package.json; correct tool count in docs#19

Merged
ryandmonk merged 2 commits into
mainfrom
fix/server-version-and-tool-count
Jul 6, 2026
Merged

fix: sync server version from package.json; correct tool count in docs#19
ryandmonk merged 2 commits into
mainfrom
fix/server-version-and-tool-count

Conversation

@ryandmonk

Copy link
Copy Markdown
Contributor

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' while package.json is 0.3.0. Rather than bump the literal (which would drift again next release), read the version from package.json at startup using the same ESM __dirname pattern loader.ts uses. 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-context and validate-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 reports 0.3.0.
  • npm test — 93/93 pass.
  • Tool count confirmed: 11 registerTool calls (9 lookup + 2 generation).

🤖 Generated with Claude Code

ryandmonk and others added 2 commits July 6, 2026 16:37
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>
Copilot AI review requested due to automatic review settings July 6, 2026 20:38
@ryandmonk
ryandmonk merged commit e82da3d into main Jul 6, 2026
1 check passed
@ryandmonk
ryandmonk deleted the fix/server-version-and-tool-count branch July 6, 2026 20:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json instead of using a hardcoded literal in createServer.
  • 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 thread src/server.ts
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 };
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