Skip to content

fix: handle inherited property names in MCP server listings - #608

Open
lokesh0186 wants to merge 1 commit into
LibreChat-AI:mainfrom
lokesh0186:fix/mcp-server-listing-keys-20261010
Open

lokesh0186 wants to merge 1 commit into
LibreChat-AI:mainfrom
lokesh0186:fix/mcp-server-listing-keys-20261010

Conversation

@lokesh0186

Copy link
Copy Markdown

Fixes #607

Use null-prototype dictionaries for the two server-grouping sites in ToolSearch. Names such as constructor, toString, and hasOwnProperty otherwise resolve to inherited properties, so adding a group member throws before tool search can initialize or a server preview can be returned.

The patch leaves the search algorithm, relevance scores, tool loading, and invocation behavior unchanged. Tests use an in-memory registry and the real local search path, with no network requests.

Validation:

  • Unpatched main: nine of eleven new regressions fail; both ordinary controls pass.
  • Patched main: all eleven regressions and all 125 existing ToolSearch tests pass.
  • npx tsc --noEmit: passes.
  • Targeted ESLint: zero errors; the pre-existing strict-boolean warning at ToolSearch.ts:1352 remains unchanged.
  • Published npm 4.0.4 and 4.0.1 reproduce the grouping errors, using current-lockfile dependencies for the bundle checks.

The full SDK suite, model/API integration checks, and a full LibreChat deployment have not been run locally.

AI-assisted with OpenAI Codex.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ToolSearch server grouping crashes on inherited property names and blocks unrelated tools

1 participant