WIP: ai-summary: search and read pages through degoog MCP #1

Draft
john wants to merge 1 commit from feat/ai-summary-mcp into pr/ai-summary-mcp
Owner

Draft for review before anything goes upstream. Upstream issue: degoog-org/degoog#367.

What it does. A new advanced setting, Degoog MCP URL (+ token), lets the AI Summary and the follow-up chat call the degoog MCP sidecar's search and scrape tools, up to 4 rounds per answer. OpenAI-style providers only (OpenAI compatible, OpenAI, OpenRouter, llama.cpp, vLLM, LM Studio): the change lives in the shared OpenAI chat adapter. Blank URL keeps today's single pass.

  • src/mcp.js: small Streamable HTTP MCP client (initialize, session id, re-initialize on 404, tools/list limited to search and scrape, tools/call, bearer token, redirects refused).
  • providers/openai-chat.js: sends tools, assembles streamed tool_calls.
  • src/tools.js: the loop. Pages found through tools get the next citation numbers after the page's results, so [N] chips and hover cards keep working.
  • Tool steps show in the thinking line ("Searching for …", "Reading …"). Text the model wrote before deciding to call a tool is discarded.
  • Cached summaries keep the sources found through tools. If the MCP is down the summary runs without tools.
  • Browser-sent tool messages are dropped (only system/user/assistant accepted).
  • 13 files, ~500 lines, version 1.10.0. Upstream style: no comments, English locale only, base develop.

Tested on sprite with real degoog (DuckDuckGo), real degoog-mcp 0.4.1 and a scripted mock model: search → scrape → answer, split tool-call chunks, citation numbering, cache replay with sources, chat numbering, dropped browser tool messages, no-URL and MCP-down fallbacks, bun build for both entries.

Not tested yet with a real model (Bifrost CLI can't read its key on sprite). First thing to check is whether task actually decides to call the tools.

Flow. Merge this into pr/ai-summary-mcp; the push mirror carries that branch to jndao/official-extensions, and the upstream PR is opened from jndao:pr/ai-summary-mcp into degoog-org:develop.

Draft for review before anything goes upstream. Upstream issue: degoog-org/degoog#367. **What it does.** A new advanced setting, **Degoog MCP URL** (+ token), lets the AI Summary and the follow-up chat call the [degoog MCP](https://github.com/degoog-org/mcp) sidecar's `search` and `scrape` tools, up to 4 rounds per answer. OpenAI-style providers only (OpenAI compatible, OpenAI, OpenRouter, llama.cpp, vLLM, LM Studio): the change lives in the shared OpenAI chat adapter. Blank URL keeps today's single pass. - `src/mcp.js`: small Streamable HTTP MCP client (initialize, session id, re-initialize on 404, `tools/list` limited to `search` and `scrape`, `tools/call`, bearer token, redirects refused). - `providers/openai-chat.js`: sends `tools`, assembles streamed `tool_calls`. - `src/tools.js`: the loop. Pages found through tools get the next citation numbers after the page's results, so `[N]` chips and hover cards keep working. - Tool steps show in the thinking line ("Searching for …", "Reading …"). Text the model wrote before deciding to call a tool is discarded. - Cached summaries keep the sources found through tools. If the MCP is down the summary runs without tools. - Browser-sent `tool` messages are dropped (only system/user/assistant accepted). - 13 files, ~500 lines, version 1.10.0. Upstream style: no comments, English locale only, base `develop`. **Tested** on sprite with real degoog (DuckDuckGo), real degoog-mcp 0.4.1 and a scripted mock model: search → scrape → answer, split tool-call chunks, citation numbering, cache replay with sources, chat numbering, dropped browser `tool` messages, no-URL and MCP-down fallbacks, `bun build` for both entries. **Not tested yet with a real model** (Bifrost CLI can't read its key on sprite). First thing to check is whether `task` actually decides to call the tools. **Flow.** Merge this into `pr/ai-summary-mcp`; the push mirror carries that branch to `jndao/official-extensions`, and the upstream PR is opened from `jndao:pr/ai-summary-mcp` into `degoog-org:develop`.
Closes degoog-org/degoog#367.

With the new advanced "Degoog MCP URL" set, the summary and follow-up chat
offer the degoog MCP sidecar's `search` and `scrape` tools to OpenAI-style
providers (OpenAI compatible, OpenAI, OpenRouter, llama.cpp, vLLM, LM Studio)
and run up to 4 tool rounds before answering. Blank keeps today's single pass.

- src/mcp.js: small Streamable HTTP MCP client (initialize, session id and
  re-initialize on 404, tools/list limited to search and scrape, tools/call,
  bearer token, redirects refused).
- providers/openai-chat.js: send tools, assemble streamed tool_calls.
- src/tools.js: the tool loop. Pages found through tools get the next citation
  numbers after the page's results, so [N] chips and hover cards keep working.
- Tool steps show in the thinking line ("Searching for ...", "Reading ...").
- Cached summaries keep the sources found through tools.
- If the MCP is unreachable the summary runs without tools.
This pull request is marked as a work in progress.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'feat/ai-summary-mcp:feat/ai-summary-mcp'
git switch 'feat/ai-summary-mcp'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'pr/ai-summary-mcp'
git merge --no-ff 'feat/ai-summary-mcp'
git switch 'feat/ai-summary-mcp'
git rebase 'pr/ai-summary-mcp'
git switch 'pr/ai-summary-mcp'
git merge --ff-only 'feat/ai-summary-mcp'
git switch 'feat/ai-summary-mcp'
git rebase 'pr/ai-summary-mcp'
git switch 'pr/ai-summary-mcp'
git merge --no-ff 'feat/ai-summary-mcp'
git switch 'pr/ai-summary-mcp'
git merge --squash 'feat/ai-summary-mcp'
git switch 'pr/ai-summary-mcp'
git merge --ff-only 'feat/ai-summary-mcp'
git switch 'pr/ai-summary-mcp'
git merge 'feat/ai-summary-mcp'
git push origin 'pr/ai-summary-mcp'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
john/official-extensions!1
No description provided.