@agledger/mcp-server 3.0.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.
- package/CHANGELOG.md +130 -170
- package/README.md +24 -21
- package/dist/api-client.d.ts +18 -0
- package/dist/api-client.js +80 -20
- package/dist/credentials.d.ts +52 -1
- package/dist/credentials.js +184 -10
- package/dist/delegation.js +2 -1
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +18 -0
- package/dist/index.js +66 -17
- package/dist/server.d.ts +35 -1
- package/dist/server.js +310 -136
- package/dist/zod-integrity.d.ts +7 -7
- package/dist/zod-integrity.js +11 -9
- package/package.json +12 -10
package/dist/zod-integrity.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Which zod this package and the MCP
|
|
2
|
+
* Which zod this package and the MCP library each resolve.
|
|
3
3
|
*
|
|
4
|
-
* They have to agree on the VERSION. 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
|
-
*
|
|
19
|
-
* npm dedupe to one copy. This catches the trees where it cannot: a host
|
|
20
|
-
*
|
|
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
|
|
26
|
-
|
|
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
|
}
|
package/dist/zod-integrity.js
CHANGED
|
@@ -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
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
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:
|
|
25
|
-
` @modelcontextprotocol/
|
|
26
|
-
"The
|
|
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
|
|
31
|
-
'
|
|
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.
|
|
4
|
-
"description": "AGLedger MCP
|
|
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": "
|
|
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.
|
|
59
|
-
"@modelcontextprotocol/
|
|
60
|
-
"zod": "^
|
|
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": "
|
|
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"
|