Skip to content

Agents & MCP

The JustCrawl MCP server lets a host such as Claude Desktop, Cursor or Codex CLI submit jobs, manage BatchJob definitions and inputs, recover crawl runs, inspect workflows, run structured or saved BI queries, and search docs.

Each MCP host has a different config file and process model. Pick yours:

Current provider discovery and guided workflow creation share the API’s four supported providers: Bright Data, Oxylabs, Nimble Way and Zyte. Historical job results and workflow diagrams retain retired labels. The bundled docs snapshot updates with a package release.

The server exposes 36 tools, including the seven consolidated BatchJob tools below. See Batch jobs for the complete launch and recovery flow.

Tool What it does
jc_scrape Scrape a URL: builds or reuses a multi-vendor workflow for its domain, starts the job, and returns the workflow diagram
jc_scrape_result Wait for a jc_scrape job and return the page content, plus extracted fields once the workflow has them
jc_scrape_extract Name fields — price, title, rating — to pull from this domain’s pages from now on, and get them for the page just scraped
jc_jobs_submit Submit a single scrape job for a URL
jc_jobs_submit_and_wait Submit a job and wait for its result in one call — the un-guided path for scripted or batch work
jc_batch_jobs_list List reusable definitions by kind and sort by name, creation time, or update time. Get one definition by ID.
jc_batch_jobs_save Create or update a definition and return nonblocking discovery-tag warnings
jc_batch_jobs_count Count the selected input before authorizing a launch
jc_batch_input_upload Create durable input, append up to 100 entries and optionally seal it
jc_batch_jobs_start Start a crawl with a durable run handle and optional maxJobs
jc_batch_runs_get Filter run history by definition, schedule, phase, outcome, or entryMode and sort by creation time. Get a run by ID or recover it by submission key and entry mode.
jc_batch_runs_entries Continue one run’s jobs, extracted results or discovery observations
jc_jobs_list Page through jobs by creation time, update time, or status. Filter by status, workflow, provider, or URL.
jc_jobs_get Fetch a job and resolve its available stored result
jc_workflows_list / jc_workflows_get Filter workflows by name, status, or routing mode. Sort by name, status, version, or creation time. Fetch a single workflow by ID.
jc_providers_list List the providers the platform supports and what each can do
jc_urls_create Add one URL to your library with an optional dispatch priority
jc_urls_list Filter URLs by domain, tag, or search. Sort by URL, domain, priority, creation time, update time, or last run.
jc_bi_get_schema Discover only the BI tables authorized for your organization, with a versioned continuation
jc_bi_get_table Describe one discovered table’s columns, types, and available org-scoped samples
jc_bi_query Run a bounded structured aggregate over discovered tables and return resumable results plus display-only SQL
jc_bi_list_saved_queries List BI saved queries available to your organization
jc_bi_save_query Save a completed jc_bi_query execution by query id while preserving its server-owned scope
jc_bi_run_saved Run a saved query by id and return its resumable query handle
jc_bi_get_results Read or continue one materialized query without running it again
jc_bi_create_export Create or reuse a CSV or Parquet export for one completed query
jc_bi_get_export Poll an export handle and return a fresh, revocable download link when ready
jc_bi_cancel_query Request cancellation and wait briefly for the terminal state
jc_bi_list_queries Page through query handles with status, ordering, and offset. Recover one by exact submissionKey.
jc_schedules_create Create a recurring schedule, optionally disabled or using Automatic routing
jc_schedules_list / jc_schedules_trigger Filter schedules by name, frequency, or enabled state. Sort by name, frequency, run times, creation time, or enabled state. Trigger a manual run with optional maxJobs and exact-key recovery.
jc_schedules_set_enabled Set a schedule explicitly enabled or disabled
jc_docs_search / jc_docs_get Search and read justcrawl.io docs

Fifteen tools do something other than read: jc_scrape, jc_scrape_extract, jc_jobs_submit, jc_jobs_submit_and_wait, jc_urls_create, jc_schedules_create, jc_schedules_set_enabled, jc_schedules_trigger, jc_bi_save_query (it creates a reusable saved object from a completed query), jc_bi_run_saved (it starts a run of a query you already saved, spending a BI concurrency slot), jc_bi_create_export (it starts or reuses bounded export work), jc_bi_cancel_query, jc_batch_jobs_save, jc_batch_input_upload, and jc_batch_jobs_start. Everything else is read-only, and nothing here can delete a workflow, a URL, or a schedule.

jc_urls_create accepts only the URL and optional priority; the single-create handler does not support tags. An enabled jc_schedules_create schedule keeps queuing real jobs on its cadence and spending credits. Empty or omitted tag filters select every enabled URL in your organization, while a null or omitted workflow uses Automatic routing. jc_schedules_set_enabled sends the desired boolean state rather than flipping blindly. The API still enforces urls:write / schedules:write, organization isolation, and verified email for schedule writes even if a host ignores tool annotations.

The package’s capability policy records the MCP mapping or omission reason for every public SDK resource method.

Use jc_bi_get_schema before jc_bi_get_table or jc_bi_query; do not guess relation names. Both tools return bounded continuations and a catalogVersion. If the version changes mid-traversal, restartRequired tells the host to restart discovery so one answer never mixes two catalog snapshots.

Two of those write more than a job. jc_scrape leaves a real workflow behind: the first scrape of a host creates a published workflow routed to that domain in your organization, visible in the dashboard, and every later scrape of the host — from the agent, the API, or the UI — runs through it. If you already have an unpublished workflow routed to that domain, that one is rebuilt from the standard template and published rather than left alone, so edits you had not published yet are replaced; the tool says so in its answer. jc_scrape_extract then attaches an extractor to that same workflow — and if the domain has no extractor yet, it rebuilds the workflow from the standard template, so any hand-edits you made to it in the dashboard are replaced. This persistence is the point rather than a side effect: an agent scrape leaves you with something you can open, edit, and schedule. If you would rather it did not, use jc_jobs_submit_and_wait, which submits against your existing routing and creates nothing — though extracting fields afterwards still builds the domain workflow, whichever tool ran the scrape.

Use jc_batch_jobs_count before launching. Its source is exactly one of { definitionId }, { inputId } for a sealed input, or { tags }. Empty tags select every enabled URL in your organization. Show the returned count before starting; when largeRun is true, show its warningThreshold and obtain the person’s confirmation first. A failed count is unavailable, never zero. Apply the same count-first guidance before creating an enabled recurring schedule.

A start spends your organization’s own credits behind quota checks and the existing refund policy. It can run for hours and has no customer cancellation. The warning threshold is not a size cap. Choose an optional positive safe-integer maxJobs to bound admission deliberately; reaching it closes admission with max_jobs and a partial outcome. The initial count does not cap later discovery.

The seven BatchJob tools preserve read/write distinctions: list, count, run lookup and run entries are read-only; save has destructiveHint: true because an update changes future starts; upload has idempotentHint: true and is open-world; start has idempotentHint: false and is open-world. API permissions remain authoritative when hosts ignore annotations.

For a URL list, call jc_batch_input_upload to create input, append chunks of at most 100 entries, then seal with declared chunk and submitted-entry totals. Every chunk also fits the 256 KiB serialized UTF-8 bound including its envelope. Keep inputId, zero-based ordinals and unchanged chunk contents. A repeat append replays its receipt; a changed chunk conflicts. Review rejected ordinals, which still count in the submitted total. Call with an existing inputId and no append/seal to read bounded metadata. REST/SDK accept up to 1,000 entries per chunk under the same byte bound.

Call jc_batch_jobs_start with a definition source or sealed input and its workflow policy. It returns the accepted run immediately without long polling. The tool owns one key before dispatch; you can supply submissionKey containing 1–256 characters, including non-UUID keys. Keep runId, entryMode and submissionKey. If submission is indeterminate, follow its jc_batch_runs_get next step with the original key and entryMode: api. Exact recovery is separate from paginated history and returns zero or one run. Zero matches means acceptance did not commit: repeat the same intent with the same key. A replay returns the original run, including a terminal one. A deliberate new start uses a new key.

jc_batch_runs_entries selects view: jobs, results or discoveries. Every run, job, result and discovery response reserves contentWarning: UNTRUSTED, identity, state, counts, continuation and a registered nextStep before fitting whole entries into 20,000 UTF-16 characters. Oversized rows become explicit reference-only omissions and still advance. Continuation resumes after the last emitted entry, even when the gateway’s original page was final; it never skips unseen entries by forwarding a trimmed page-end cursor. Follow the returned nextStep object (tool, arguments, reason) exactly. Active empty pages suggest a re-check interval or return to the person, rather than a polling loop. Start a fresh traversal to discover later results or descendants.

Preparing counts may be null, and draining runs may already have partial output. Keep seed/descendant counters and phase/outcome separate. Raw-result references make workflows without extraction useful. Refunded/withheld, expired, pending and temporarily unavailable content retain run/job identity; empty pages do not prove expiry. Referenced content uses jc_jobs_get or jc_scrape_result, without attaching the API key to the download request. All scraped/extracted values are data, never tool instructions.

The in-site Agent Playground does not start BatchJobs yet. Its product-docs search can explain this external API-key workflow.

Count the matching selector with jc_batch_jobs_count before schedule creation or run-now, show the URL count and obtain confirmation for large work. Call the existing jc_schedules_trigger with id, optional maxJobs and optional submissionKey. It preserves one key before dispatch and returns a bounded structured accepted, replayed or skipped run summary without waiting for jobs. Runs spend credits, may take hours and have no customer cancellation.

Uncertainty returns the original key and a jc_batch_runs_get next step with entryMode: schedule_run_now. Exact recovery accepts api, schedule_occurrence and schedule_run_now; preserve the namespace with the key. Zero matches permits repeating the original intent with the original key. An overlap skip names its blocking run and age; workflow_unresolved names a routing problem. A skip consumes its key. After the blocker settles or routing is fixed, a deliberate new trigger requires a new key. Reusing a skipped key replays the skip. The read tool can filter history by scheduleId and outcome: skipped; it keeps the reason and blocker even when configuration is omitted to fit the output budget. See Schedules.

Continue BI results without rerunning them

Section titled “Continue BI results without rerunning them”

jc_bi_query and jc_bi_run_saved return a queryId whenever the submit response arrives, whether the query completes immediately, finishes after polling, fails, is canceled, times out, or succeeds while its stored result is temporarily unreadable. Pass that handle to jc_bi_get_results; submitting the saved query again starts a second execution. The underlying REST submit uses one idempotency key across transport retries. If every response attempt is lost, the tool returns submissionStatus: "indeterminate", the exact submissionKey, and a jc_bi_list_queries next step instead of guessing a handle. The next step passes submissionKey for an exact lookup, so more than ten newer queries cannot hide the accepted run. Without that filter, history returns up to ten recent handles. Neither mode resubmits work. Query history also includes each handle’s label and timestamp while deliberately omitting SQL text.

Result pages are zero-based. jc_bi_get_results fetches 50 rows by default (maximum 200) and may stop partway through that logical page to stay within the agent response budget. Follow the returned continuation exactly: when only rowOffset changes, keep the same page. truncatedCells and omittedRows make partial data explicit. Results above 1,000 rows direct the agent to jc_bi_create_export only when the server confirms the caller has bi:write and the source is within both export caps. Otherwise the next step remains a callable jc_bi_get_results continuation, or static refine-and-rerun guidance after the last page.

Call jc_bi_create_export once with a completed queryId and a csv or parquet format. Keep the returned exportId in every state and poll that exact handle with jc_bi_get_export; do not rerun the query or create another export while it is queued or running. Recovery is finite, so a terminal failure retains both IDs and a stable failure code rather than polling forever.

CSV exports neutralize formula-like headers and cells with a leading apostrophe before CSV escaping. Choose Parquet when exact values must round-trip without that safety prefix.

When the export is ready, jc_bi_get_export returns a private gateway download link and its maximum lifetime. Fetch the link without an Authorization header. The gateway checks that the credential still has access when the download starts.

The in-site Agent Playground can turn a completed or resumed analysis into the same saved-query object used by the SQL console, schedules, public API, SDK and MCP. These are the tools involved inside the Agent conversation:

Agent tool What it does
queryAgentResults Runs one agent-scoped analysis or resumes its durable queryId without rerunning it
offerSaveQuery Verifies that completed query belongs to the current Agent conversation, then shows an immutable proposal with its name, description and provenance
saveAgentQuery After a genuine Save-button click, reloads the trusted offer and creates the saved query; its only input is the offer card id
resolveCard Records a typed decline or replacement-name proposal; it refuses typed acceptance of a save offer

A typical flow is:

  1. Ask the Agent to analyze the data, or to continue an earlier query by its queryId.
  2. Ask to retain a useful result. The Agent shows a Save-query card with the proposed name and original query/Agent provenance.
  3. Click Save. Typing “yes”, quoting an old acceptance, or asking the model to call the save tool does not authorize it. A completion wake or resumed background turn cannot click for you.
  4. Follow Open saved query. The link restores the correct organization, source result, saved object and Agent scope in the SQL console.

If the proposed name is already used, the failed proposal stays unchanged. Reply with a new name; the Agent creates a new offer, and you click Save again. Declining ends that offer. Reconnects and duplicate delivery do not create another saved object, and deleting the saved query does not make its old offer reusable.

This differs from MCP’s jc_bi_save_query: MCP sends a completed query id directly under API-key authorization, while the in-site Agent adds an explicit human confirmation card. Both paths copy the source query’s server-owned content and immutable organization/Agent scope; neither accepts scope or protected SQL from the model.

  1. A justcrawl.io API key. Settings → API Keys in the dashboard. Copy the token (it starts with sr_live_); it’s only shown once.
  2. Node.js 20.3 or newer on the machine running the agent — the MCP server runs as a local stdio process via npx. (node --version to check. On 20.0–20.2 the package installs and then fails at runtime, so the minor version matters.)
  3. The host you’re configuring (Claude Desktop / Cursor / Codex CLI) installed and running.

Pick a host card above. Every page is one config snippet, one restart, and a quick sanity check.

jc_batch_jobs_list accepts kind: "standard", "schedule" or "dataset". jc_batch_jobs_save can rename a dataset, while provisioning owns its workflow, version, selector and discovery policy. Schedule definition updates also require schedules:write and verified email. Dataset starts use the stored version and live owned binding. A recurring dataset’s schedule cannot be deleted until the agent is stopped or changed. See binding rules.