fix: derive SERVER_VERSION from package.json

dbmole reported a hardcoded SERVER_VERSION of 0.1.0 while the package was
already published as 0.1.1: the constant had drifted because a bump has to
touch two places. Both servers now read the version from package.json
(resolveJsonModule + a JSON import attribute), so a release updates one
place and the reported version can no longer fall behind.

Add a dbmole guard test that add_connection publishes a non-empty
inputSchema with the expected required fields, mirroring esmole, so a future
`.superRefine` on the schema cannot silently empty it.
This commit is contained in:
admin committed 2026-06-16 23:49:05 +05:00
1 parent baecc24211
commit 63bb2a5c99
5 files changed
+29 -5

No files matched your search

+2 -1
View File
@@ -1,6 +1,7 @@
import { registerConnectionTools } from '@dbmole/core'
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
import * as z from 'zod'
import pkg from '../package.json' with { type: 'json' }
import type { EsBackend } from './es/backend.js'
import { ping } from './esBackend.js'
import { esFormatError } from './esError.js'
@@ -16,7 +17,7 @@ import {
} from './schema.js'
import { registerEsTools } from './tools/index.js'
export const SERVER_VERSION = '0.1.1'
export const SERVER_VERSION = pkg.version
const patchSchema = z
.object({