---
title: "CrewAI · Scrape.ly Docs"
description: "Give CrewAI agents tools that run Actors and read their results."
url: https://scrape.ly/docs/crewai
markdown: https://scrape.ly/docs/crewai.md
---

# CrewAI

> Give CrewAI agents tools that run Actors and read their results.

Give CrewAI agents Scrape.ly tools: search the Store, run Actors, wait for their runs, and read the results. Agents connect to the hosted [MCP server](https://scrape.ly/docs/mcp.md), so there is no extra package to install beyond CrewAI's MCP support.

```bash
pip install crewai mcp
```

Create an API token in the [dashboard](https://my.scrape.ly) under **Settings → API & Integrations** and set it as `SCRAPELY_TOKEN`. The agent can do anything the token can, including starting paid runs, so give it a scoped key: `actors:run`, `runs:read`, and `datasets:read`, with a **Max charge per day**. See [API keys & permissions](https://scrape.ly/docs/api-keys.md).

## Give an agent Scrape.ly tools

Add the MCP server to the agent's `mcps`. CrewAI lists the server's tools when the agent starts and calls them as the agent decides.

```python
import os

from crewai import Agent, Crew, Task
from crewai.mcp import MCPServerHTTP

scrapely = MCPServerHTTP(
    url="https://mcp.scrape.ly",
    headers={"Authorization": f"Bearer {os.environ['SCRAPELY_TOKEN']}"},
)

researcher = Agent(
    role="Web researcher",
    goal="Collect current data from the web with Scrape.ly Actors",
    backstory="You find the right Actor in the Scrape.ly Store, run it, and report what its results show.",
    mcps=[scrapely],
)

task = Task(
    description=(
        "Find an Actor that scrapes Google Maps, run it for 'coffee shops in Berlin' "
        "with at most 20 results, and list the name, rating, and address of each place."
    ),
    expected_output="A table of coffee shops with name, rating, and address.",
    agent=researcher,
)

print(Crew(agents=[researcher], tasks=[task]).kickoff())
```

The agent uses the model you set up for CrewAI, as with any other tool.

## What the agent can do

The agent gets the MCP server's default tools. The ones a research agent uses most:

| Tool | What it does |
| --- | --- |
| `search-actors` | Find Actors in the Store by keywords. |
| `fetch-actor-details` | Read an Actor's input schema, README, and pricing before running it. |
| `call-actor` | Run an Actor with a JSON input, optionally with `maxItems` and `maxTotalChargeUsd`. |
| `get-actor-run` | Wait for a run and check its status. |
| `get-actor-output` | Read a run's results, paged and kept compact. |

The full list, including saved inputs and automations, is on the [MCP server](https://scrape.ly/docs/mcp.md#tools) page. To run one Actor you already know, name it in the task, for example `Run username/actor-name`, so the agent skips the search.

**Costs**: runs started by the agent are billed like any run. Tell the agent the limits in the task (such as "at most 20 results"), and keep a **Max charge per day** on the key.

---

- Previous: [LlamaIndex](https://scrape.ly/docs/llama-index.md)
- Next: [Vercel AI SDK](https://scrape.ly/docs/vercel-ai-sdk.md)
- All docs: [Docs index](https://scrape.ly/docs.md), [llms.txt](https://scrape.ly/llms.txt)
