Skip to content

fix(fetch): fall back when readability extraction fails#4227

Open
kgarg2468 wants to merge 1 commit into
modelcontextprotocol:mainfrom
kgarg2468:kgarg/fix-fetch-readability-option
Open

fix(fetch): fall back when readability extraction fails#4227
kgarg2468 wants to merge 1 commit into
modelcontextprotocol:mainfrom
kgarg2468:kgarg/fix-fetch-readability-option

Conversation

@kgarg2468
Copy link
Copy Markdown

Summary

  • let fetch HTML extraction fall back to readabilipy without Readability.js when readability fails
  • add a --no-readability flag for environments without Node/Readability support
  • return the existing error marker when simplification still produces empty content

Fixes #4199.

Tests

  • cd src/fetch && uv run pytest tests/test_server.py -q
  • cd src/fetch && uv run ruff check src/mcp_server_fetch/server.py src/mcp_server_fetch/init.py tests/test_server.py
  • git diff --check

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.

mcp-server-fetch hard-codes use_readability=True which requires Node.js (undeclared); fails silently when Node is unavailable or misconfigured

1 participant