Skip to main content

Scrapy MCP Server

This is an MCP server that can connect to live Scrapy crawls to inspect and control them.

Attach an MCP-capable agent (e.g. Claude Code) to a running Scrapy crawl and inspect, debug, and steer it from the inside — by running async Python inside the live crawl process. It's a structured, agent-oriented successor to Scrapy's telnet console: the agent writes a snippet, it runs on the crawl's own event loop, and the output comes back.

What you can ask it

Once attached, the agent can answer the operational questions you'd otherwise dig for by hand:

  • How much has it scraped, and what's the request error rate?
  • What's downloading right now, and from which domains?
  • Is it making progress or stuck — and if stuck, why?
  • What settings / middlewares / pipelines are actually running?
  • Why is it slow? (download delay / concurrency / autothrottle)

It can also explore fixes read-only — e.g. trying candidate selectors against a response held in memory and diffing the results — and, more experimentally, patch the running spider.

How it works

agent ──MCP(stdio)──► MCP server ──HTTP+bearer──► RemoteControl extension (live crawl)
                           │
                           └─ job discovery (job files in the Scrapy user state dir)

Two pieces are installed separately (but can be installed in the same Python venv if desired):

  • The Scrapy RemoteControl extension: ships with Scrapy 2.19.0 and later and is enabled by default. While the crawl is running it listens on a random localhost port for HTTP requests. You need to know the port number and the auth token to connect to it, which you can get from a job file created by the extension in the user profile directory.
  • MCP server: this package. It's a standard stdio MCP server your agent (e.g. Claude Code) launches. It discovers jobs by reading job files and supports listing them and connecting to them. An agent can use it to send code snippets to a crawl process and get back their results.

Requirements

  • Python 3.10+.
  • A supported Scrapy crawl, which in turn requires:
    • Scrapy 2.19.0+.
    • Asyncio support is enabled in Scrapy (on by default; off only when using a non-default Twisted reactor).
    • The RemoteControl Scrapy extension is enabled (on by default).
    • The crawl is running on the same host as the agent (as the communication is done via network connections to localhost).
    • The crawl is running under the same user account as the agent (as the job files are located in the user profile) or the connection details were given to the agent explicitly.

There is no need to install this MCP server into the Python virtual environment used by Scrapy itself. You can even use uvx to run the server without managing a virtual environment for it, as shown below.

Setup

You'll need uv. Clone the repo:

git clone https://github.com/scrapy/scrapy-mcp-official && cd scrapy-mcp-official

Then register the MCP server with your agent (e.g. Claude Code) — once:

claude mcp add --scope user scrapy-mcp -- uvx --from /absolute/path/to/scrapy-mcp-official scrapy-mcp

Or put it in a project .mcp.json:

{
  "mcpServers": {
    "scrapy-mcp": {
      "command": "uvx",
      "args": ["--from", "/absolute/path/to/scrapy-mcp-official", "scrapy-mcp"]
    }
  }
}

Use it on your crawl

No additional configuration is necessary: once a crawl is running you can ask the agent to list running crawls or to attach to one.

MCP tools

  • list_jobs() — discover attachable live crawls (job id, spider, project, pid), each with a health verdict from its /status endpoint. Unhealthy jobs are listed with the reason rather than hidden.
  • status(job_id) — check that a crawl is alive and responsive, and report what it's running (spider, project, Scrapy version, pid, uptime).
  • execute(job_id, code, timeout_sec?) — run async Python code in a chosen crawl and get its output back (prints, status, traceback).
  • inspection_reference() — a Scrapy-internals cheat sheet the agent reads before inspecting: object graph, common stats names, scheduler queues, and risky patterns to avoid.

Security

This MCP server is designed to run arbitrary Python code inside your crawl process. Don't attach an agent to a crawl if you don't want it to be able to read the data available to that crawl (including e.g. secrets in Scrapy settings or environment variables) or control the crawl itself (up to stopping it).

Release files for scrapy-mcp-official 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scrapy-mcp-official 0.1.0
File Size Uploaded
scrapy_mcp_official-0.1.0.tar.gz 23.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scrapy-mcp-official 0.1.0
File Interpreter ABI Platform
scrapy_mcp_official-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 45.3 kB

Release files / scrapy_mcp_official-0.1.0.tar.gz

Download URL scrapy_mcp_official-0.1.0.tar.gz
Size 23.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9e4b4ed49f1be46ccdd069cfb63fe01492d444f21debfb01264c37b9f7545359
BLAKE2b-256 checksum
How to use checksums
bb518655e1e4bc65fca755d6e4170d8dfc302be8aa794b29941d95cf136801bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release files / scrapy_mcp_official-0.1.0-py3-none-any.whl

Download URL scrapy_mcp_official-0.1.0-py3-none-any.whl
Size 21.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ea997e82c3eab1525e97c041b481629ce12865aae8071f060a078b6f78554bf
BLAKE2b-256 checksum
How to use checksums
347b07e30d3e5f92d8f47aecd89676c1ff151d7e6e8032377f780b945c7b62b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.2

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page