bitbank-lab-mcp 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/server.ts +9 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitbank-lab-mcp",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Experimental MCP server for bitbank — botters lab community edition. Market data, technical analysis, charting, and Private API trading tools.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/server.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import './env.js'; // must be first — loads .env before other modules read process.env
2
+ import { createRequire } from 'node:module';
2
3
  import { isInputRequiredResult, McpServer } from '@modelcontextprotocol/server';
3
4
  import { StdioServerTransport } from '@modelcontextprotocol/server/stdio';
4
5
  import type { z } from 'zod';
@@ -10,8 +11,15 @@ import { appResourceRegistry } from './resources/app-resources.js';
10
11
  import { allToolDefs } from './tool-registry.js';
11
12
  import { storeUiSnapshot } from './ui-snapshot-cache.js';
12
13
 
14
+ // serverInfo.version は package.json を単一ソースとする。
15
+ // ハードコードすると package.json 側のリリースに追従せず drift する(実際に 0.4.2 のまま取り残されていた)。
16
+ // package.json は publish 対象(package.json の files)に含まれるため npm 経由の起動でも解決できる。
17
+ const { version: packageVersion } = createRequire(import.meta.url)('../package.json') as {
18
+ version: string;
19
+ };
20
+
13
21
  const server = new McpServer(
14
- { name: 'bitbank-mcp', version: '0.4.2' },
22
+ { name: 'bitbank-mcp', version: packageVersion },
15
23
  {
16
24
  // MRTR (SEP-2322) の requestState 検証。HMAC / 有効期限の検証をハンドラ実行前に行い、
17
25
  // 失敗時は SDK が wire レベルの -32602(Invalid or expired requestState)を返す。