Skip to main content

scrapely-mcp-python

Scrapely MCP server for Python. It exposes Scrapely Actors, storage, runs, tasks, and documentation to MCP clients over stdio and streamable HTTP transports, with dynamic per-Actor tools, MCP-Apps widget support, Skyfire/x402 agentic payments, Segment telemetry, and Sentry instrumentation.

Install

python -m venv .venv && source .venv/bin/activate
pip install -e .
# The local Scrapely API client is expected as a sibling checkout:
pip install -e ../scrapely-client-python

Run (stdio)

export SCRAPELY_TOKEN=...   # or keep a token in ~/.scrapely/credentials.json
scrapely-mcp-server --actors=username/actor-name
scrapely-mcp-server --tools=docs                      # public tools only, no token needed
scrapely-mcp-server --tools=actors,runs,storage       # category selection
scrapely-mcp-server --ui=apps                         # force MCP Apps (widget) mode

Dev server (stdio, or streamable HTTP on localhost with --http):

python -m scrapely_mcp.dev_server --http --port 8000

Library surface

from scrapely_mcp import ActorsMcpServer, create_stateless_server
  • ActorsMcpServer(options) — the facade: load_tools_from_input(input, client), add_tool, remove_tool, connect(transport), close().
  • create_stateless_server(input, options) — per-request composition for stateless hosts.

Tool categories

actors, docs, runs, storage, tasks, dev — selected via --tools/Input.tools; Actor full names (e.g. scrapely/web-scraper) are also valid selectors and become dynamic tools generated from the Actor's real input schema.

Implementation notes

  • MCP SDK: official Python mcp package (low-level Server).
  • Validation: jsonschema with AJV-compatible semantics (array coercion, additional-property stripping, ReDoS keyword removal) — see utils/ajv.py.
  • Web widgets: the React widget bundle stays JavaScript; the built HTML assets are shipped under scrapely_mcp/web/ and served as MCP resources (resources/widgets.py).
  • Payments: Skyfire and x402 agentic-payment providers; payment error payloads (e.g. x402 402 payment-required responses) are surfaced directly by the client (utils/payment_errors.py).
  • Eval harness (evals/): intentionally not included in this package; the unit test suites live under tests/ (pytest).
  • Logging: a stdlib wrapper provides the structured logging call surface, including softFail and the log-aggregator "error"-word sanitization.

Tests

pip install -e .[dev]
pytest

Metadata

Release files for scrapely-mcp 0.1.5

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

Source distribution (sdist)

Source distribution for scrapely-mcp 0.1.5
File Size Uploaded
scrapely_mcp-0.1.5.tar.gz 286.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scrapely-mcp 0.1.5
File Interpreter ABI Platform
scrapely_mcp-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 482.5 kB

Release files / scrapely_mcp-0.1.5.tar.gz

Download URL scrapely_mcp-0.1.5.tar.gz
Size 286.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b3b67631de47241e4f765646bf55b4febb2974fd2bff2abbbb7cb7a32641cfee
BLAKE2b-256 checksum
How to use checksums
ed437a606e58c65062c924a03a07f3d29f38034f4ccc4f894df51fdb152bb824
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / scrapely_mcp-0.1.5-py3-none-any.whl

Download URL scrapely_mcp-0.1.5-py3-none-any.whl
Size 196.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6fe9a00aa34b1247da056299a0c8ea9867fa1ae23d8209afb0f58a360171c2b
BLAKE2b-256 checksum
How to use checksums
6a85de983f0287c1b125a7eeebcaf6a4c46db3147d36161c47661e8c06015773
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

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