Skip to content

Conversation

@christian-kreuzberger-dtx
Copy link
Collaborator

@christian-kreuzberger-dtx christian-kreuzberger-dtx commented Jul 1, 2025

Summary

This PR addresses issue #46 by implementing version logging on server startup and using the dynamic version from package.json.

image

Changes Made

  1. Added version reading from package.json: Uses import to import the package.json and extract the VERSION
  2. Log server version on startup: Added console.error(\Starting Dynatrace MCP Server v${VERSION}...`)` for better troubleshooting
  3. Use dynamic version in McpServer constructor: Replaced hardcoded '0.0.1' with the dynamic VERSION variable
  4. Removed TODO comment: Cleaned up the TODO about reading version from package.json

Technical Details

  • Uses console.error for logging to maintain consistency with the existing codebase and avoid interfering with STDIO
  • Version is loaded once at startup for efficiency
  • No breaking changes to the API or functionality

Testing

  • ✅ Code compiles successfully with TypeScript
  • ✅ Version is correctly read from package.json (currently 0.2.0)
  • ✅ Maintains consistency with existing logging patterns

Fixes #46

Copy link
Collaborator

@MrManny MrManny left a comment

Choose a reason for hiding this comment

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

It probably works, but I have questions.

Copy link
Collaborator

@MrManny MrManny left a comment

Choose a reason for hiding this comment

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

One or two choices I wouldn't have made, but overall, it seems to do the trick.

- Add version reading from package.json using require()
- Log server version on startup using console.error for consistency
- Use dynamic version in McpServer constructor instead of hardcoded '0.0.1'
- Remove TODO comment about reading version from package.json

Fixes #46
@christian-kreuzberger-dtx christian-kreuzberger-dtx merged commit fc0ec9f into main Jul 2, 2025
2 checks passed
@christian-kreuzberger-dtx christian-kreuzberger-dtx deleted the feature/log-version-on-startup branch July 2, 2025 09:56
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.

Log version of the MCP server when starting it

3 participants