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
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtDec 29, 2025, 2:42 PM

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

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[]).