-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Problem
When using this MCP server with Fandom wikis, all tool calls that hit rest.php/v1/ endpoints fail with HTTP 403. The response is a Cloudflare JS challenge page instead of JSON.
This affects search-page, get-page, and likely all other tools that use the REST API.
Root Cause
Fandom sites are behind Cloudflare bot protection. Cloudflare blocks automated requests to rest.php/v1/* endpoints, but does not block the legacy api.php endpoint.
Verified with curl:
# Blocked (403 + Cloudflare challenge)
curl "https://<wiki>.fandom.com/rest.php/v1/search/page?q=test&limit=3"
# Works (200 + JSON response)
curl "https://<wiki>.fandom.com/api.php?action=query&titles=Main_Page&format=json"
Suggested Fix
Fall back to the api.php action API (action=query&list=search, action=parse, etc.) when rest.php returns a 403 or Cloudflare challenge. The mwn library already supports both API surfaces.
Alternatively, expose a configuration option to prefer api.php over rest.php for environments where the REST API is blocked.
Environment
- Server version: 0.6.0 (via npx)
- Affected wikis: Any Fandom wiki (*.fandom.com)
- Works fine with: Wikipedia, self-hosted MediaWiki, wiki.gg