How to Crawl a Website with OpenCode
Register crawler-mcp with OpenCode and drive crawls, fetches, and link discovery from your terminal.
OpenCode is a terminal agent that supports MCP servers. Once crawler-mcp is registered, you can ask OpenCode to crawl websites, fetch pages, and discover links - all from the command line.
This guide shows how to set it up and start crawling.
Step 1: Install crawler-mcp
Run the install script:
curl -fsSL https://install.crawler.sh/install-mcp.sh | shThis downloads the correct binary for your platform to ~/.crawler/bin/crawler-mcp.
For more detail, see the installation guide.
Step 2: Wire it into OpenCode
Edit ~/.config/opencode/opencode.json (global) or opencode.json (per-project):
{ "$schema": "https://opencode.ai/config.json", "mcp": { "crawler-sh": { "type": "local", "command": ["/Users/you/.crawler/bin/crawler-mcp"], "enabled": true } }}Use the absolute path from which crawler-mcp. Restart OpenCode for the change to take effect.
For full setup details, see the OpenCode docs.
Step 3: Crawl a website
In OpenCode, ask:
Use crawler-sh to crawl https://example.com to depth 2 and list the page titles.
OpenCode calls crawl_site and returns the results.
Step 4: Fetch a single page
For one-off lookups:
Use crawler-sh to fetch https://example.com/blog/latest-post and summarise it.
OpenCode calls fetch_page and reasons over the Markdown response.
Step 5: Discover links
To map a site’s structure before a deep crawl:
Use crawler-sh to discover_links on https://example.com to depth 1.
OpenCode returns URLs with titles so you can decide which sections to explore.