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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scrapely_mcp-0.1.1.tar.gz (272.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scrapely_mcp-0.1.1-py3-none-any.whl (191.5 kB view details)

Uploaded Python 3

File details

Details for the file scrapely_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: scrapely_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 272.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","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}

File hashes

Hashes for scrapely_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a0a0fc32e349879c5ebcf7521f5a732d814210e02dcf8c479ab7103a311b839b
MD5 26b87f4e2df9df6f5878ef6494bb920f
BLAKE2b-256 9db961d61dc0d645e360f9d75892715b94a49b743351298b82209972df1f4afd

See more details on using hashes here.

File details

Details for the file scrapely_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: scrapely_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 191.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","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}

File hashes

Hashes for scrapely_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0e851612038c769a8a4cc2217ae4e655df88512fdf875ca27e9bec4f52c99616
MD5 41feecd5ca147515f536a700a3cf69e5
BLAKE2b-256 dec5c4e84ac47d9dba4ed47636a83dd7b284b8ad136b830391418aeff230fcc9

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 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