03.2 · Web research: searxng + webfetch-mcp sidecar #13
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cmoriarty/trog#13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up from ticket 03.1's audit (docs/toolbelt-audit.md): web research was a keep.
Architecture decision (2026-07-23): searxng + webfetch-mcp are generic infra, not trog services — every hosted LLM on trogdor (ollama, llama_cpp_* stacks, OpenCode sessions) benefits. They live in a separate common-mcps repo with its own git-connected Portainer stack, on searxng's own upgrade cadence, decoupled from trog's deploy churn.
Scope — common-mcps repo (new):
searxngservice (image-only compose, Portainer git stack on trogdor)Scope — trog side (this ticket closes when both exist):
WEBSEARCH_MCP_URLenv var on aegra (Portainer stack env, like FORGEJO_URL)search,fetch)Boundary rule (from the discussion): project-agnostic + multiple consumers → common-mcps; knows about trog's domain → trog compose (trog-mcp, playtest service stay here).
Why: precedent from agentic-game-dev — server-side readability extraction measurably reduced failed web reads vs letting the model fetch raw pages.
Infra half done — common-mcps live on trogdor
Deployed and tested:
searxng@http://192.168.1.105:8181— JSON API enabled via inline compose config, limiter off, LAN-onlymcp-searxng@http://192.168.1.105:8182/mcp— streamable HTTP,isokoliuk/mcp-searxngv1.11.1Candidate swap at deploy time: webfetch-mcp (audit's lead) has no prebuilt image and undocumented transport — replaced by ihor-sokoliuk/mcp-searxng: prebuilt image, native streamable HTTP,
web_url_readdoes URL→markdown. Audit doc updated. One deploy gotcha worth remembering: it binds loopback by default —MCP_HTTP_HOST=0.0.0.0required.Acceptance test passed end-to-end (real MCP handshake, not curl-poking):
initialize→tools/list(4 tools) →searxng_web_search("Phaser 4 particle emitter API")returned relevant extracted results →web_url_readon docs.phaser.io returned readable markdown, not raw HTML.Remaining for this ticket (trog side):
WEBSEARCH_MCP_URLenv on aegra stackDone — trog side wired, acceptance passed live
What was done (commit
47a0812; infra half in the earlier comment)server/trog_lib/toolbelt.py— the brain's standing toolbelt. Mountssearxng_web_search+web_url_readfromWEBSEARCH_MCP_URLvia langchain-mcp-adapters (streamable HTTP). Only those two ride along (schema tokens are paid every turn); suggestions/instance_info filtered out. Empty env or dead sidecar →[], research silently off — a missing MCP must never kill a run, and failures aren't cached so a sidecar coming up mid-run is picked up by the next phase.production.py— phase nodes now go through_research_invoke: a bounded tool loop (4 rounds, then the document is forced out of a model that would rather keep searching). Tool errors return as tool messages, not exceptions. Gates stay tool-free — critics judge, they don't google. Phase prompts get a research hint only when the belt is live.WEBSEARCH_MCP_URLon aegra (empty default = disabled); Portainer stack env set tohttp://192.168.1.105:8182/mcp; image rebuilt + redeployed.47a0812.Acceptance — live, in the deployed container, exact phase code path:
_research_invokewith the real brain (--jinjaalready on) + real MCP endpoint, task: "Phaser 4 particle emitters, CURRENT API." The brain calledsearxng_web_searchon its own — searxng's engine log shows its query (Phaser 4 particles emitter example 2024) — and produced a correct v4-only answer (knewParticleEmitterManagerwas removed in v4).Both halves of the ticket exist and are verified. Full-run research behavior (a phase researching mid-production-run) will get exercised by the next
produce-test.shrun.Closing — 03.2 complete
Both halves shipped and live-verified:
47a0812):trog_lib.toolbelt+ bounded research loop in production phases,WEBSEARCH_MCP_URLin stack env; acceptance passed with the brain issuing its own search through the full chainFinal thoughts / watch items:
web_url_readmarkdown was serviceable but nav-heavy on docusaurus pages. If it wastes context in real runs, the swap is mcp-searxng-enhanced (trafilatura + PDF) — one image build, same endpoint shape, zero trog changes.Follow-on threads: #11 carries the OpenCode session design; ticket 05 has the aseprite candidates; audit doc (docs/toolbelt-audit.md) reflects deployed reality.