How to Add Web Search to GitHub Copilot CLI: Scrapeless MCP Integration Guide
Advanced Bot Mitigation Engineer
Key Takeaways:
- One config file wires live web access into Copilot CLI. Drop a single
scrapelessblock into~/.copilot/mcp-config.jsonand your terminal agent gains a Google SERP scraper, a Trends scraper, HTML/Markdown/Screenshot page helpers, and a full cloud-browser automation surface — no SDK code, no extra service to run. - The agent searches, renders, and drives a browser from plain prompts. Ask it in natural language to search Google, render a JavaScript-heavy page, or click through a multi-step flow, and it composes the right tool calls turn by turn instead of being capped at local files and training-cutoff knowledge.
- Residential proxies and anti-detection are handled cloud-side. Every request routes through the Scrapeless anti-detection cloud browser with residential proxies in 195+ countries, so the agent gets a rendered, usable response on commercial sites without any proxy or fingerprint setup on your machine.
- It runs alongside Copilot's coding tools in the same session. The Scrapeless tools sit next to Copilot CLI's file edits, terminal commands, and codegen, so a single agent turn can scrape the live web and write the result straight into the code you are building.
- 21 tools across SERP, stateless scraping, and browser automation. The Scrapeless MCP server exposes
google_search,google_trends,scrape_html/scrape_markdown/scrape_screenshot, plus 16browser_*automation tools — one namespace the agent's planner draws from per turn. - HTTP-streamable transport covers hosted setups. Stdio via
npxis the default on a workstation; for remote dev containers or CI runners where spawning a child process is awkward, point the same config at the streamable HTTP endpoint instead. - Free to start. New Scrapeless accounts include free Scraping Browser runtime — sign up at Scrapeless.
Introduction: your terminal agent, now with eyes on the live web
GitHub Copilot CLI went GA on 25-FEB-2026 as a terminal-native coding agent, defaulting to Claude Sonnet 4.5. It reads your repository, edits files, runs commands, and reasons over the project in front of it — all without leaving the shell. What it cannot do out of the box is see the live web. Its knowledge stops at the training cutoff and the files on disk.
That gap shows up the moment a task needs current, public data. The agent cannot pull a live SERP, read a competitor's pricing page, check the latest changelog, or render a JavaScript-only app — so answers go stale, anything time-sensitive turns into manual copy-paste from a browser, and the agent flies blind on anything published after its cutoff.
This post closes that gap by wiring the Scrapeless MCP server into GitHub Copilot CLI. One config block gives the agent Google search, JavaScript rendering, and a full cloud browser, all reachable through the same natural-language prompts it already takes for code. For the same Scrapeless surface through other MCP clients, see the Google Antigravity walkthrough and the MCP server walkthrough.
What You Can Do With It
- Live SERP research in the terminal. Ask the agent to run
google_searchfor a query and hand back the top results as JSON, so research happens in the shell instead of a separate browser tab. - Competitor and pricing snapshots. Drop a competitor URL into the prompt and have the agent render the pricing page and extract plan names, prices, and features into a structured record you can drop next to your code.
- Doc and changelog lookups that feed code. Have the agent fetch a library's current docs or release notes as clean markdown and write against the rendered text rather than a stale memory of the API.
- Market and trends checks. Use
google_trendsto pull interest signals for a topic in a target region, then seed feature copy, content templates, or experiment ideas with current evidence. - JS-page extraction into a typed record. Point the agent at a JavaScript-rendered page; the cloud browser hydrates it and the agent parses the result into a typed object for the script you are writing.
- Multi-step browser flows. Chain
browser_goto,browser_click,browser_type, andbrowser_scrollso the agent navigates pagination, expands panels, or steps through a wizard before extracting. - Screenshot capture for review. Use
scrape_screenshotorbrowser_screenshotto grab a rendered page as an image the agent can attach to the conversation or save into the workspace. - Search-then-read pipelines. Combine
google_searchwithscrape_markdownso the agent finds the top results, reads each one, and summarizes them in a single terminal turn.
At Scrapeless, we only access publicly available data while strictly complying with applicable laws, regulations, and website privacy policies. The content in this post is for demonstration purposes only.
Why the Scrapeless MCP Server
The Scrapeless MCP server is a customizable, anti-detection bridge between an AI agent and the live web. For GitHub Copilot CLI specifically, it brings:
- An anti-detection cloud browser with JavaScript rendering. Pages are hydrated in a full Scrapeless Scraping Browser before extraction, so SPAs, infinite-scroll feeds, and lazy-loaded panels become first-class targets for
browser_goto+browser_get_html. - Residential proxies in 195+ countries. Geo-bound queries return the listings a local user would see, with proxy egress handled entirely on the Scrapeless side.
- One stdio command via
npx, no SDK code. The server launches as a child process fromnpx -y scrapeless-mcp-server; there is nothing to build, host, or import into your project. - 21 tools spanning SERP, stateless scraping, and full browser automation.
google_searchandgoogle_trendscover SERP data,scrape_html/scrape_markdown/scrape_screenshotcover one-shot page fetches, and 16browser_*tools cover stateful navigation, clicking, typing, scrolling, and screenshots. - HTTP-streamable transport for hosted agents. When Copilot CLI runs in a remote container or CI runner, the same surface is reachable over the streamable HTTP endpoint instead of stdio.
The free plan is enough to wire this up and run real prompts; compare quotas on the pricing page when you outgrow it. Get your API key on the free plan at app.scrapeless.com.
Prerequisites
- Node.js 18 or newer on the workstation — Copilot CLI installs from npm, and the stdio MCP server is spawned with
npx. - GitHub Copilot CLI installed and an active GitHub Copilot subscription. The CLI authenticates against your GitHub account, and the agent loop draws on Copilot quota; without an active subscription the model step will not run.
- A Scrapeless account and API key — sign up on the free plan at Scrapeless and copy the key from Settings → API Key Management.
- Basic terminal familiarity — the whole setup is a handful of commands plus one small JSON file.
Install
The setup is five sub-steps; each is independently verifiable.
1. Install GitHub Copilot CLI
Install the CLI globally from npm, then launch it:
bash
npm install -g @github/copilot
copilot
The first launch drops you into the interactive Copilot session where the remaining steps run.
2. Authenticate Copilot
Inside the session, sign in with the /login slash command and follow the GitHub device-authorization flow:
text
/login
This requires an active GitHub Copilot subscription — the CLI uses your GitHub identity for both auth and model quota. Copilot CLI defaults to Claude Sonnet 4.5; switch backends any time with the /model slash command.
3. Add the Scrapeless MCP server (stdio)
Copilot CLI reads MCP servers from ~/.copilot/mcp-config.json. Create the file (or add the scrapeless block to an existing mcpServers object) with the stdio configuration:
json
{
"mcpServers": {
"scrapeless": {
"type": "local",
"command": "npx",
"args": ["-y", "scrapeless-mcp-server"],
"env": { "SCRAPELESS_KEY": "YOUR_SCRAPELESS_KEY" },
"tools": ["*"]
}
}
}
One detail trips people up: the Scrapeless MCP server reads its key from SCRAPELESS_KEY, not SCRAPELESS_API_KEY. The Scrapeless CLI and SDK use SCRAPELESS_API_KEY, but the MCP server is the documented exception — use SCRAPELESS_KEY here or the server will start without credentials. The server source lives at github.com/scrapeless-ai/scrapeless-mcp-server.
Substitute your real key for YOUR_SCRAPELESS_KEY. The "tools": ["*"] line exposes the full tool surface. You can also manage servers from inside a session with the /mcp slash commands — /mcp add, /mcp show, /mcp edit, /mcp delete, /mcp enable, and /mcp disable — which write to the same config file.
4. Or use HTTP streamable mode
If the host can't reliably spawn npx — a hosted dev container, a remote workspace, or a CI sandbox — point Copilot at the Scrapeless HTTP endpoint instead of the local process:
json
{
"mcpServers": {
"scrapeless": {
"type": "http",
"url": "https://api.scrapeless.com/mcp",
"headers": { "x-api-token": "YOUR_SCRAPELESS_KEY" },
"tools": ["*"]
}
}
}
The same key value works in both modes; note that HTTP streamable passes it as the x-api-token header rather than the SCRAPELESS_KEY env var. Stdio is the right default on a developer workstation; HTTP streamable is the right default anywhere a long-lived child process is awkward to keep alive.
5. Verify the connection
Launch the CLI and list the connected MCP servers:
text
copilot
/mcp
The scrapeless server should appear with its 21 tools loaded — the Google data tools (google_search, google_trends), the one-shot page helpers (scrape_html, scrape_markdown, scrape_screenshot), and the cloud-browser primitives (browser_create, browser_goto, browser_get_html, browser_get_text, browser_click, browser_type, browser_press_key, browser_scroll, browser_scroll_to, browser_screenshot, browser_snapshot, browser_wait, browser_wait_for, browser_go_back, browser_go_forward, browser_close). If the server is listed and the tools enumerate, the wiring is good and the API key is valid.
How you actually use this: prompt your Copilot CLI agent
After wiring the MCP server, you get live web data by talking to Copilot CLI in the terminal — not by hand-writing tool calls. The agent reads the tool list the Scrapeless MCP server exposes and chooses google_search, scrape_markdown, or the browser_* tools as needed, composing them turn by turn from the natural-language prompt. There is no tool JSON to author on your side and no manual MCP call to issue. (Copilot CLI runs prompts interactively in a session, or non-interactively with copilot -p "<prompt>" for one-shot runs and scripting.)
Prompts you can paste
| Prompt | What the agent does |
|---|---|
"Find the top Google results for vector database benchmarks 2026 and return them as JSON." |
google_search with q, hl, gl → typed result rows. |
"What search topics are rising for developer tools in the US right now?" |
google_trends. |
"Pull the React docs page at https://react.dev/learn/synchronizing-with-effects as clean markdown." |
scrape_markdown. |
"Open https://pricing.example.com, it's a JavaScript app — render it and extract plan name, price, and features as JSON." |
browser_create → browser_goto → browser_get_html → typed extract. |
"Compare the pricing pages at https://a.example.com/pricing and https://b.example.com/pricing and tell me where they differ." |
browser_create → browser_goto (page A) → browser_get_html → browser_goto (page B) → browser_get_html → diff. |
"Take a full-page screenshot of https://example.com/landing." |
scrape_screenshot. |
"Grab the rendered HTML of https://example.com so I can read the markup." |
scrape_html. |
"Open https://example.com/jobs, wait for the listings to load, snapshot the page, then extract every job title and location as JSON." |
browser_create → browser_goto → browser_wait_for → browser_snapshot → typed extract → browser_close. |
Worked example
You type:
bash
copilot -p "Find the top organic results for 'web scraping python' and summarize the top 3 with links."
The agent's plan (in plain English):
- Call
google_searchwithq: "web scraping python",hl: "en",gl: "us". - Receive an array of result rows and read the
position,title,link, andsnippetfields. - Sort by
positionand keep the first three rows. - Summarize each result from its
snippetand pair the summary with the row'stitleandlink. - Return the three summaries with their links to the terminal.
What you get back (illustrative shape — the agent works from rows like these):
json
[
{
"position": 1,
"title": "Python Web Scraping Tutorial",
"link": "https://www.example.com/python-web-scraping",
"snippet": "A step-by-step guide to scraping web pages with Python, requests, and a parser.",
"source": "example.com"
},
{
"position": 2,
"title": "Beautiful Soup Documentation",
"link": "https://www.example.org/beautifulsoup/docs",
"snippet": "Reference for parsing HTML and XML documents in Python.",
"source": "example.org"
},
{
"position": 3,
"title": "Scraping Dynamic Sites in Python",
"link": "https://blog.example.net/dynamic-scraping",
"snippet": "How to render JavaScript pages before extracting data.",
"source": "example.net"
}
]
// Field names match the google_search row shape; values are illustrative samples.
The stateless data tools (google_search, google_trends, scrape_html, scrape_markdown) return their payload as a body prefixed with Response:\n\n; the agent unwraps that prefix before parsing the JSON, so you never see it in the answer.
Shaping prompts
| Say this | Effect |
|---|---|
| "…from Germany" / "…German results" | Routes egress through proxyCountry and sets gl=de on the search. |
| "…as markdown, skip the nav and boilerplate" | Picks scrape_markdown for a clean text payload instead of raw HTML. |
| "…render it first, it's a single-page app" | Forces the browser_* path (browser_create → browser_goto → browser_get_html) so extraction runs against the hydrated DOM. |
| "…top 5 only" | Trims the returned array to the first five rows. |
| "…include the snippet for each result" | Keeps the snippet field in the output rows. |
| "…close the session when you're done" | Adds a final browser_close with the sessionId from browser_create. |
Everything below is the under-the-hood reference — the tool surface, the exact return shapes, and the edge cases the agent handles for you.
The Scrapeless MCP tool surface
Once the server is connected, GitHub Copilot CLI sees 21 tools spanning SERP data, stateless scraping, and full anti-detection cloud browser control.
| Tool | What it does |
|---|---|
google_search |
Runs a Google search (q, hl, gl) and returns structured organic result rows. |
google_trends |
Pulls Google Trends interest data for a query. |
scrape_html |
Fetches a URL and returns its rendered HTML. |
scrape_markdown |
Fetches a URL and returns clean Markdown for the page. |
scrape_screenshot |
Captures a screenshot of a target URL. |
browser_create |
Opens a session on the anti-detection cloud browser. |
browser_goto |
Navigates the session to a URL. |
browser_click |
Clicks an element in the live page. |
browser_type |
Types text into an input or editable field. |
browser_get_text / browser_get_html |
Reads the page's text or HTML. |
browser_screenshot |
Captures a screenshot of the live session. |
browser_snapshot |
Returns an accessibility/structure snapshot of the page. |
browser_wait / browser_wait_for |
Waits a fixed interval, or for a condition/element. |
browser_scroll / browser_scroll_to |
Scrolls the page, or to a specific element. |
browser_go_back / browser_go_forward |
Moves through session history. |
browser_press_key |
Sends a keyboard key to the page. |
browser_close |
Ends the cloud browser session. |
Get your API key on the free plan: Scrapeless
What You Get Back
A google_search call returns a JSON array of organic result rows. Each row carries the same keys, so the agent can map straight to title, link, and snippet:
json
// Field names reflect the google_search tool output; values are illustrative samples.
[
{
"position": 1,
"title": "Python Web Scraping Tutorial",
"link": "https://example.com/python-web-scraping",
"snippet": "A step-by-step guide to scraping the web with Python and parsing HTML.",
"source": "example.com"
},
{
"position": 2,
"title": "Web Scraping Best Practices",
"link": "https://example.org/best-practices",
"snippet": "How to scrape responsibly: rate limits, robots.txt, and structured output.",
"source": "example.org"
}
]
A few honest observations once you start running prompts:
- Stateless tools like
google_searchandscrape_markdownreturn a body prefixed withResponse:\n\nfollowed by the JSON payload; the agent unwraps that prefix automatically, so you work with the data, not the wrapper. - The
browser_*tools return plain text with noResponse:\n\nprefix. - Tool arguments are camelCase: pass
sessionId,proxyCountry, and similar fields exactly as named. proxyCountryis a request, not a guarantee — it can defer to the region configured on your account.- Values in tool output are content-dependent: result counts, ordering, and snippet text vary with the live query.
Conclusion: search, render, and browse from the terminal
The whole integration reduces to one MCP config block plus natural-language prompts. With the scrapeless-mcp-server entry in place and your key in the environment, GitHub Copilot CLI gains live Google search, JavaScript rendering, and a full anti-detection cloud browser — all without leaving the terminal or wiring up a single HTTP client by hand. You describe the task; the agent picks the tool.
If you are wiring up other agents, the same Scrapeless MCP server drops into them too: see the Google Antigravity and Pi Agent integrations, and the Scrapeless MCP server overview for the full tool reference. Keep your API key in SCRAPELESS_KEY, prefer stdio transport for local CLIs and HTTP-streamable for hosted agents, and let the agent pick the tools. Full reference at docs.scrapeless.com.
FAQ
Is web scraping via the agent legal?
Scraping publicly available data is generally permissible, but you are responsible for how you use it. Review each site's Terms of Service and respect robots.txt, and remember that rules around personal data and access vary by jurisdiction. When in doubt, get legal advice for your specific use case.
Do you need a Scrapeless API key, and which environment variable holds it?
Yes. The Scrapeless MCP server authenticates with your account key, which you set in SCRAPELESS_KEY. Without it, the server starts but its tools cannot reach the Scrapeless backend.
Do you need a GitHub Copilot subscription?
Yes. GitHub Copilot CLI runs its turns against Copilot's model, which requires an active Copilot subscription with available quota. The MCP server and its tools are separate; the subscription covers the agent's model, not the Scrapeless calls.
stdio vs HTTP streamable — when should you use each?
Use stdio when the server runs locally alongside the CLI: the agent launches scrapeless-mcp-server as a child process and talks to it over standard input/output. Use the HTTP streamable transport (https://api.scrapeless.com/mcp with the x-api-token header) when the agent is hosted or remote and cannot spawn a local process. For a local Copilot CLI setup, stdio is the simplest choice.
Can the agent run a full browser flow, not just search?
Yes. The 16 browser_* tools let the agent open a session, navigate, click, type, scroll, wait for elements, snapshot, screenshot, and close — a complete cloud browser flow driven entirely by natural-language prompts.
Does proxyCountry always apply?
Not necessarily. proxyCountry is a preference that can defer to the region configured on your account. If geo-targeting matters, confirm the egress region rather than assuming the per-call value always wins.
Can you use this without an AI agent?
Yes. The Scrapeless MCP server is a standard MCP server, so any MCP-compatible client can call it — or you can drive it directly over JSON-RPC (initialize, then tools/list and tools/call). The agent is a convenience, not a requirement.
Ready to Build Your AI-Powered Data Pipeline?
Join our community to claim a free plan and connect with developers building GitHub Copilot CLI + Scrapeless MCP agents: Discord · Telegram.
Sign up at Scrapeless for free Scraping Browser runtime and adapt the integration above to the SERPs, pages, and regions your team needs. Full reference at docs.scrapeless.com.
At Scrapeless, we only access publicly available data while strictly complying with applicable laws, regulations, and website privacy policies. The content in this blog is for demonstration purposes only and does not involve any illegal or infringing activities. We make no guarantees and disclaim all liability for the use of information from this blog or third-party links. Before engaging in any scraping activities, consult your legal advisor and review the target website's terms of service or obtain the necessary permissions.



