LearnNewsExamplesServices
Frontmatter
id8201
titleFix `nextCursor: null` violation and OpenAPI Array Validation in MCP Servers
stateClosed
labels
bugai
assigneestobiu
createdAtDec 29, 2025, 2:33 PM
updatedAtDec 29, 2025, 2:42 PM
githubUrlhttps://github.com/neomjs/neo/issues/8201
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 29, 2025, 2:42 PM

Fix nextCursor: null violation and OpenAPI Array Validation in MCP Servers

Closed v11.18.0 bugai
tobiu
tobiu commented on Dec 29, 2025, 2:33 PM

The MCP SDK schema validation requires nextCursor to be string | undefined, but null is being returned in the catch blocks of listTools handlers across all MCP servers (Neural Link, Knowledge Base, GitHub Workflow, Memory Core) and in the default return of ToolService.mjs. This causes a "Invalid input: expected string, received null" error that masks the underlying exception when tool discovery fails.

This task involves updating the logic in:

  • ai/mcp/ToolService.mjs
  • ai/mcp/server/neural-link/Server.mjs
  • ai/mcp/server/knowledge-base/Server.mjs
  • ai/mcp/server/github-workflow/Server.mjs
  • ai/mcp/server/memory-core/Server.mjs

Additionally, ai/mcp/validation/OpenApiValidator.mjs needs to be robust against OpenAPI array schemas that do not define an items property (defaulting to any[]).

tobiu added the bug label on Dec 29, 2025, 2:33 PM
tobiu added the ai label on Dec 29, 2025, 2:33 PM
tobiu assigned to @tobiu on Dec 29, 2025, 2:36 PM
tobiu referenced in commit a45e8f6 - "Fix nextCursor: null violation and OpenAPI Array Validation in MCP Servers #8201" on Dec 29, 2025, 2:42 PM
tobiu closed this issue on Dec 29, 2025, 2:42 PM