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>
3c736c0 to
77e23fe
Compare
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.
Fixes #4199.
Summary
mcp-server-fetchalways called readabilipy withuse_readability=True. That path shells out through Node.js, but the server is installed and documented as a Python package. If Node is missing or the Node readability path is slow/misconfigured, HTML fetches can hang until the MCP client times out.This patch keeps the stronger Node.js readability path when
nodeis available, but avoids making it an undeclared hard runtime requirement:nodebefore choosing the readability backend--no-readability-jsfor hosts that have Node installed but want the Python-only backendValidation
python -m py_compile src/fetch/src/mcp_server_fetch/server.py src/fetch/tests/test_server.pysrc/fetch/.venv/Scripts/python.exe -m pip install -e src/fetchsrc/fetch/.venv/Scripts/python.exe -m pytest tests -qfromsrc/fetchsrc/fetch/.venv/Scripts/python.exe -m py_compile src/mcp_server_fetch/server.py tests/test_server.pyfromsrc/fetchsrc/fetch/.venv/Scripts/python.exe -m ruff check src/mcp_server_fetch/server.py tests/test_server.pyfromsrc/fetchgit diff --check origin/main..HEAD