Agent framework
OrcaRouter tools in CrewAI
Give a CrewAI agent the OrcaRouter tool catalog through MCPServerAdapter, so it can find and run tools while it works on a task.
Details
- Kind
- Agent framework
- Connects through
- MCP server
Set it up
- Install the packages:
pip install crewai "crewai-tools[mcp]". - Set
ORCAROUTER_API_KEYto an API key from your OrcaRouter console. It pays for the agent's model, reached through OrcaRouter's OpenAI-compatible API, and for the tools; Node.js 18 or later runs the MCP server throughnpx. - Open the server with
MCPServerAdapterand give its tools to your agents.
Code
import os
from crewai import LLM, Agent, Crew, Task
from crewai_tools import MCPServerAdapter
from mcp import StdioServerParameters
server = StdioServerParameters(
command="npx",
args=["-y", "@orcarouter/mcp"],
env={"ORCAROUTER_API_KEY": os.environ["ORCAROUTER_API_KEY"]},
)
# The agent's model, through OrcaRouter's OpenAI-compatible API, on the same key:
# "openai/" picks CrewAI's OpenAI-compatible client, the rest is OrcaRouter's model id.
llm = LLM(
model="openai/openai/gpt-5-mini",
base_url="https://api.orcarouter.ai/v1",
api_key=os.environ["ORCAROUTER_API_KEY"],
)
with MCPServerAdapter(server) as tools:
researcher = Agent(
role="Social media researcher",
goal="Answer questions about social accounts with live figures",
backstory="You look up live data with the OrcaRouter tool catalog.",
tools=tools,
llm=llm,
)
task = Task(
description="How many followers does @nasa have on TikTok?",
expected_output="The follower count and the tool that returned it.",
agent=researcher,
)
print(Crew(agents=[researcher], tasks=[task]).kickoff())Recipes to try with CrewAI
- Track competitor TikTok accountsPull each competitor's TikTok profile, find its latest videos and read what viewers say, in three tool calls an agent can repeat every week.
- Monitor brand mentions on the web and TikTokSearch the web and TikTok for your brand, then read the comments under the posts that mention it: a daily brand check an agent can run on its own.
- Enrich a lead listTurn a list of company domains into firmographics, a contact's work email and a recent news hook, with one API key.
Other integrations
- LangChainLoad OrcaRouter tools as LangChain tools from the functions export and give them to any LangChain agent; each call runs the tool through OrcaRouter.
- LlamaIndexLoad the OrcaRouter MCP server's tools with McpToolSpec and use them in a LlamaIndex FunctionAgent.
- OpenAI Agents SDKWrap each OrcaRouter tool in a FunctionTool with its own JSON schema and run it from an Agents SDK agent, with the model served through OrcaRouter too.
