@kinginsun/mcp-drugsea 0.8.0 → 0.9.0

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.
package/README.md CHANGED
@@ -382,7 +382,7 @@ echo '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"product-cn
382
382
 
383
383
  ## Releasing (maintainers)
384
384
 
385
- `publish.sh` releases the package to npm (which is what makes `npx -y @kinginsun/mcp-drugsea@latest` work). It syncs `src/index.ts`'s `PACKAGE_VERSION` with `package.json`, builds clean, audits the tarball for leaked tokens, runs the 13-tool suite plus the facet and update-check suites, commits + tags, then publishes and pushes.
385
+ `publish.sh` releases the package to npm (which is what makes `npx -y @kinginsun/mcp-drugsea@latest` work). It syncs `src/environment.ts`'s `PACKAGE_VERSION` with `package.json`, builds clean, audits the tarball for leaked tokens, runs the 13-tool suite plus the facet and update-check suites, commits + tags, then publishes and pushes.
386
386
 
387
387
  ```bash
388
388
  npm login # once, with rights on the @kinginsun scope
package/dist/api.js CHANGED
@@ -2,6 +2,7 @@ import http from "node:http";
2
2
  import https from "node:https";
3
3
  import { URL } from "node:url";
4
4
  import { normalizeRecord, parseFacetList, stripMcpFields } from "./normalize.js";
5
+ import { ENVIRONMENT_FINGERPRINT } from "./environment.js";
5
6
  export class MissingTokenError extends Error {
6
7
  constructor(message) {
7
8
  super(message ??
@@ -28,6 +29,7 @@ export function getAuthHeaders(extra = {}) {
28
29
  const token = getUserToken();
29
30
  return {
30
31
  ...extra,
32
+ "User-Agent": ENVIRONMENT_FINGERPRINT.userAgent,
31
33
  Authorization: `Bearer ${token}`,
32
34
  };
33
35
  }
@@ -0,0 +1,24 @@
1
+ import os from "node:os";
2
+ export const PACKAGE_NAME = "mcp-drugsea";
3
+ export const PACKAGE_VERSION = "0.9.0";
4
+ /**
5
+ * Capture non-identifying runtime metadata once when the MCP process starts.
6
+ * Deliberately excludes hostname, username, network addresses, and machine IDs.
7
+ */
8
+ function collectEnvironmentFingerprint() {
9
+ const platform = process.platform;
10
+ const osRelease = os.release();
11
+ const arch = process.arch;
12
+ const nodeVersion = process.version;
13
+ return Object.freeze({
14
+ packageName: PACKAGE_NAME,
15
+ packageVersion: PACKAGE_VERSION,
16
+ nodeVersion,
17
+ platform,
18
+ osRelease,
19
+ arch,
20
+ userAgent: `${PACKAGE_NAME}/${PACKAGE_VERSION} ` +
21
+ `(Node.js ${nodeVersion}; ${platform} ${osRelease}; ${arch})`,
22
+ });
23
+ }
24
+ export const ENVIRONMENT_FINGERPRINT = collectEnvironmentFingerprint();
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import { ATC_HINT, PRODUCT_CN_COMMON_FIELDS, PRODUCT_CN_DETAIL_PATH, PRODUCT_CN_
7
7
  import { EmptyObjectSchema, ProductCnDetailSchema, ProductCnFacetsSchema, ProductCnSearchSchema, RegCnDetailSchema, RegCnFacetsSchema, RegCnSearchSchema, YaohaiCatalogSchema, YaohaiDetailSchema, YaohaiFacetsSchema, YaohaiGlobalSearchSchema, YaohaiSearchSchema, } from "./types.js";
8
8
  import { DBS_FACET_CATALOG } from "./dbs-facets.js";
9
9
  import { checkForUpdate, formatUpdateMessage, } from "./update-check.js";
10
- const PACKAGE_VERSION = "0.8.0";
10
+ import { PACKAGE_NAME, PACKAGE_VERSION } from "./environment.js";
11
11
  const YAOHAI_LIMIT_MAX = 50;
12
12
  const YAOHAI_LIMIT_DEFAULT = 10;
13
13
  const CN_LIMIT_MAX = 100;
@@ -40,7 +40,7 @@ process.on("unhandledRejection", (reason, promise) => {
40
40
  process.exit(1);
41
41
  });
42
42
  const server = new Server({
43
- name: "mcp-drugsea",
43
+ name: PACKAGE_NAME,
44
44
  version: PACKAGE_VERSION,
45
45
  }, {
46
46
  capabilities: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kinginsun/mcp-drugsea",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "MCP server for DrugSea / Yaohai pharmaceutical databases: cross-db search, China marketed products (product_cn), and CDE registration review (reg_cn).",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",