Add standalone MCP docs source discovery#2598
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
PR Summary by QodoAdd standalone MCP docs source discovery (bounded sitemap/page-link)
AI Description
Diagram
High-Level Assessment
Files changed (16)
|
There was a problem hiding this comment.
Code Review
This pull request implements Stage 4B bounded source discovery for the standalone MCP docs corpus, introducing the DocsSourceDiscoveryService to support sitemap and page-link discovery, adding settings and models, wiring up the docs.discover_source MCP tool, and extending docs.sync_source to refresh url_sitemap sources. The review feedback highlights several opportunities to improve robustness and error handling, including safely handling non-string XML tags, catching ValueError on malformed URL ports, checking for None on retrieved documents to prevent AttributeError crashes, and properly propagating sitemap parsing failures rather than returning a successful status with empty candidates.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Code Review by Qodo
Context used✅ Compliance rules (platform):
74 rules 1.
|
132350a to
e5a2c1b
Compare
|
Addressed the review feedback in e5a2c1b after rebasing on latest dev:
Verification:
I did not add docstrings to every pytest function; that is inconsistent with the existing test style and adds no useful safety. |
e5a2c1b to
5dc8ac6
Compare
Summary
Test Plan
Change summary
This PR adds a local-docs/source-discovery layer for the standalone MCP docs corpus without coupling it to tldw_server runtime services. Discovery is opt-in and bounded by config so locked-down deployments remain safe by default. The implementation reuses the existing URL policy/fetch/acquisition seams, keeps BeautifulSoup/trafilatura optional via lazy imports/fallbacks, and uses SQLite-backed docs/source records so agents can discover, register, ingest, and refresh general document collections for FTS/RAG workflows.
Summary by cubic
Adds standalone, opt-in MCP docs source discovery via
docs.discover_source. Enables bounded sitemap and page-link discovery with dry-run/apply, integratesurl_sitemapsync refresh and apply-time ingestion, and hardens XML parsing.New Features
docs.discover_sourceprovider/host exposure.auto/sitemap/page_links;dry_run/apply; apply actionsregister/ingest/register_and_ingest; bounded bymax_discovery_pages,max_discovery_depth,max_discovery_sitemaps.docs.sync_sourceforurl_sitemaprefresh and apply-time ingestion; keepsbeautifulsoup4/trafilaturaoptional via lazy imports; SQLite-backed records.discovery_apply_defaultisregister.Bug Fixes
defusedxml; blocks DOCTYPE/unsafe constructs and applies strict size bounds.Written for commit 5dc8ac6. Summary will update on new commits.