Skip to content
Leslie Paul Ajayi
Work · Built
All work

scrapy-mcp

Scrapy web-scraping tools for ChatGPT, served as a remote MCP server with a results widget.

Role
Engineer
Category
Developer tool
Year
2026
Status
Working

The question

Can a language model get a reliable, safe pair of hands on the open web?

The answer is three tools

scrape_page returns title, description, readable text and links. extract returns values for named CSS or XPath selectors. crawl_site walks a same-host crawl (≤50 pages, depth ≤3).

The hard part

Giving an AI a crawler means giving it a way to reach things it shouldn't. So robots.txt is obeyed, responses are capped at 5 MB, only ports 80/443 are allowed, and any host resolving to private, loopback, link-local or cloud-metadata addresses is refused, before the crawl and on every redirect.

How it's built

  1. 01ChatGPT widgetMCP Apps view of results
  2. 02MCP serverStreamable HTTP, optional secret path
  3. 03Three toolsscrape_page · extract · crawl_site
  4. 04Subprocessscrapy runspider, one per call
  5. 05Safety middlewareChecked on every redirect and link

Top: what the user touches. Bottom: what holds it up.

Key decisions

  • A subprocess per call

    Scrapy's Twisted reactor never touches the server's event loop, and a stuck crawl is killed after 30 s (90 s for crawls).

  • Quiet logs when secret

    Set MCP_AUTH_TOKEN and the endpoint moves to /mcp/<token>. The access log is switched off so the token never lands in it.

What I learned

Safety belongs in the middleware that every request passes through, not in each tool that remembers to check.

Stack

  • Python
  • Scrapy
  • MCP
  • pytest
Next projectAI for SMEs
Contact

Based in Accra, Ghana

Have a problem worth solving?

I'm interested in engineering roles, product collaborations and well-scoped builds. Email is the fastest way to reach me.

  • GitHub

    Leslie-23 · 171 public repositories

  • LinkedIn

    /in/leslie-paul-ajayi

  • X

    @_iam_leslie

  • npm

    npm-git-helper, v3.0.0

© 2026 Leslie Paul Ajayi--:-- in Accra

Where I am from, and where I build

That is why I am building for Africa.