Give a CrewAI agent a cloud Android phone with MCPServerAdapter.
The code
Install with pip install crewai "crewai-tools[mcp]" "mcp<2". The pin matters: the adapter crewai-tools uses for MCP doesn't work with version 2 of the mcp package yet, and pip picks version 2 by default.
import os
from crewai import Agent, Crew, Task
from crewai_tools import MCPServerAdapter
server = {
"url": "https://phonebox.dev/mcp",
"transport": "streamable-http",
"headers": {"Authorization": f"Bearer {os.environ['PHONEBOX_API_KEY']}"},
}
with MCPServerAdapter(server) as phonebox_tools:
operator = Agent(
role="Android operator",
goal="Complete tasks on a cloud Android phone and report what the screen showed",
backstory="You control cloud Android phones through Phonebox and park every phone you start.",
tools=phonebox_tools,
max_iter=50,
)
task = Task(
description="Create a phone named settings-check, open Settings, find the Android version, then park the phone.",
expected_output="The Android version, and confirmation that the phone was parked.",
agent=operator,
)
print(Crew(agents=[operator], tasks=[task]).kickoff())The adapter connects when the with block starts and disconnects when it ends, so run the crew inside it.
Which agent in the crew gets the phone?
Give the Phonebox tools only to the agent that operates the phone, and let the others plan or write up results. That keeps the tool list short for the agents that don't need it, and one agent owns starting and parking the phone.
Keys, costs and cleanup
Create an Agent key in API keys and export it as PHONEBOX_API_KEY. An Agent key can create, start, use and park phones but can't delete them, which is the right default for an agent. Give the key an expiry, and set a monthly spending limit in Settings: it stops new sessions when it's reached.
Tell the agent to park every phone it starts. A parked phone costs nothing and keeps its apps, files and sign-ins for the next run. Phonebox also parks a phone after its idle timeout and ends a session at its maximum length, so a crashed script doesn't leave a phone running.
Phonebox's tool schemas also list context (a short reason for the call) and llm_model, which are used only for analytics. Models fill them in from the schema, so an agent needs nothing extra. The server doesn't reject a call without them, so code that calls a tool directly can leave them out.
What was checked
Checked on December 1, 2026 with crewai and crewai-tools 1.6.1 with mcp 1.30.0: the framework's MCP client connected to https://phonebox.dev/mcp with a project API key, listed all 14 Phonebox tools and called get_account. That check didn't start a phone or run a model; the agent code on this page was type-checked against those versions. See CrewAI's MCP docs for more options.
CrewAI: common questions
Can CrewAI use a hosted MCP server?
Yes. MCPServerAdapter from crewai-tools connects to a remote MCP server over Streamable HTTP with a URL and headers. For Phonebox, use https://phonebox.dev/mcp and your project API key as a bearer token.
Why does my CrewAI agent stop before finishing on the phone?
CrewAI agents stop after 25 iterations by default. Each look at the screen and each action is an iteration, so set max_iter higher, such as 50, on the agent that uses the phone.