@upstash/context7-mcp@2.2.5

upstash/context7@upstash/context7-mcp@2.2.5May 11, 2026by github-actions[bot]

AI Summary

Fixed LLM argument validation and improved process lifecycle management to prevent orphaned processes.

Key Highlights

  • Accepts hallucinated argument names (e.g., userQuery) and rewrites them.
  • Exits cleanly when parent process closes stdio.
  • Listens for SIGHUP and stdin end/close events.

New Features

  • Argument name rewriting
  • Process lifecycle cleanup

Full Release Notes

### Patch Changes

-   187287c: Accept hallucinated argument names on `tools/call` requests by rewriting them to the canonical names before validation. `userQuery` and `question` are mapped to `query` on either tool; on `query-docs`, `context7CompatibleLibraryID`, `libraryID`, and `libraryName` are mapped to `libraryId`. Some LLM clients produce these alternative names — likely echoing phrasing from each tool's description — and previously triggered `Invalid input: expected string, received undefined` errors. `libraryName` is only rewritten on `query-docs` calls because it is the canonical arg for `resolve-library-id`. Tool input schemas published via `tools/list` are unchanged: canonical names remain the documented required fields, the rewrite is purely a server-side compatibility shim that runs only on `tools/call` and only when the canonical key is absent.
-   78b9826: Exit the stdio MCP server when the parent process closes its stdio. Previously, if the parent (e.g. Claude Code) was force-killed shortly after a tool call, an idle undici keep-alive socket to the Context7 API would keep libuv's event loop alive past stdin EOF, leaving an orphaned `node` process that consumed memory until the kernel tore the socket down (which on Cloudflare-fronted endpoints can take hours). The server now listens for `end`/`close` on stdin and `SIGHUP` and exits cleanly. Fixes #2542.