Skip to content

Documentation · MCP

Datafor MCP server

Connect Claude Code, Codex, Cursor, VS Code, Claude, ChatGPT or any other MCP client to Datafor. Every scraper becomes a tool your agent can call — Google SERP, Keyword Planner, Amazon TR, Trendyol and the URL scraper — billed in the same credits as the API.

Server URL

https://mcp.datafor.dev/mcp

Streamable HTTP, OAuth sign-in. The /mcp path is required. Never put an API key in the URL.

Let your agent connect it

Paste this into Claude Code, Codex, Cursor or any agent that can run commands. It adds the server to its own client only and asks you to finish sign-in in the browser. It never creates or prints an API key.

Agent prompt

Use curl to read https://datafor.dev/agent-quickstart.md and connect the Datafor MCP server to this agent.

The agent reads agent-quickstart.md, a short, machine-readable version of this page.

One-click install

Opens your editor with the server filled in. Approve it, then sign in.

Make Datafor your agent’s default web tool

Want your agent to search and read pages through Datafor without naming it every time? Follow Default search & scrape.

Connect your client

Pick your client. Every option points at the same server URL.

  1. 1

    Add the server for every project:

    Terminal
    claude mcp add --transport http --scope user datafor https://mcp.datafor.dev/mcp
  2. 2

    Run /mcp in Claude Code, pick datafor and sign in. Or run:

    Terminal
    claude mcp login datafor

Tools

One tool per scraper, with input schemas generated from the same catalog as GET /v1/scripts. Tools that spend credits are marked as not read-only, so your client asks before running them. Some clients prefix names with the server name, e.g. datafor__google_serp.

ToolCredits
google_serpGoogleGoogle organic results and shopping cards for a query, by country and language.10+
google_keyword_suggestorGoogleGoogle autocomplete suggestions, expanded to a chosen depth.1+
google_ads_keyword_plannerGoogleSearch volume, competition, CPC bids and 12-month trends for keywords.1+
url_scraperAny websiteAny public URL as Markdown, cleaned HTML, links, images or a screenshot.1+
amazon_searchE-commerceAmazon.com.tr search results, optionally with seller offers (1 credit per page + 1 per product offer read).1+
trendyol_searchE-commerceTrendyol search results with price, rating and seller.1+
trendyol_store_productsE-commerceEvery product listed by a Trendyol store.1+
trendyol_product_detailE-commerceOne Trendyol product with buybox prices across all sellers.1+
list_scriptsAccount (free)Every available scraper with its parameters and cost.free
get_runAccount (free)The result of a long-running call by its correlation_id.free
get_balanceAccount (free)Your credit balance. Works even at zero credits.free

Residential-proxy URL scrapes cost more; see pricing.

Test the connection

Start a new session and paste this. Your agent should call google_serp and name it.

Test prompt

Use the Datafor MCP server to get the top Google results for "best headless browser" in the US. Name the tool you called and do not answer from memory.

Authentication & credits

  • Sign-in uses OAuth with PKCE and your existing Datafor login (email, Google or GitHub). No account yet? Create one — 50 free credits, no card.
  • Approving the connection creates an API key named Datafor MCP. Tool calls spend its account’s credits. To disconnect, remove the server from your client and revoke the key under API Keys.
  • Two scopes: read (list_scripts, get_run, get_balance) and write (tools that run scrapers and spend credits).
  • Clients without OAuth can send an API key in an x-api-key or Authorization: Bearer header.
  • get_balance is free and works at zero credits. Failed or timed-out runs are refunded, as with the API.

Keep approvals on

Leave tool approvals on for tools that spend credits. Scraped pages are untrusted input: Datafor returns page content in a separate field and marks it as data, but your agent should never follow instructions it finds on a page.

Errors

Errors come back as tool results with isError: true, so your agent can read them and react.

402 payment_required
Not enough credits. The connection stays up; the tool returns isError: true with your balance and the cost in structuredContent. Top up, or call get_balance.
401 unauthorized
The sign-in expired or the key was revoked. Reconnect the server in your client to sign in again.
429 rate_limited
Too many calls at once. Wait for the retry_after seconds in the result before calling again.
500 / 504
The scraper failed or timed out. The credit is refunded (refunded: true) and the result says so.

Troubleshooting

Tools do not appear
Check the URL ends in /mcp, then restart the client or start a new chat. Claude and ChatGPT only load connectors into new chats.
Sign-in never opens
Run the client’s login command (claude mcp login datafor, codex mcp login datafor) or click Authenticate in its MCP settings.
Asked for a bearer token
Your client cannot run OAuth. Send your API key in an x-api-key header instead (see Other clients).
Cursor: server missing in a multi-root workspace
Use the global ~/.cursor/mcp.json; project files may not load.
Results are cut off
Tool results are capped at 80,000 characters. Truncated results carry truncated: true; ask for fewer pages or a narrower format.

Still stuck? Email us with your client name and version.