webscout-mcp
Web search and fetch tools for AI agents, as an MCP server. Search, fetch, crawl, and extract structured data from the web — no API keys, no per-request billing, everything stays on your machine.
Install
pip install webscout-mcp
Requires Python 3.10+.
Quick start
Add to your MCP client config (Claude Code, Cursor, Codex, etc.):
{
"mcpServers": {
"webscout": {
"command": "webscout-mcp",
"args": []
}
}
}
That's it. Your agent gets six tools:
web_search— search via Bing, no key neededweb_fetch— fetch a page and extract the main article (markdown/text/html)web_crawl— bounded BFS crawl with depth and page limitsweb_extract— pull structured data with CSS selectors, attributes, regexcache_stats— inspect the local cachecache_clear— wipe the cache
Usage examples
Search
web_search(query="best python async libraries", max_results=5)
Returns structured results with title, URL, and snippet.
Fetch a page
web_fetch(url="https://example.com", extract=true, output_format="markdown")
extract=true runs trafilatura to strip nav, ads, and sidebars — you get clean article content, not raw HTML.
Extract structured data
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}
]'
)
Each rule supports selector, attribute, multiple, regex, and default.
Crawl a site
web_crawl(seed_url="https://example.com", max_depth=2, max_pages=10)
Respects same-domain by default. All fetched pages go through the same cache and rate limiter.
Use as a Python library
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}")
asyncio.run(main())
How it works
- Search uses Bing via direct HTTP (no API key). Results are cached by query.
- Fetching uses httpx with exponential-backoff retries, per-domain token-bucket rate limiting, and a 5 MB content cap.
- Content extraction uses trafilatura — the same library behind many read-it-later services.
- Caching is SQLite with TTL and a size cap; old entries are evicted automatically. Repeat fetches and searches cost nothing.
- Crawling is BFS with configurable depth, page count, and same-domain restriction.
Everything runs locally. No data leaves your machine.
Configuration
All settings have sensible defaults. Override via environment variables (WEBSCOUT_ prefix) or CLI flags:
| Variable | Default | What it does |
|---|---|---|
WEBSCOUT_CACHE_DIR |
~/.cache/webscout |
Where the SQLite cache lives |
WEBSCOUT_CACHE_TTL |
7200 |
Cache entry lifetime in seconds |
WEBSCOUT_CACHE_MAX_SIZE_MB |
512 |
Max cache size before eviction |
WEBSCOUT_REQUEST_TIMEOUT |
15.0 |
HTTP timeout in seconds |
WEBSCOUT_MAX_RETRIES |
3 |
Retry attempts per request |
WEBSCOUT_RATE_LIMIT_PER_SECOND |
2.0 |
Max requests per second per domain |
WEBSCOUT_SEARCH_MAX_RESULTS |
10 |
Default search result count |
WEBSCOUT_CRAWLER_MAX_DEPTH |
2 |
Default crawl depth |
WEBSCOUT_CRAWLER_MAX_PAGES |
20 |
Default max pages per crawl |
CLI flags override env vars:
webscout-mcp --cache-ttl 3600 --cache-dir /tmp/webscout
Transports
# stdio (default — works with Claude Code, Cursor, etc.)
webscout-mcp
# SSE (for remote or browser-based clients)
webscout-mcp --transport sse --host 0.0.0.0 --port 8000
Development
git clone https://github.com/wxs-lang/webscout-mcp.git
cd webscout-mcp
pip install -e ".[dev]"
pytest
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file webscout_mcp-0.1.0.tar.gz.
File metadata
- Download URL: webscout_mcp-0.1.0.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bb30dd8cba94f7b16322ff0d2e34850c4aa29350afc31ad7623b0a26ca4e0ca
|
|
| MD5 |
33517c0acdd7dcceb5517a1afff14162
|
|
| BLAKE2b-256 |
cb87e00abec2c8c81acd6555b7012b8e0c0c7ad0404dce58ddb23e22f87d68b9
|
File details
Details for the file webscout_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: webscout_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ae06e2835e79e79ae7676e3c16b5be19171a73306f51afb75fb09dd24cf28a3
|
|
| MD5 |
10e142f9f637b88c8569c974c032c603
|
|
| BLAKE2b-256 |
367ec2cec9fd290f556fcd725a82d73c81d6c629e2733b2f42ea21242ff38b21
|