LystBot

CrewAI MCP server adapter: connect a list server in Python

The CrewAI MCP server adapter, MCPServerAdapter, starts an MCP server and hands its tools to your CrewAI agents. For a local server you pass StdioServerParameters with the command to run, and a with block starts and stops the process for you. Below we connect LystBot's list and reminder server, so a crew can add items and create reminders.

CrewAI MCP server adapter: Python code connecting an agent to LystBot lists

LystBot is our product, so weigh our opinions accordingly. The adapter code works for any stdio MCP server, and only the command changes.

Install the CrewAI MCP server adapter

The adapter lives in the crewai_tools package; CrewAI's MCP docs show how to install it with the MCP extra for your CrewAI version. You also need Node.js, because LystBot's server starts with npx.

  1. Install LystBot on iPhone or Android and open Settings → AI Agents to copy your API key.
  2. Log in once from a terminal:
npx lystbot login YOUR_API_KEY

Connect LystBot over stdio

from crewai import Agent, Task, Crew, Process
from crewai_tools import MCPServerAdapter
from mcp import StdioServerParameters
import os

server_params = StdioServerParameters(
    command="npx",
    args=["lystbot", "mcp"],
    env={**os.environ},
)

with MCPServerAdapter(server_params) as tools:
    print([tool.name for tool in tools])

    planner = Agent(
        role="Household planner",
        goal="Keep the shopping list and reminders up to date",
        backstory="You manage lists in LystBot.",
        tools=tools,
        verbose=True,
    )
    task = Task(
        description="Add milk, eggs and bread to my Shopping list.",
        expected_output="A short confirmation of the items added.",
        agent=planner,
    )
    crew = Crew(agents=[planner], tasks=[task], process=Process.sequential)
    print(crew.kickoff())

The with block is the managed way: it starts the server process and stops it when the block ends. Passing os.environ keeps your PATH, so npx is found, and LystBot reads its key from ~/.lystbot/config.json, which the login step created.

Check the tools first

The first print shows the tool names CrewAI received. LystBot's local server brings 26 tools, so you should see names like list_lists, add_items and check_item. For the real test, set verbose=True on the agent and give it the task to list your lists. The log should show a list_lists call with its result; list names in the final answer alone could come from anywhere. If the list is empty or the process exits, run npx lystbot mcp in a terminal to see the error. A missing login is the usual cause.

MCP or REST API in CrewAI?

LystBot also has a REST API, which CrewAI can call with a custom tool. We prefer MCP here: the tools arrive with names and descriptions, and you write no HTTP code. Pick REST when you want fixed calls without an MCP process. Our list app API guide shows the endpoints.

FAQ

What is the CrewAI MCP server adapter? A class in crewai_tools that connects CrewAI to an MCP server and exposes its tools to agents.

Do I need to stop the server myself? Not with the with block. With a manual lifecycle, call stop() when you are done.

Can the same crew use several MCP servers? Yes. CrewAI's MCP docs cover connecting to multiple servers; pass a list of parameters.

How we wrote this

We checked the adapter pattern against CrewAI's stdio MCP documentation, and the LystBot command against LystBot's agent guide, on 24 November 2026. We haven't run a live session for this post, so it shows no tool output.

New to MCP? Our Claude MCP explainer covers servers, clients and tools in plain terms. Get the app for iPhone or Android to copy your API key.