Skip to content

Wiki search: search_wiki and get_wiki_page (25 tools) - #8

Merged
christabone merged 5 commits into
masterfrom
feat/wiki-search
Oct 13, 2026
Merged

christabone merged 5 commits into
masterfrom
feat/wiki-search

Conversation

@christabone

Copy link
Copy Markdown
Member

Wiki search: search_wiki and get_wiki_page (25 tools)

Two light tools backed by MediaWiki's API over a private http path from the MCP host to the wiki host (WIKI_BASE_URL + WIKI_HOST_HEADER; unconfigured → backend_unavailable).

What ships

  • search_wiki {query, limit, offset}: Help, Category and FlyBase namespaces via generator=search&redirects=1&prop=info; redirect duplicates and broken redirects dropped; one wildcard retry on zero hits; plain-text snippets; public page URLs.
  • get_wiki_page {title, max_chars}: parsed HTML converted to readable plain text (lists, definition lists, tables, headings, links), text_truncated, sections (capped) and sections_total, licence when the wiki publishes one; post-redirect namespace allow-list.
  • Backend client: http only, GETs only, no redirects, 10 s timeout, 4 MiB body cap (→ limit_exceeded), Host header, query pairs via append_pair, errors never carry user text; dedicated Limits::wiki permit so a hung wiki never holds chado permits; licence lookup with failure caching.
  • Converter hardened against hostile markup (bounded indentation, bounded tag lookahead, hidden-element skipping): 38 adversarial inputs ≤ 32 ms, output ≤ 2× input.
  • /health gains wiki: unconfigured | ok | unreachable (never flips status). Descriptions say wiki text is community-editable and untrusted.
  • Fixtures captured unedited from the public API; 15 client tests + 21 tool tests (wiremock), conformance 25, catalog regenerated, README/deployment/examples updated.

Verification

lib 83, wiki_client 15, tools_wiki 21, conformance 4, cache 1, live 4 (fixture DB); fmt, clippy, catalog clean. Design reviewed by Opus and Fable (two revisions); two tasks each with review + fix round; Fable whole-branch review with one fix wave; public-safety pass clean.

Not in this PR

Production rollout (env on the host; the security-group rule for the private path is already in place).

@christabone
christabone merged commit 8551146 into master Oct 13, 2026
6 checks passed
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.

1 participant