Add include/exclude pattern support to MCP scrape_docs tool
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- api
Research direction
Start in src/mcp/mcpServer.ts, where the scrape_docs tool schema and ScrapeTool.execute() options are defined. Review the existing include/exclude pattern support in ScrapeTool and src/scraper/utils/patternMatcher.ts, then verify that both optional pattern arrays are exposed to MCP clients and passed through correctly.
Written by the indexing model from the issue text.
Description
Summary
The MCP server's scrape_docs tool currently lacks support for include/exclude patterns, while both the CLI and Web UI already have full pattern support. This creates an inconsistency where MCP clients cannot leverage the powerful pattern filtering capabilities that are available in other interfaces.
Current State
✅ Already Implemented
- CLI: Supports multiple
--include-patternand--exclude-patternflags - Web UI: Supports multi-line textareas with newline or comma-separated patterns
- Core Engine: Robust pattern matching with glob and regex support, OR logic, and exclude precedence
❌ Missing
- MCP Server: The
scrape_docstool insrc/mcp/mcpServer.tsdoesn't exposeincludePatternsorexcludePatternsparameters
Proposed Solution
Add the following optional parameters to the scrape_docs tool schema:
includePatterns: z
.array(z.string())
.optional()
.describe("Glob or regex patterns for URLs to include. Regex patterns must be wrapped in slashes, e.g. /pattern/."),
excludePatterns: z
.array(z.string())
.optional()
.describe("Glob or regex patterns for URLs to exclude. Exclude takes precedence over include. Regex patterns must be wrapped in slashes, e.g. /pattern/."),
And pass them through to the ScrapeTool.execute() call in the options.
Technical Details
- The underlying
ScrapeToolclass already supports these parameters - Pattern matching logic is implemented in
src/scraper/utils/patternMatcher.ts - Supports both glob patterns (via minimatch) and regex patterns (wrapped in
/pattern/) - Multiple patterns work with OR logic (any pattern match wins)
- Exclude patterns take precedence over include patterns
Files to Modify
src/mcp/mcpServer.ts- Add parameters to the tool schema and pass them to ScrapeTool
Benefits
- Provides feature parity across all interfaces (CLI, Web UI, MCP)
- Enables MCP clients (Claude, Cline, etc.) to perform targeted documentation scraping
- Leverages existing, well-tested pattern matching infrastructure
Related
This maintains consistency with the existing pattern support documented in:
- CLI help text for
--include-patternand--exclude-patternflags - Web UI tooltips explaining pattern syntax and multi-line support
- Dominant language
- TypeScript
- Stars
- 1.7k
- Forks
- 183
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 11
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from arabold/docs-mcp-server
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
arabold/docs-mcp-server#508 · 1 comment ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
arabold/docs-mcp-server#494 · 1 comment ·
-
Proxying with nginx Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
arabold/docs-mcp-server#493 · 1 comment · 1 reaction ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
arabold/docs-mcp-server#491 ·
-
Checking indexing Open
Difficulty 3/5 1-2 days Newbie friendliness 45/100
arabold/docs-mcp-server#490 ·
All issues in arabold/docs-mcp-server
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100