Fix tools/list error by pinning SDK and Zod versions#142
Merged
Conversation
The hosted MCP server at mcp.socket.dev fails on tools/list with: "Cannot read properties of null (reading '_def')" This is caused by Zod version incompatibility. SDK 1.25.x requires zod ^3.25 which has internal _def structure changes that break schema serialization. Changes: - Pin @modelcontextprotocol/sdk to 1.22.0 (last version using zod ^3.23.8) - Pin zod to 3.24.1 - Add overrides to force all transitive deps to use compatible versions
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
- Introduced a new function `createConfiguredServer` to encapsulate the server setup logic. - Updated the `depscore` tool registration to use a more structured input schema. - Enhanced type definitions for package handling within the tool's request processing. - Improved error handling and logging for API responses. This refactor aims to improve code organization and maintainability.
- Refactored transport handling to use a session-based approach, allowing each client to have a dedicated transport and server pair. - Updated session lifecycle management to ensure proper cleanup of server resources upon session closure. - Improved handling of session initialization and closure events to prevent resource leaks. These changes aim to improve the reliability and maintainability of the HTTP server's session management.
- Upgraded @modelcontextprotocol/sdk from 1.22.0 to 1.26.0. - Updated zod from 3.24.1 to 3.25.0 in both package.json and package-lock.json. - Adjusted express and express-rate-limit to versions 5.2.1 and 8.2.1 respectively. - Added new dependencies: @hono/node-server, hono, jose, json-schema-typed, and ip-address with their respective versions. - Updated overrides for zod and zod-to-json-schema to ensure compatibility across dependencies. These changes enhance compatibility and ensure the project uses the latest stable versions of its dependencies.
- Introduced a session interface to manage transport and server pairs for each client, including tracking last activity. - Implemented a session reaping mechanism to automatically destroy idle sessions after 30 minutes. - Updated session handling in request processing to ensure proper resource cleanup and activity tracking. These changes improve the reliability and efficiency of session management in the HTTP server.
Collaborator
|
Thanks @dc-larsen for the PR! I've upgraded the dependencies and fixed the zod issue (among other things :) ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the hosted MCP server at mcp.socket.dev failing on
tools/listwith error:Root cause: Zod version incompatibility. The MCP SDK 1.25.x requires
zod ^3.25which has internal_defstructure changes that break schema serialization duringtools/list.Changes:
@modelcontextprotocol/sdkto 1.22.0 (last version compatible with older Zod)zodto 3.24.1Test plan