Skip to content

Commit 1b5df0b

Browse files
author
Marvin Zhang
committed
fix: MCP server version consistency
- MCP server now reads version from package.json dynamically - Both CLI and MCP server now use consistent versioning - Removes all hardcoded version strings
1 parent ad01e5d commit 1b5df0b

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.1.5] - 2025-11-10
11+
12+
### Fixed
13+
- MCP server version now also read dynamically from package.json
14+
- Complete version consistency across CLI and MCP server
15+
1016
## [0.1.4] - 2025-11-10
1117

1218
### Fixed
@@ -211,6 +217,7 @@ This UAT release operationalizes LeanSpec's five first principles:
211217
- Gray-matter for frontmatter parsing
212218
- Dayjs for date handling
213219

220+
[0.1.5]: https://github.com/codervisor/lean-spec/releases/tag/v0.1.5
214221
[0.1.4]: https://github.com/codervisor/lean-spec/releases/tag/v0.1.4
215222
[0.1.3]: https://github.com/codervisor/lean-spec/releases/tag/v0.1.3
216223
[0.1.2]: https://github.com/codervisor/lean-spec/releases/tag/v0.1.2

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lean-spec",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"description": "Lightweight spec methodology for AI-powered development",
55
"type": "module",
66
"bin": {

src/mcp-server.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ import type { SpecStatus, SpecPriority, SpecFilterOptions } from './frontmatter.
1818
import { resolveSpecPath } from './utils/path-helpers.js';
1919
import * as fs from 'node:fs/promises';
2020
import * as path from 'node:path';
21+
import { readFileSync } from 'fs';
22+
import { fileURLToPath } from 'url';
23+
import { dirname, join } from 'path';
24+
25+
// Get version from package.json
26+
const __filename = fileURLToPath(import.meta.url);
27+
const __dirname = dirname(__filename);
28+
const packageJson = JSON.parse(
29+
readFileSync(join(__dirname, '../package.json'), 'utf-8')
30+
);
2131

2232
// Type definitions for better type safety
2333
type SpecData = {
@@ -291,7 +301,7 @@ async function getDepsData(specPath: string): Promise<{
291301
async function createMcpServer(): Promise<McpServer> {
292302
const server = new McpServer({
293303
name: 'lean-spec',
294-
version: '0.1.0',
304+
version: packageJson.version,
295305
});
296306

297307
// ===== TOOLS =====

0 commit comments

Comments
 (0)