1.0.5 - #49
Merged
Merged
Conversation
## Changed - Set X-Lara-Client and X-Lara-Client-Version on the Lara client so the headers are sent on every SDK request - Report the real package version (instead of hardcoded 0.0.15) as the MCP server version - server-info route now reads the version from the shared module ## New - Add src/version.ts as the single source for the package version
Contributor
There was a problem hiding this comment.
Pull request overview
This PR centralizes package version resolution and uses it to (1) report the MCP server version and (2) tag all Lara SDK calls with consistent X-Lara-Client* headers.
Changes:
- Add a shared
PACKAGE_VERSIONconstant (loaded once frompackage.jsonwith fallback) and use it across the codebase. - Set
X-Lara-Client: MCPandX-Lara-Client-Version: <version>on the Lara SDK client once during MCP server construction. - Update
/server-infoto return the shared version and bump the package to1.0.5, adding unit tests for both behaviors.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/version.ts | Introduces a shared PACKAGE_VERSION constant loaded from package.json. |
| src/rest/routes/server-info.ts | Uses PACKAGE_VERSION instead of reading/parsing package.json in-route. |
| src/mcp/server.ts | Sets Lara SDK extra headers once and reports MCP server version via PACKAGE_VERSION. |
| src/tests/version.test.ts | Verifies PACKAGE_VERSION matches package.json. |
| src/tests/utils/mocks.ts | Extends translator mock to include client.setExtraHeader. |
| src/tests/server/mcp.server.test.ts | Tests that MCP server construction wires the Lara client headers correctly. |
| package.json | Bumps package version to 1.0.5. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
## Changed - Validate the parsed package.json version is a non-empty string, falling back to "unknown" on malformed input - Guard the Lara client setExtraHeader call so an unexpected SDK shape logs a warning instead of crashing the server
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.
Changed
X-Lara-Client: MCPandX-Lara-Client-Version: <package version>headers on all Lara SDK calls (translate, glossaries, memories, languages, imports, etc.) by setting them once on the SDK client after construction.0.0.15./server-inforoute now reads the version from the shared module.