Web Scraping with MCP: A Guide for AI Agent Workflows
TL;DR
MCP lets an AI client call external collection tools; the protocol itself does not retrieve pages or guarantee accurate extraction.
Nstdata Crawl MCP supports hosted Streamable HTTP and local stdio connections, with different setup requirements.
A scrape submission, a task-status request, and a large-result read are distinct operations with different failure boundaries.
Start from known URLs because the Nstdata MCP server does not provide web search.
Bound website discovery with page limits, depth limits, and URL filters before an agent starts collecting.
Treat retrieved pages as untrusted data, and require evidence for every field the model extracts.
What does web scraping with MCP actually mean?
Web scraping with MCP means an AI application calls a collection service through Model Context Protocol tools and uses the returned content in a controlled workflow.
MCP supplies a common interface between a client and tools. A tool server supplies the actual capability. The collector still needs network access, rendering when necessary, and a result contract. The model then interprets content; it should not replace missing tool results with remembered facts.
For example, Nstdata Crawl is a Web Crawling API for LLM-ready data exposed through MCP as well as programmatic APIs. The agent can retrieve a page, check a task, and read a returned artifact without implementing the collection infrastructure itself.
The MCP tools specification defines the tool interface. It does not certify the factual correctness of what an agent writes after calling a tool.
How does an MCP scraping workflow move from URL to answer?
An MCP scraping workflow moves through authorization, tool discovery, submission, result retrieval, content inspection, and evidence-backed extraction.
Keep transport and collection separate
A hosted server uses a network transport, while a local stdio server runs as a process managed by the client. Both can expose collection tools. Running a local adapter does not necessarily mean the webpage is fetched locally; Nstdata's local Crawl tools still use the cloud service.
The MCP transport specification explains the communication layer. A connection error occurs before page collection. A failed page task occurs after the tool was reached. Log these stages separately.
Keep task success and data acceptance separate
A completed task can return a page that lacks the required field. A Markdown reference is a pointer to content, not the content itself. A successful JSON parse confirms syntax, not a statement's truth.
Use a sequence that makes each boundary visible:
Stage
Input
Accept when
Connect
Server configuration
Client discovers expected tools
Submit
URL and collection options
Tool returns a valid result or task ID
Resume
Existing task ID
Task reaches a usable terminal result
Read
Returned artifact reference
Required content is retrieved within budget
Extract
Page text and requested schema
Fields have source evidence
Validate
Candidate records
Types, identity, and business rules pass
What do you need before connecting Crawl MCP?
You need an MCP-capable client, a Nstdata API key with Crawl access, available credits, and permission to collect your chosen pages.
For hosted access, the client must support Streamable HTTP and the configured authorization method. For local access, the current official setup requires a supported Node.js runtime and npx on the client's PATH. A desktop application does not necessarily inherit environment variables from an unrelated terminal.
The Nstdata MCP repository is the product baseline for this guide. Choose one connection per task to avoid duplicate tool names and ambiguous routing.
Configuration
Hosted connection
Local connection
Address or command
https://mcp.nstdata.io/crawl
npx
Transport
Streamable HTTP
stdio
Authentication
OAuth or X-API-Key, chosen separately
NSTDATA_API_TOKEN
Module selection
Hosted Crawl tools
NSTDATA_MODULES=crawl
Runtime
Client manages remote connection
Node.js required
Page processing
Nstdata cloud service
Nstdata cloud service
Keep API keys out of prompts, URLs, screenshots, and version control. Authorize through the client or its private configuration mechanism.
How do you connect and verify Nstdata Crawl MCP?
Connect Nstdata Crawl MCP using either hosted authorization or local stdio, then verify the connection with one bounded page request.
Method 1: Use hosted MCP
Step 1: Add the remote server
Open your client's MCP connection settings and add https://mcp.nstdata.io/crawl using Streamable HTTP. UI names differ by client and version, so use the client-specific instructions in the Nstdata MCP setup article.
Step 2: Complete authorization
Choose the client's authentication action and finish Nstdata authorization in the browser. For the OAuth configuration, leave manual bearer-token and header fields empty. The business API key belongs on Nstdata's authorization page, not in a URL.
Step 3: Confirm tool availability
Return to the client and inspect the connected tools. The current Crawl set is:
Tool
Responsibility
nstdata_crawl_scrape
Submit one page
nstdata_crawl_scrape_result
Resume a page task
nstdata_crawl_start
Start a bounded website crawl
nstdata_crawl_status
Read crawl progress
nstdata_crawl_pages
Read a page of crawl results
nstdata_crawl_read_result
Read a returned storage reference
[Screenshot: The client's connected Nstdata server and available Crawl tools, with credentials hidden.]
Method 2: Use a local stdio adapter
Step 1: Check the runtime
Confirm the Node.js requirements in the current repository. Its setup examples pin @nstdata-ai/mcp-server@1.0.5; do not assume that an old installed plugin updates when npm's latest version changes.
Step 2: Merge the server configuration
For clients using mcpServers JSON, merge this entry while preserving existing servers. Replace the placeholder only in private client configuration.
Let the client start the process, then inspect its tool list. If npx cannot be found, supply its actual absolute path in the environment that launches the client. A .env file alone is not a guarantee that the local server receives its contents.
How do you collect and inspect your first page?
Collect your first page with an explicit one-submission prompt that requires reading the full tool result before summarization.
Run a page-level handshake
Send this prompt after connecting:
Use Nstdata Crawl to retrieve https://example.com/ as Markdown.
Submit exactly one scrape and do not follow links.
If a task is still processing, query that task ID rather than resubmitting.
If the result has markdownRef, call the result reader with format markdown.
Report the returned page title, source status, and one fact from the body.
If any step fails, report that step and stop.
In our live test, the service returned completed, success: true, source status 200, and the title βExample Domain.β The body arrived through markdownRef and was read separately. The page describes a documentation-example domain. This is a small connection test, not a suitable recurring monitoring target.
Inspect reference and pagination behavior
Pass the actual returned reference to nstdata_crawl_read_result; do not use the field name markdownRef as the reference value. Continue from the reader's actual nextOffset if present. Offsets describe the read result's units, so a byte count should not be guessed from a text length.
For site results, follow nextCursor through nstdata_crawl_pages. A cursor is pagination state, not a new crawl seed. Stop at an explicit page or byte budget, and label the report partial if that budget ends before all results are read.
How does Nstdata Crawl support a production agent workflow?
Nstdata Crawl supports a production agent workflow by separating managed collection from the model's interpretation and your application's validation.
Nstdata Crawl converts pages and bounded websites into LLM-ready data. Site discovery and recursive crawling reduce manual URL maintenance when a task begins at a documentation hub. JavaScript controls let a workflow wait for required page elements. Built-in proxy access supports standard managed collection without separate gateway configuration. Those capabilities supply evidence to an agent while leaving domain-specific correctness with the application.
What capabilities should your prompts expose?
Scope controls: Specify maxPages, maxDepth, and allowed paths before website crawling.
Output selection: Use Markdown for reading, HTML for selectors, links for discovery, and screenshot or PDF outputs for review. The MCP format enum also includes rawData; it does not expose a generic json extraction format.
Task recovery: Persist task IDs before any client disconnect and resume them rather than submitting duplicate jobs.
Artifact retrieval: Read returned references and track completeness before asking a model to produce a final answer.
Use the Crawl pricing page to confirm current billing. Your application should also count model calls and rejected records, which a collection-service bill cannot describe by itself.
What can go wrong after MCP connects successfully?
MCP can connect successfully while collection fails, content is incomplete, or the model produces unsupported fields.
An empty tool list suggests configuration or permissions trouble. A task error suggests request or collection trouble. An incomplete article suggests cleaning or rendering trouble. An invented attribute suggests an extraction or validation failure. Reconnecting the server is not the right response to every stage.
Apply the MCP security guidance to the trust boundary. Retrieved page text can contain instructions, but those instructions are data, not permission to change tools, reveal secrets, or navigate outside the approved scope.
Use a short evaluation set with missing fields, contradictory values, redirects, and an intentionally failed page. The vendor evaluation checklist helps make diagnostics and accepted-record quality part of the selection.
What should you automate after the first successful request?
Automate validation and recovery after the first successful request, then expand the collection scope in measured steps.
Store the URL, retrieval time, task ID, artifact identity, and extraction version with every record. Use Nstdata Crawl for the collection layer and deterministic validation for the acceptance layer. When tasks require interactive browser actions beyond page collection, evaluate Nstdata Cloud Browser separately.
MCP itself does not scrape websites. A connected tool server supplies collection capabilities that the client can call through the protocol.
Q: Does local Nstdata MCP mean offline scraping?
Local Nstdata MCP does not mean offline scraping. Its Crawl module still calls the Nstdata cloud service and requires account access and available resources.
Q: Can Nstdata MCP search the web for URLs?
The current Nstdata MCP server does not provide web search. Supply known URLs or use a separate approved discovery source.
Q: Should an agent resubmit a slow scrape?
An agent should resume an existing task ID when the task is still processing. Resubmitting creates a different operation and can duplicate work.
Q: Can I request JSON directly as a Crawl MCP format?
The current Crawl MCP format values are Markdown, HTML, links, PDF, screenshot, and raw data. Build and validate business JSON from the returned evidence in a separate step.
Q: Does a successful connection guarantee successful collection?
A successful connection does not guarantee successful collection. Validate tool execution, terminal task status, content completeness, and required business fields separately.
Lena Zhou
Nov. 26th 2026
Experience Nstproxy Crawl - Start Your Free Trial Today
Crawl entire websites with a single API request
Turn any website into Markdown, HTML, JSON, links, PDFs and more β without managing crawling infrastructure.