---
title: "CrewAI MCP integration · mobilerun"
description: "Give CrewAI agents real Android and iOS phones through the mobilerun hosted MCP server. One mcps entry, tested Python snippet, 33 tools."
url: "https://mobilerun.ai/integrations/crewai/"
---

# CrewAI integration (via MCP)

Add the mobilerun MCP server to a CrewAI agent with one mcps entry. Your crew gets 33 tools to run tasks on real Android and iOS phones.

No extra package: CrewAI's built-in MCP support connects to the hosted server directly.

## Before you start

- A mobilerun API key from [cloud.mobilerun.ai](https://cloud.mobilerun.ai/api-keys). It starts with `dr_sk_`.
- Python 3.10 to 3.13.
- An API key for the model that drives your agents. The example uses OpenAI; any model CrewAI supports works.
- A phone in your mobilerun account to run tasks on. Connecting and listing tools works without one.

## 1. Install and set your keys

terminal:

```bash
pip install crewai
export MOBILERUN_CLOUD_API_KEY=dr_sk_YOUR_API_KEY
export OPENAI_API_KEY=YOUR_OPENAI_API_KEY
```

## 2. Add mobilerun to your agent

CrewAI's `mcps` field takes the hosted server. When the crew starts, CrewAI connects over Streamable HTTP and adds the 33 tools to the agent.

crew.py:

```python
import os

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

API_KEY = os.environ["MOBILERUN_CLOUD_API_KEY"]

mobilerun = MCPServerHTTP(
    url="https://api.mobilerun.ai/v1/mcp",
    headers={"Authorization": f"Bearer {API_KEY}"},
    streamable=True,
)

phone_operator = Agent(
    role="Phone operator",
    goal="Complete tasks in mobile apps on real phones through mobilerun",
    backstory="You run and monitor mobilerun tasks and report the result.",
    llm="gpt-5.4",  # any tool-calling model; this one needs OPENAI_API_KEY
    mcps=[mobilerun],
)

check_devices = Task(
    description="List my mobilerun devices and say which ones are ready.",
    expected_output="A short list of devices with their state.",
    agent=phone_operator,
)

print(Crew(agents=[phone_operator], tasks=[check_devices]).kickoff())
```

Run `python crew.py`. Tool names get a prefix from the server address, for example `api_mobilerun_ai_v1_mcp_run_task`.

## 3. Give it only the tools it needs

Some tools change a phone: reset it, remove apps, or start tasks that use credits. For a first agent, pass a short list: tasks, screenshots and device lookups. Pass a filter to the server config.

crew.py:

```python
from crewai.mcp.filters import create_static_tool_filter

mobilerun = MCPServerHTTP(
    url="https://api.mobilerun.ai/v1/mcp",
    headers={"Authorization": f"Bearer {API_KEY}"},
    streamable=True,
    tool_filter=create_static_tool_filter(
        allowed_tool_names=[
            "list_devices", "get_device", "get_device_screenshot", "run_task",
            "get_task", "list_tasks", "stop_task", "get_task_media",
        ]
    ),
)
```

## 4. Prefer MCPServerAdapter?

`crewai-tools` has an adapter that hands you the tools as a list. Set the transport to `streamable-http`: the adapter defaults to SSE, which this server does not serve.

terminal:

```bash
pip install crewai "crewai-tools[mcp]"
```

crew_adapter.py:

```python
import os

from crewai import Agent
from crewai_tools import MCPServerAdapter

API_KEY = os.environ["MOBILERUN_CLOUD_API_KEY"]

server = {
    "url": "https://api.mobilerun.ai/v1/mcp",
    # Required: the adapter defaults to SSE, which this server does not serve.
    "transport": "streamable-http",
    "headers": {"Authorization": f"Bearer {API_KEY}"},
}

with MCPServerAdapter(server) as tools:
    print(f"{len(tools)} tools:", ", ".join(t.name for t in tools))
    phone_operator = Agent(
        role="Phone operator",
        goal="Complete tasks in mobile apps on real phones through mobilerun",
        backstory="You run and monitor mobilerun tasks and report the result.",
        tools=tools,
    )
```

Tested 25 Sep 2026 against the live server with Python 3.12 and crewai 1.15.22 (crewai-tools 1.15.22 for the adapter): connected, listed 33 tools, built the agent.

## What your crew can do

33 tools on the hosted server. Your model decides which tool to call. Tasks it starts run on mobilerun's own mobile agent and use credits and device minutes from your plan.

- **Run agent tasks**: Start a task in plain language on a phone, follow its status and steps, send it a message while it runs, or stop it. mobilerun's mobile agent does the tapping and typing. (run_task, get_task, list_tasks, send_task_message, stop_task, get_task_media)
- **See and drive the screen**: Take a screenshot, read the on-screen UI as structured text, and tap, swipe or type yourself when you want exact control. (get_device_screenshot, get_device_ui_state, device_action)
- **Manage phones**: List your phones, wait until one is ready, reboot or reset it, set its language, timezone and location, and apply saved profiles. (list_devices, get_device, manage_device, configure_device, profiles)
- **Apps and files**: Install, start, stop and remove apps, upload your own APKs, and move files on and off the phone. (list_apps_on_device, manage_device_apps, apps, manage_device_files)
- **Logins**: Keep app logins in the credentials vault and let tasks use them. Stored values are never sent back to the agent. (list_credentials, list_credential_packages, manage_credentials)
- **Network and eSIM**: Route a phone through mobilerun Connect residential IPs or your own SOCKS5 or WireGuard proxy, and manage eSIM profiles. (connect, proxies, manage_esim)
- **Workflows and webhooks**: Turn a task into a workflow with a schedule or event trigger, send results to your own webhook endpoints, and look up timezones and app events. (create_flow, create_trigger, create_action, manage_flow, list_workflow_resources, get_workflow_resource, workflow_events, webhooks, platform_catalog)

## Notes

**Which transport does the server use?** Streamable HTTP at `https://api.mobilerun.ai/v1/mcp`. The server is stateless and answers POST requests only, so a client set to SSE gets a 405. Choose streamable HTTP in your client.

**Where does the API key go?** In an `Authorization: Bearer dr_sk_...` header. Read it from an environment variable on your server, and keep it out of code you commit or ship to a browser.

**What does it cost?** Tasks your agent starts use credits, and phones that are on use device minutes, the same as calls to the REST API. The model that drives your agent is billed by its own provider. See [pricing](https://mobilerun.ai/pricing/).

**Can I sign in with OAuth instead of a key?** The API key setup on this page is the one we tested. Interactive clients such as Claude Desktop can use OAuth, see the [MCP page](https://mobilerun.ai/mcp/).

CrewAI MCP docs: https://docs.crewai.com/en/mcp/overview
Get an API key: https://cloud.mobilerun.ai/api-keys

---

Source: https://mobilerun.ai/integrations/crewai/
