@agledger/mcp-server 3.1.0 → 3.2.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.
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Which zod this package and the MCP SDK each resolve.
2
+ * Which zod this package and the MCP library each resolve.
3
3
  *
4
- * They have to agree on the VERSION. The SDK renders our tool schemas with the
4
+ * They have to agree on the VERSION. The MCP library renders our tool schemas with the
5
5
  * zod it resolves, and a renderer from a different zod release does not
6
6
  * understand the schema internals this one produces: a 4.4.3 schema rendered by
7
7
  * 3.25.76 comes out as `{}`, losing every argument description and the `type`
@@ -15,15 +15,15 @@
15
15
  * with both on 4.4.3 the published contract is complete. Warning on that tree
16
16
  * would be a false alarm on a working install.
17
17
  *
18
- * Matching the SDK's `^3.25 || ^4.0` range and importing `zod/v4` is what lets
19
- * npm dedupe to one copy. This catches the trees where it cannot: a host pinned
20
- * below 3.25, `--legacy-peer-deps`, a pnpm or yarn resolution.
18
+ * Declaring the same `^4.2.0` range `@modelcontextprotocol/server` declares is what
19
+ * lets npm dedupe to one copy. This catches the trees where it cannot: a host
20
+ * pinned to another zod 4 release, `--legacy-peer-deps`, a pnpm or yarn resolution.
21
21
  */
22
22
  export interface ZodResolution {
23
23
  /** Version of the zod this package uses. */
24
24
  ours: string;
25
- /** Version of the zod the MCP SDK uses. */
26
- sdk: string;
25
+ /** Version of the zod `@modelcontextprotocol/server` uses. */
26
+ mcp: string;
27
27
  /** True when the two are different releases, whether or not they are separate copies. */
28
28
  skewed: boolean;
29
29
  }
@@ -9,10 +9,12 @@ export function resolveZodCopies(fromUrl = import.meta.url) {
9
9
  try {
10
10
  const require = createRequire(fromUrl);
11
11
  const ours = require('zod/package.json');
12
- const sdkDir = dirname(require.resolve('@modelcontextprotocol/sdk/package.json'));
13
- const sdkRequire = createRequire(`${sdkDir}/`);
14
- const sdk = sdkRequire('zod/package.json');
15
- return { ours: ours.version, sdk: sdk.version, skewed: ours.version !== sdk.version };
12
+ // `package.json` is not in the library's `exports` map, so locate it from
13
+ // the resolved entry point instead of requiring it.
14
+ const mcpDir = dirname(require.resolve('@modelcontextprotocol/server'));
15
+ const mcpRequire = createRequire(`${mcpDir}/`);
16
+ const mcp = mcpRequire('zod/package.json');
17
+ return { ours: ours.version, mcp: mcp.version, skewed: ours.version !== mcp.version };
16
18
  }
17
19
  catch {
18
20
  return null;
@@ -21,13 +23,13 @@ export function resolveZodCopies(fromUrl = import.meta.url) {
21
23
  /** Warning text for a version-skewed tree. */
22
24
  export function zodSplitWarning(resolution) {
23
25
  return ('Warning: this host tree resolved two different versions of zod.\n' +
24
- ` @agledger/mcp-server: zod ${resolution.ours}\n` +
25
- ` @modelcontextprotocol/sdk: zod ${resolution.sdk}\n` +
26
- "The SDK renders this server's tool schemas with its own copy, and a renderer from a " +
26
+ ` @agledger/mcp-server: zod ${resolution.ours}\n` +
27
+ ` @modelcontextprotocol/server: zod ${resolution.mcp}\n` +
28
+ "The MCP library renders this server's tool schemas with its own copy, and a renderer from a " +
27
29
  'different zod release cannot read these schemas: every argument description and the ' +
28
30
  'type of every JSON-string argument are dropped from the published contract. The server ' +
29
31
  'still answers calls; agents receive it with the guidance removed.\n' +
30
- 'Fix: dedupe zod to one version (`npm dedupe`, or raise a zod pinned below 3.25 above ' +
31
- 'this package). This package accepts the same range the SDK does so a single copy can ' +
32
+ 'Fix: dedupe zod to one version (`npm dedupe`, or align a pinned zod with ^4.2.0). ' +
33
+ 'This package declares the same range the MCP library does so a single copy can ' +
32
34
  'serve both.\n');
33
35
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agledger/mcp-server",
3
- "version": "3.1.0",
4
- "description": "AGLedger MCP server: the AGLedger API as MCP tools, so any MCP-capable agent can write to the signed ledger.",
3
+ "version": "3.2.0",
4
+ "description": "AGLedger MCP server: the AGLedger API as MCP tools, so any MCP-capable agent can write to the signed ledger. Patent pending.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "AGLedger LLC",
7
7
  "repository": {
@@ -45,9 +45,10 @@
45
45
  "scripts": {
46
46
  "prebuild": "rm -rf dist",
47
47
  "build": "tsc",
48
+ "prepack": "node -e \"fs.existsSync('tsconfig.json')&&child_process.execSync('npm run build',{stdio:'inherit'})\"",
48
49
  "typecheck": "tsc --noEmit",
49
50
  "clean": "rm -rf dist *.tsbuildinfo",
50
- "lint": "tsc --noEmit",
51
+ "lint": "oxlint --type-aware .",
51
52
  "test": "vitest run",
52
53
  "deps:lag": "node scripts/dep-lag.mjs",
53
54
  "deps:refresh": "npm update && node scripts/dep-lag.mjs",
@@ -55,17 +56,18 @@
55
56
  "prepublishOnly": "npm run build && npm run lint:pkg"
56
57
  },
57
58
  "dependencies": {
58
- "@agledger/verify-core": "^2.1.0",
59
- "@modelcontextprotocol/sdk": "^1.30.0",
60
- "zod": "^3.25.0 || ^4.0.0"
61
- },
62
- "peerDependencies": {
63
- "zod": "^3.25.0 || ^4.0.0"
59
+ "@agledger/verify-core": "^2.2.0",
60
+ "@modelcontextprotocol/server": "^2.4.0",
61
+ "zod": "^4.2.0"
64
62
  },
65
63
  "devDependencies": {
66
64
  "@arethetypeswrong/cli": "^0.18.3",
65
+ "@cyclonedx/cyclonedx-npm": "7.0.1",
66
+ "@modelcontextprotocol/client": "2.4.0",
67
67
  "@types/node": "^24.0.0",
68
- "cborg": "^6.1.1",
68
+ "cborg": "7.0.0",
69
+ "oxlint": "1.94.0",
70
+ "oxlint-tsgolint": "7.0.2008",
69
71
  "publint": "^0.3.21",
70
72
  "typescript": "^7.0.2",
71
73
  "vitest": "^5.0.0"