# MCP Server Integration Issue in CrewAI (Works Fine in Cursor AI)

**URL:** <https://community.crewai.com/t/mcp-server-integration-issue-in-crewai-works-fine-in-cursor-ai/7122>\
**Category:** CrewAI Community Support\
**Created:** [October 13, 2025, 1:44pm UTC](https://community.crewai.com/t/mcp-server-integration-issue-in-crewai-works-fine-in-cursor-ai/7122 "2025-10-13T13:44:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manjunath\_Srinivas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/manjunath_srinivas/32/3106_2.png) [@Manjunath\_Srinivas](https://community.crewai.com/u/Manjunath_Srinivas)\
**Post date:** [October 13, 2025, 1:44pm UTC](https://community.crewai.com/t/mcp-server-integration-issue-in-crewai-works-fine-in-cursor-ai/7122/1 "2025-10-13T13:44:23Z")

</div>

Hi everyone,

I have an MCP server (for plotting) running on Docker that works perfectly when used in **Cursor AI**.

However, when I integrate the same MCP server into **CrewAI** , the MCP tools don’t seem to be invoked properly.

**Workflow:**

1. Run BigQuery queries based on user requests and generate results.
2. Plot the results using the MCP server (charts).
3. Aggregate the results and produce the final response.

The issue is that the **MCP tool is not being called** , even though it runs fine in Cursor AI with Docker running in the background.

Here’s the relevant section from `crew.py`:

import sys  
from crewai import Agent, Crew, Process, Task  
from crewai.project import CrewBase, agent, crew, task  
from crewai.tasks.task\_output import TaskOutput  
import os  
from crewai import LLM  
from crewai.tools import tool  
from langchain\_google\_community import BigQueryLoader  
from crewai\_tools import CodeInterpreterTool  
from crewai\_tools import DirectoryReadTool  
from dotenv import load\_dotenv  
from google.cloud import storage  
from datetime import timedelta, datetime  
from pathlib import Path  
from typing import Optional  
from pydantic import BaseModel  
from crewai\_tools import MCPServerAdapter  
from mcp import StdioServerParameters

sys.path.append(str(Path( **file** ).resolve().parent.parent.parent))

from src.models.chat\_models import AnalyticsResponse

load\_dotenv()

code\_interpreter = CodeInterpreterTool(unsafe\_mode=True)

llm = LLM()

code\_interpreter = CodeInterpreterTool(unsafe\_mode=True)

directory\_tool = DirectoryReadTool(directory=‘’)

@tool(“Big Query Execution”)  
def my\_simple\_tool(query: str) → str:  
“”“Tool for executing queries on Big Query.”“”  
BASE\_QUERY = query  
loader = BigQueryLoader(BASE\_QUERY)  
data = loader.load()  
return data

@CrewBase  
class CisInsights():  
“”“CisInsights crew”“”

```
    # MCP Server configuration as per CrewAI documentation
    mcp_server_params = [
        {
            "url": "http://localhost:1122/sse", # Replace with your actual SSE server URL
            "transport": "sse" 
        }
    ]
    with MCPServerAdapter(server_params) as tools:
        print(f"Available tools from SSE MCP server: {[tool.name for tool in tools]}")

    agents_config = 'config/agents.yaml'
    tasks_config = 'config/tasks.yaml'
    
    @agent
    def retrieval_agent(self) -> Agent:
            return Agent(
                    config=self.agents_config['retrieval_agent'],
                    tools = [my_simple_tool]
                    verbose=True,
                    llm = llm,
                    memory=False,
                    max_iter=5
            )

    
    @agent
    def analysis_agent(self) -> Agent:
            return Agent(
                    config=self.agents_config['analysis_agent'],
                    verbose=True,
                    llm = llm,
                    tools=self.get_mcp_tools()
                    max_iter=5,
                    memory=False
            )

    @agent
    def report_aggregation(self) -> Agent:
          return Agent(
					config=self.agents_config['report_aggregation'],
					verbose=True,
					llm = llm,
					max_iter=5,
                                            memory=False
			)		

    @task
    def retrieval_task(self) -> Task:
            return Task(
                    config=self.tasks_config['retrieval_task'],
            )

    @task
    def analysis_task(self) -> Task:
            return Task(
                    config=self.tasks_config['analysis_task'],
            )
  

    @task
    def report_aggregation_task(self) -> Task:
           return Task(
		config=self.tasks_config['report_aggregation_task'],
                    output_json=AnalyticsResponse,
		)

    @crew
    def crew(self) -> Crew:
            """Creates the CisInsights crew"""

            return Crew(
                    agents=self.agents, # Automatically created by the @agent decorator
                    tasks=self.tasks, # Automatically created by the @task decorator
                    process=Process.sequential,
                    verbose=True,
                    planning=False,
                    chat_llm=llm

            )

```

This is how it runs on Cursor AI.

 ![Screenshot 2025-10-13 at 7.12.37 PM](https://us1.discourse-cdn.com/flex025/uploads/crewai/original/2X/f/f9b2a6ffc3c021ed9d84fafde5c8f0a5b07c018d.png)

Any guidance or suggestions on resolving this would be greatly appreciated.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![edacee\_73848](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/edacee_73848/32/1438_2.png) [@edacee\_73848](https://community.crewai.com/u/edacee_73848)\
**Post date:** [October 13, 2025, 2:48pm UTC](https://community.crewai.com/t/mcp-server-integration-issue-in-crewai-works-fine-in-cursor-ai/7122/2 "2025-10-13T14:48:37Z")

</div>

Have you looked at Tony’s video? It looks like how the agent is trying to call the tool might be incorrect?

**From the docs:**

 ![image](https://us1.discourse-cdn.com/flex025/uploads/crewai/original/2X/0/0768a8f6abecd523bf7221a893bf9483ca9bbe8c.png)

[MCP Servers as Tools in CrewAI - CrewAI](https://docs.crewai.com/en/mcp/overview#mcp-servers-as-tools-in-crewai)

---

<div class="post-metadata">

**Author:** ![Manjunath\_Srinivas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/manjunath_srinivas/32/3106_2.png) [@Manjunath\_Srinivas](https://community.crewai.com/u/Manjunath_Srinivas)\
**Post date:** [October 13, 2025, 3:35pm UTC](https://community.crewai.com/t/mcp-server-integration-issue-in-crewai-works-fine-in-cursor-ai/7122/3 "2025-10-13T15:35:48Z")

</div>

Hi ,

Yes I had referred that video and coded along the similar lines.

Any suggestions to the above?

Best,  
Manjunath

---

<div class="post-metadata">

**Author:** ![edacee\_73848](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/edacee_73848/32/1438_2.png) [@edacee\_73848](https://community.crewai.com/u/edacee_73848)\
**Post date:** [October 13, 2025, 4:21pm UTC](https://community.crewai.com/t/mcp-server-integration-issue-in-crewai-works-fine-in-cursor-ai/7122/4 "2025-10-13T16:21:21Z")

</div>

Maybe something like:

1. Remove the `with MCPServerAdapter(...)` section entirely
2. In your agents, call `self.get_mcp_tools()`. CrewAI will auto-manage the adapter lifecycle for you.

---

<div class="post-metadata">

**Author:** ![Manjunath\_Srinivas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/manjunath_srinivas/32/3106_2.png) [@Manjunath\_Srinivas](https://community.crewai.com/u/Manjunath_Srinivas)\
**Post date:** [October 13, 2025, 4:42pm UTC](https://community.crewai.com/t/mcp-server-integration-issue-in-crewai-works-fine-in-cursor-ai/7122/5 "2025-10-13T16:42:47Z")

</div>

Hi,

How do we define MCP SSE server if the adapter is removed?

We need the server adapter as per the docs that you had shared earlier.

Best,  
Manju
