Loop
How it worksThe loopWhy LoopPricingDocs
guide CrewAI · MCP · multi-agent · tool

Use Loop with CrewAI.

Add real-time local restaurant data to any CrewAI agent. Pass https://stayinloop.dev/mcp in the mcps= parameter and all four Loop tools appear automatically. No API key required on the free tier.

step 1 Add Loop via mcps= (simplest)

CrewAI has native MCP support. Pass the Loop server URL as a string in the mcps= parameter on your Agent. CrewAI connects over HTTP and discovers search, get_details, verify, and report automatically. No extra packages beyond crewai.

agent with Loop MCP — mcps= shorthand
from crewai import Agent, Task, Crew

agent = Agent(
    role="Local Business Researcher",
    goal="Find and verify real local restaurants for user queries",
    backstory="Expert at using real-time data tools to find accurate local business information.",
    mcps=["https://stayinloop.dev/mcp"],  # Loop's MCP server — all 4 tools auto-discovered
    verbose=True
)

task = Task(
    description=(
        "Search for vegetarian-friendly restaurants with outdoor seating in Kreuzberg Berlin. "
        "Verify that the top result is currently open, then report the final outcome."
    ),
    expected_output="Verified restaurant recommendation with current availability status.",
    agent=agent
)

crew = Crew(agents=[agent], tasks=[task])
result = crew.kickoff()
print(result)
step 2 MCPServerAdapter — explicit lifecycle control

Use MCPServerAdapter from crewai_tools when you need to inspect available tools at runtime, manage the connection lifecycle explicitly, or share tools across multiple agents. Install with pip install crewai-tools.

MCPServerAdapter — streamable-http transport
from crewai import Agent, Task, Crew, Process
from crewai_tools import MCPServerAdapter

server_params = {
    "url": "https://stayinloop.dev/mcp",
    "transport": "streamable-http"
}

with MCPServerAdapter(server_params) as loop_tools:
    # loop_tools is a list of CrewAI Tool objects:
    # [search, get_details, verify, report]

    agent = Agent(
        role="Local Business Researcher",
        goal="Find and verify real local restaurants for user queries",
        backstory="Expert at finding accurate local business information.",
        tools=loop_tools,
        verbose=True
    )

    task = Task(
        description=(
            "Search for Italian restaurants in Kreuzberg Berlin. "
            "Verify the top result is open, then report the outcome."
        ),
        expected_output="Verified Italian restaurant with open status.",
        agent=agent
    )

    crew = Crew(
        agents=[agent],
        tasks=[task],
        process=Process.sequential,
        verbose=True
    )

    result = crew.kickoff()
    print(result)
step 3 Add an API key (optional)

The free tier requires no authentication. For higher-volume projects, apply for an API key and pass it using MCPServerHTTP from crewai.mcp.

MCPServerHTTP with Authorization header
from crewai import Agent, Task, Crew
from crewai.mcp import MCPServerHTTP

# For higher-volume projects with an API key:
agent = Agent(
    role="Local Business Researcher",
    goal="Find and verify real local restaurants for user queries",
    backstory="Expert at finding accurate local business information.",
    mcps=[
        MCPServerHTTP(
            url="https://stayinloop.dev/mcp",
            headers={"Authorization": "Bearer YOUR_API_KEY"}
        )
    ]
)
quick reference
ToolWhen to callKey output
search()User asks for a restaurantUp to 8 ranked records
get_details()User selects a resultFull record + result_token
verify()Before committing to a recommendationLive observation + confidence
report()After user acts on resultMutates record confidence

Full schema: api.stayinloop.dev/v1/openapi.json

import reference
SymbolCorrect import
Agent, Task, Crew, Processfrom crewai import Agent, Task, Crew, Process
MCPServerAdapterfrom crewai_tools import MCPServerAdapter
MCPServerHTTPfrom crewai.mcp import MCPServerHTTP
BaseTool, @toolfrom crewai.tools import BaseTool, tool
common questions

How do I add Loop to a CrewAI agent?

Pass "https://stayinloop.dev/mcp" as a string in the mcps=[] parameter on your Agent. CrewAI connects over HTTP and discovers Loop's four tools automatically. No extra packages required beyond crewai.

When should I use MCPServerAdapter instead of mcps=?

Use MCPServerAdapter when you need to inspect available tools at runtime, control connection lifecycle explicitly (e.g. in a long-running service), or share the same tool list across multiple agents. The mcps= shorthand is simpler for most use cases.

What is the result_token and when does it expire?

The result_token is returned by get_details() and required to call report(). It is a signed HMAC token that expires after 30 minutes. The CrewAI agent holds it in context between the get_details call and the subsequent report call.

Is an API key required?

No. The free tier accepts unauthenticated connections. For higher-volume projects, apply for a key at stayinloop.dev/#pricing and pass it via MCPServerHTTP with an Authorization: Bearer <key> header.

← All guidesAutoGen guideLangChain guide