webscout-mcp
webscout-mcp
AIエージェント向けのWeb検索・取得ツールを、MCPサーバーとして提供します。検索、取得、クロール、構造化データの抽出を実行できます。APIキー不要、リクエストごとの課金なし、すべての処理はお使いのマシン上で完結します。
インストール
pip install webscout-mcpPython 3.10以上が必要です。
Related MCP server: mcp-web-search
クイックスタート
MCPクライアント設定(Claude Code、Cursor、Codexなど)に追加します:
{
"mcpServers": {
"webscout": {
"command": "webscout-mcp",
"args": []
}
}
}これだけです。エージェントは6つのツールを利用できます:
web_search- Bingで検索し、自動的にDuckDuckGo HTMLにフォールバック。キー不要web_fetch- ページを取得し、メイン記事を抽出(markdown/text/html)web_crawl- 並行BFSクロール。深さとページ数の制限付き、robots.txtを尊重web_extract- CSSセレクタ、属性、正規表現で構造化データを抽出cache_stats- ローカルキャッシュを検査cache_clear- キャッシュを消去
CLIの使い方
MCPサーバーとして実行するだけでなく、webscout-mcpをコマンドラインから直接使用することもできます:
# Search the web (outputs JSON)
webscout-mcp search "python async libraries" --max-results 5
# Fetch a page (raw content)
webscout-mcp fetch https://example.com --extract --format markdown --raw
# Crawl a site
webscout-mcp crawl https://example.com --depth 2 --pages 10
# Start MCP server (default if no command given)
webscout-mcp serve --transport stdio使用例
検索
web_search(query="best python async libraries", max_results=5)タイトル、URL、スニペット、およびどのバックエンドがリクエストを処理したか(bing または duckduckgo)を含む構造化された結果を返します。Bingが失敗したりマークアップが変更された場合、エンジンは自動的にDuckDuckGoのHTMLバージョンにフォールバックします。設定は不要です。
ページを取得
web_fetch(url="https://example.com", extract=true, output_format="markdown")extract=true を指定すると、trafilatura(readability-lxmlにフォールバック)がナビゲーション、広告、サイドバーを除去します。生のHTMLではなく、クリーンな記事コンテンツが得られます。
構造化データを抽出
web_extract(
url="https://example.com/products",
rules='[
{"name": "titles", "selector": ".product h2", "multiple": true},
{"name": "prices", "selector": ".price", "regex": "\\$([\\d.]+)", "multiple": true},
{"name": "links", "selector": "a.product", "attribute": "href", "multiple": true}
]'
)各ルールは selector、attribute、multiple、regex、default をサポートしています。
サイトをクロール
web_crawl(seed_url="https://example.com", max_depth=2, max_pages=10, concurrency=5)各深さレベルのページは並行して取得されます(concurrency で制御、デフォルト5)。クローラーはデフォルトで robots.txt を尊重します。許可されていないURLはスキップされ、skipped_robots にカウントされます。同一ドメイン制限はデフォルトで有効です。
Pythonライブラリとして使用
import asyncio
from webscout_mcp import Config, Fetcher, SearchEngine
async def main():
config = Config.from_env()
config.ensure_dirs()
fetcher = Fetcher(config)
result = await fetcher.fetch("https://example.com", extract=True)
print(result.title)
print(result.content[:500])
await fetcher.close()
search = SearchEngine(config)
results = await search.search("python async", max_results=5)
for r in results:
print(f"{r.position}. {r.title} - {r.url} ({r.backend})")
await search.close()
asyncio.run(main())仕組み
検索 はまずBingを試し、次にDuckDuckGo HTMLを試します。どちらも直接HTTPスクレイピングで、APIキーは不要です。結果はクエリごとにキャッシュされます。
取得 はhttpxを使用し、指数バックオフのリトライ(すべてのhttpxエラー + HTTP 5xx)、ドメインごとのトークンバケットレート制限、5MBのコンテンツ上限を備えています。
コンテンツ抽出 はtrafilaturaを優先し、readability-lxmlに自動フォールバックします。これは多くの「後で読む」サービスが使用しているのと同じライブラリです。
キャッシュ はTTLとサイズ上限付きのSQLiteで、古いエントリは自動的に削除されます。繰り返しの取得や検索はコストがかかりません。
クロール は並行BFSで、深さ、ページ数、並行度、同一ドメイン制限、robots.txt準拠を設定できます。各ページの二重取得を避けるため、最初の取得からの生HTMLを使用します。
プロキシサポート すべてのHTTP/HTTPSリクエストを、設定または環境変数でプロキシ経由にルーティングします。
ログ は構造化されており、
WEBSCOUT_LOG_LEVEL(DEBUG/INFO/WARNING/ERROR)とWEBSCOUT_LOG_JSON=1(JSON出力用)で設定できます。
すべてローカルで実行されます。データがマシンの外に出ることはありません。
設定
すべての設定には適切なデフォルトがあります。環境変数(WEBSCOUT_ プレフィックス)、TOML設定ファイル、またはCLIフラグで上書きできます。
設定ファイル
~/.config/webscout/config.toml(または $XDG_CONFIG_HOME/webscout/config.toml)を作成します:
[cache]
ttl = 7200
max_size_mb = 512
[fetch]
timeout = 15.0
max_retries = 3
[proxy]
http = "http://proxy:8080"
https = "http://proxy:8080"
[search]
max_results = 10
backends = ["bing", "duckduckgo"]
[crawler]
max_depth = 2
max_pages = 20
concurrency = 5
respect_robots = true
[logging]
level = "WARNING"
json = false環境変数は設定ファイルの値を上書きします。
環境変数
変数 | デフォルト | 説明 |
|
| SQLiteキャッシュの場所 |
|
| キャッシュエントリの有効期間(秒) |
|
| 削除前の最大キャッシュサイズ |
|
| HTTPタイムアウト(秒) |
|
| リクエストごとのリトライ回数 |
|
| ドメインごとの1秒あたりの最大リクエスト数 |
|
| デフォルトの検索結果数 |
|
| カンマ区切りのバックエンド順 |
|
| デフォルトのクロール深さ |
|
| クロールごとのデフォルト最大ページ数 |
|
| 深さレベルごとの並行取得数 |
|
| クローラーがrobots.txtを尊重するか |
|
| デフォルトの抽出出力形式 |
| (空) | HTTPプロキシURL |
| (空) | HTTPSプロキシURL |
|
| ログの詳細度 |
|
|
|
CLIフラグは環境変数を上書きします:
webscout-mcp --cache-ttl 3600 --cache-dir /tmp/webscout serveトランスポート
# stdio (default - works with Claude Code, Cursor, etc.)
webscout-mcp
# SSE (for remote or browser-based clients)
webscout-mcp serve --transport sse --host 0.0.0.0 --port 8000変更履歴
0.3.0
TOML設定ファイルのサポート: 環境変数に加えて
~/.config/webscout/config.tomlで設定可能HTTP/HTTPSプロキシサポート: すべてのリクエストをプロキシ経由でルーティング
二重コンテンツ抽出: trafilaturaを優先し、readability-lxmlに自動フォールバック
検索結果の重複排除: 重複URLを削除し、位置を再番号付け
リージョン対応検索:
regionパラメータが実際にBingとDuckDuckGoに渡されるようになったクローラーのパフォーマンス向上: ページごとの二重取得を排除 - 約2倍高速なクロール
リトライロジックの改善: すべてのhttpxエラーとHTTP 5xxでリトライ
コンテンツタイプ検出の修正: 適切なHTML/XML検出
0.2.0
マルチバックエンド検索: Bing + DuckDuckGo HTML、自動フェイルオーバー
並行クローラー、並列度を設定可能
robots.txt準拠(設定可能、デフォルトでオン)
CLIサブコマンド:
search、fetch、crawl、serveコンソールとJSONフォーマッタによる構造化ログ
エラーハンドリング改善のためのカスタム例外階層
新しい設定:
WEBSCOUT_SEARCH_BACKENDS、WEBSCOUT_CRAWLER_CONCURRENCY、WEBSCOUT_RESPECT_ROBOTS
0.1.0
初回リリース: web_search、web_fetch、web_crawl、web_extract、cache_stats、cache_clear
TTLとサイズベースの削除を備えたSQLiteキャッシュ
ドメインごとのトークンバケットレート制限
指数バックオフリトライ
trafilaturaによるコンテンツ抽出
開発
git clone https://github.com/wxs-lang/webscout-mcp.git
cd webscout-mcp
pip install -e ".[dev]"
pytestライセンス
MIT
Available Tools
17 toolsbroken_linksA
Check for broken links on a web page.
Extracts all links from the page, checks each one's HTTP status, and returns a report with broken links, redirects, and link statistics.
Inputs: url (required), timeout. Returns: result
cache_clearA
Clear all cached entries. Returns the number of entries deleted.
Inputs: no named parameters. Returns: result
cache_statsA
Return cache statistics: entry count, total size, TTL, and limits.
Inputs: no named parameters. Returns: result
content_qualityA
Analyze content quality of a web page.
Evaluates readability scores (Flesch-Kincaid, Gunning Fog), keyword density, content structure, metadata quality, and provides actionable suggestions for improvement.
Inputs: url (required). Returns: result
metadata_extractA
Extract metadata from a web page.
Extracts JSON-LD, OpenGraph, Twitter Cards, article metadata, images, links, and other structured metadata from the page. Relative URLs are resolved against the final (post-redirect) URL. SSRF safety is enforced on the initial URL and every redirect hop.
Inputs: url (required). Returns: result
recovery_policyA
Get the fetch recovery policy table: thresholds, marker sets, reason→action rules, and classification stages, as data.
This is the single source the recovery classifier is bound to (the modules import their thresholds from this table, enforced by identity tests). Returns the rendered markdown table plus any drift warnings found while assembling it. Read-only, zero-arg — use it to answer "why did this request escalate?" or to review the policy without reading the classifier source.
Inputs: no named parameters. Returns: result
rss_parseA
Parse an RSS or Atom feed and return its entries.
Fetches and parses RSS 2.0, RSS 1.0, and Atom feeds. Returns feed title, description, link, and a list of entries with title, link, description, publication date, and author.
Inputs: url (required), max_entries. Returns: result
search_healthA
Get health report for all search backends.
Returns overall health score, per-backend status (healthy/degraded/open/half-open), circuit breaker state, and request statistics. Use this to diagnose search failures.
Reports the active SearchService health first, with legacy SearchEngine health included as fallback reference during the migration period.
Inputs: no named parameters. Returns: result
web_compare_sitesA
Compare several websites side by side on SEO, performance, content and links.
Fetches each URL, computes metrics, and returns a ranked comparison with a per-metric matrix and prioritised recommendations. Use this to benchmark a page against competitors, or to check whether your own pages regress.
Scores are 0-100 per axis and a weighted overall. Comparisons are only as good as the markup available to a plain HTTP fetch: a JavaScript-rendered page may look thin even when it is not, and that will be visible as a low content score.
A URL that cannot be fetched is reported as an entry with an error and its
recovery reason, rather than failing the whole comparison.
Inputs: urls (required), names. Returns: result
web_crawlB
Crawl a website starting from a seed URL, respecting depth and page limits.
Fetches pages concurrently within each depth level. Respects robots.txt by default.
Inputs: seed_url (required), extract, max_depth, max_pages, +2 more. Returns: result
web_extractC
Extract structured data from a web page using CSS selectors.
Inputs: url (required), rules (required). Returns: result
web_extract_schemaA
Extract data matching a JSON Schema without writing selectors.
Pass the shape you want and get back an object; no CSS rules, no LLM key. Each field is resolved from the best available source, tried in this order:
json-ld- the page's own structured data, so nothing is guessedmeta- OpenGraph / Twitter cardssemantic-html- h1, , itemprop, and a few class-name hints
The response records sources per field, so a caller can tell a stated value from an
inferred one, and lists missing fields explicitly rather than leaving silent nulls.
Use web_extract instead when you already know the page's selectors: it is exact,
whereas this infers. A field whose structure this has never seen comes back null -
it will not invent a plausible value.
schema is JSON: {"type": "object", "properties": {"price": {"type": "number"}}}.
Inputs: url (required), schema (required). Returns: result
web_fetchA
Fetch a URL and return one window of its extracted main content.
Progressive delivery: each call returns at most max_chars chars
(default 8000). If the response contains continuation.has_more=true,
more content is available locally. To read the next window, call this
SAME tool again with the SAME url/extract/output_format/max_chars and set
start_char to the previous continuation.next_start_char. Follow-up
windows are served from a local snapshot (no new HTTP fetch, extraction,
or browser). Stop when has_more is false. You do not need to read the
whole page unless the task requires it.
Inputs: url (required), extract, max_chars, start_char, +2 more. Returns: result
web_knowledge_graphA
Build a knowledge graph of entities and relationships from a page or text.
Extracts named entities (people, organizations, locations, technologies) and the relationships between them, then ranks entities by centrality.
Provide either url (fetched first) or text (used directly). This is useful
for mapping who/what a document is about and how they connect, rather than
reading it linearly.
Relationship types are currently co_occurs_with only: relationships come
from proximity, not from parsing sentence semantics. Entity types are
rule-based, so some are reported as unknown rather than guessed.
Inputs: url, text, max_entities, include_centrality. Returns: result
web_monitorA
Check a URL for changes since the last check, and return what changed.
Compares the page against the last snapshot stored on disk and reports text changes, price moves, and keyword appearances or disappearances. Useful for tracking a page across sessions: docs, prices, availability, job postings.
This checks once per call. It does not schedule itself - an MCP tool is passive. To monitor continuously, call it again from your MCP client or an external scheduler. The first call for a URL only records a baseline and returns no changes.
Use ignore_text (regexes) for values that change on every request such as
timestamps or session ids, and ignore_selector (CSS) for regions that churn
independently such as ad slots. Without them most pages report a change every
time, which is why they exist.
Price watching is independent of min_change_size: a one-character move like
$100.00 to $900.00 is exactly what a text threshold would swallow, so it is
compared as a percentage when price_selector is set.
json_path watches one value inside a JSON response instead of the whole body:
json:$.product.price uses JSONPath, jq:.product.price uses jq (needs the
[json] extra; JSONPath needs it too). Reducing an API response to one field is
what makes it stable enough to monitor - markup and prose churn, a price field
does not. Without json_path the whole body is compared as before.
notify takes target URLs such as webhook://example.com/hook,
dingtalk://oapi.dingtalk.com/robot/send?access_token=X, telegram://TOKEN@CHAT
or smtp://user:pass@host:587?to=a@b.c. When a change is found it is pushed to
those channels, and the send result is reported in notifications. Credentials
stay in the URL and are never echoed back.
Inputs: url (required), notify, json_path, state_path, +7 more. Returns: result
web_rag_contextA
Retrieve the passages of a page most relevant to a query, compressed to fit a context window.
Splits the content into sentence-aligned passages, ranks them against query,
and returns the best ones together with a compressed context block. Use this
when a page is too long to hand to a model whole, or when you need to find the
specific passages that answer a question.
Provide either url (fetched first) or text (used directly). query is
required: this tool retrieves, it does not summarise.
Ranking is lexical (stop-word-filtered IDF over content terms), not embedding
based, so a query phrased with different vocabulary than the document will miss.
Use compressed_context as the text to pass to a model; chunks are for
inspection and citation.
Inputs: url, text, query, top_k, +1 more. Returns: result
web_searchB
Search the web and return structured results.
SearchService uses health-based provider ranking, deterministic recovery classification, and automatic fallback across registered search providers. Empty/invalid queries are rejected without network calls. No API key required for the default HTML providers.
Inputs: query (required), region, max_results, safe_search. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Most tools target a clearly distinct operation: fetch vs crawl vs search vs monitor vs RSS vs cache management. The main overlap cluster is the page-analysis family (web_extract vs web_extract_schema vs metadata_extract), but descriptions explicitly disambiguate them (exact selectors vs schema inference vs metadata dump). recovery_policy and search_health both serve diagnostics, though their scopes are stated as policy table vs backend status.
There is a recognizable `web_` prefix convention for the core scraping tools, but eight tools (cache_stats, cache_clear, recovery_policy, broken_links, search_health, metadata_extract, rss_parse, content_quality) drop it. Verb ordering is also mixed between noun_verb (web_search, rss_parse) and noun_noun (cache_stats, content_quality, search_health), so the pattern is readable but not predictable.
At 17 tools this is on the heavier side, but the domain (web fetching, extraction, analysis, monitoring) genuinely spans that many operations and each tool has a defensible role. The analysis/audit cluster (broken_links, content_quality, web_compare_sites, metadata_extract) is where trimming could be argued.
The surface covers the full pipeline: search, fetch with continuation, crawl, selector-based and schema-based extraction, metadata, RSS, content analysis, monitoring, plus cache and health introspection. Minor gaps exist (no sitemap/robots introspection tool, no explicit pagination for search beyond what descriptions imply), but agents can work around these.
Maintenance
Related MCP Connectors
Web scraping, search, crawling, structured extraction and research for AI agents.
Web search, browser automation, scraping, crawling and CAPTCHA solving for AI agents.
Web data for agents. Extract web pages, crawl websites, discover URLs, and search the web.
Web search and any page as LLM-ready Markdown for AI agents. Free keyless tier, no signup.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to perform web searches, extract webpage content, and conduct end-to-end search-and-extract operations using multiple search providers and content extraction methods.-
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to search the web, read and extract content from webpages, fetch JSON from REST APIs, and collect links while bypassing anti-bot protections.-
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to search multiple web providers in parallel and crawl single pages or entire sites into clean, deduplicated Markdown or JSON, including authenticated crawls.-
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to search the web through configured providers and crawl individual pages or whole sites into clean Markdown or JSON, including authenticated content and deduplicated output.-