fix(fetch): add python-only readability fallback#4281
Open
he-yufeng wants to merge 1 commit into
Open
Conversation
Signed-off-by: Yufeng He <40085740+he-yufeng@users.noreply.github.com>
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.
Description
Make the fetch server use the optional Node.js readability path only when
nodeis available onPATH, and add--no-readability-jsfor hosts that need to force the Python-only readabilipy simplifier.This keeps the existing robust simplifier when Node.js is installed, but avoids making a supposedly optional runtime dependency part of the default execution path.
Publishing Your Server
This changes an existing server and does not add a new server to the registry.
Server Details
Motivation and Context
Fixes #4199.
The README describes Node.js as optional for
mcp-server-fetch, but the server always called readabilipy withuse_readability=True. In environments without a usable Node.js runtime, that can make HTML fetching fail or hang in a path that should have a Python-only fallback.The new default is:
nodeis present--no-readability-jsHow Has This Been Tested?
From
src/fetch:Breaking Changes
No breaking changes expected. Existing users with Node.js on
PATHkeep the current readability-js path by default.Types of changes
Checklist
Additional context
The flag is intentionally opt-out instead of changing users with Node.js installed to the simpler path. The automatic fallback only applies when Node.js is absent.