fix: upgrade zod to v4 to fix global install crash
@modelcontextprotocol/sdk@1.26.0 uses zod/v4 APIs (specifically z.literal().value getter). When installed globally, npm shared the project's zod@3.25.5 instead of the SDK's nested zod@4.3.6; the 3.25.5 v4 compat shim lacks the .value getter, throwing 'Schema method literal must be a string' on startup. Also updates z.record(z.any()) to z.record(z.string(), z.any()) for zod v4 strict record key typing. 446/446 tests passing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
d1689a2e5c
commit
c368d4088a
@@ -5,6 +5,12 @@ Format: [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.0.3] - 2026-03-30
|
||||
|
||||
### Fixed
|
||||
- Global install crash (`Schema method literal must be a string`) — upgraded `zod` from `3.25.5` to `^4.3.6` so the package uses real zod v4 rather than falling back to zod 3.x's v4 compatibility shim, which lacks the `.value` getter required by `@modelcontextprotocol/sdk@1.26.0`
|
||||
- `z.record(z.any())` call updated to `z.record(z.string(), z.any())` to satisfy zod v4's stricter record key-type requirement
|
||||
|
||||
## [1.0.2] - 2026-03-30
|
||||
|
||||
### Added
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "excalidraw-mcp-sentinel",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"description": "Hardened, self-hosted Excalidraw MCP server with SQLite persistence, multi-tenancy, auto-sync, security middleware, and 369 tests",
|
||||
"main": "dist/index.js",
|
||||
"type": "module",
|
||||
@@ -47,7 +47,7 @@
|
||||
"react-dom": "^18.3.1",
|
||||
"winston": "^3.11.0",
|
||||
"ws": "8.20.0",
|
||||
"zod": "3.25.5",
|
||||
"zod": "^4.3.6",
|
||||
"zod-to-json-schema": "^3.22.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
+1
-1
@@ -378,7 +378,7 @@ const DistributeElementsSchema = z.object({
|
||||
|
||||
const QuerySchema = z.object({
|
||||
type: z.enum(Object.values(EXCALIDRAW_ELEMENT_TYPES) as [ExcalidrawElementType, ...ExcalidrawElementType[]]).optional(),
|
||||
filter: z.record(z.any()).optional()
|
||||
filter: z.record(z.string(), z.any()).optional()
|
||||
});
|
||||
|
||||
const ResourceSchema = z.object({
|
||||
|
||||
Reference in New Issue
Block a user