Sitemap

AI Agent Framework MCP support

Beyond Prompting: Assessing Which Agent Frameworks Speak MCP Language

--

Question: who is Uefa championship league 2025 champion?

MCP: duckduckgo, tavily-search

TLDR: The most easy-to-start is langchain, open agents sdk, pydantic AI have some issue with openai package version, semantic kernel quickstart kernel sample has small bug

not working: smolagents throws error, crewai LLM thinking too much causes bad result

Common environment variables

from dotenv import load_dotenv
load_dotenv(".env")

import os
api_key = os.getenv("AZURE_OPENAI_API_KEY")
azure_openai_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
api_version=os.getenv("AZURE_OPENAI_API_VERSION", "2024-08-01-preview")
import openai
openai.api_key = api_key
model_name = os.getenv("AZURE_OPENAI_GPT4O_MODEL_NAME", "gpt-4o-mini")
azure_deployment_name = os.getenv("AZURE_OPENAI_GPT4O_DEPLOYMENT_NAME", "gpt-4o-mini")

langchain

requirements.txt

python_dotenv
langchain-mcp-adapters
langchain-openai
langgraph
duckduckgo-mcp-server
fastmcp
uv
from langchain_openai import AzureChatOpenAI
llm = AzureChatOpenAI(
azure_endpoint=azure_openai_endpoint,
azure_deployment=azure_deployment_name, # or your deployment
api_version=api_version, # or your api version
api_key=api_key,
temperature=0,
max_tokens=None,
timeout=None,
max_retries=2,
# callbacks=[cot]
# other params...
)

import asyncio
import nest_asyncio
nest_asyncio.apply()

from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client

from langchain_mcp_adapters.tools import load_mcp_tools
from langgraph.prebuilt import create_react_agent

server_params = StdioServerParameters(
command=".venv/bin/uvx",
args=[
"duckduckgo-mcp-server"],
)

async def run():
# use standard input/output (stdio) for communication, suitable for subprocess-based interactions.
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
# Initialize the connection
await session.initialize()

# Get tools
tools = await load_mcp_tools(session)

# Create and run the agent
question = f"""who is Uefa championship league 2025 champion?
"""
agent = create_react_agent(llm, tools)
agent_response = await agent.ainvoke({"messages": question})
return agent_response

result = asyncio.run(run())

Result

'The champion of the UEFA Champions League in 2025 was Paris Saint-Germain (PSG). They won their first Champions League title by defeating Inter Milan 2-0 in the final, which took place on May 31, 2025, at the Allianz Arena in Munich.'

crewai

requirements.txt

crewai
"crewai-tools[mcp]"
from crewai import Agent
from crewai_tools import MCPServerAdapter
from mcp import StdioServerParameters # For Stdio Server

# Example server_params (choose one based on your server type):
# 1. Stdio Server:
server_params = StdioServerParameters(
command="~/.nvm/versions/node/v22.14.0/bin/npx",
# Make sure to update to the full absolute path to your math_server.py file
args=[
"-y",
"tavily-mcp@0.1.4"],
env={"TAVILY_API_KEY": os.environ.get("TAVILY_API_KEY")},
)

# Example usage (uncomment and adapt once server_params is set):
with MCPServerAdapter(server_params, connect_timeout=60) as mcp_tools:
print(f"Available tools: {[tool.name for tool in mcp_tools]}")

my_agent = Agent(
role="Question Answering Agent",
goal="Answer question",
backstory="You are an agent that answers questions",
tools=mcp_tools, # Pass the loaded tools to your agent
llm=crewai_llm,
reasoning=True,
verbose=True
)

answer_customer_question_task = Task(
description=(
"""
Answer the question below:
{question}
"""
),
expected_output="""
""",
agent=my_agent,
)


# --- Crew ---
crew = Crew(
agents=[my_agent],
tasks=[answer_customer_question_task],
process=Process.sequential,
)

customer_question = f"""who is Uefa championship league 2025 champion?"""

result = crew.kickoff(inputs={"question": customer_question})

Result

Not satisfactory and crewai makes things complex

Agent: Question Answering Agent                                                                                │
│ │
│ Task: │
│ Answer the question below: │
│ who is Uefa championship league 2025 champion? │
│ │
│ │
│ Reasoning Plan: │
│ 1. Understanding the Task: The task requires me to identify the champion of the UEFA Champions League for the │
│ year 2025. Given that my training data only goes up to October 2023, I need to gather current information │
│ about the tournament, which has not yet occurred. │
│ │
│ 2. Key Steps to Complete the Task: │
│ - I will search for the latest information regarding the UEFA Champions League 2025, focusing on │
│ predictions, ongoing tournaments, or relevant news articles. │
│ - I will prioritize credible sources such as sports news websites, UEFA's official site, and reputable │
│ sports analysts to ensure the information is reliable. │
│ │
│ 3. Approach to Challenges: │
│ - Since the tournament has not yet taken place, I will focus on gathering predictions or expert analyses │
│ regarding potential champions based on team performances leading up to 2025. This will help me provide a │
│ well-rounded answer despite the lack of definitive results. │
│ │
│ 4. Strategic Use of Available Tools: │
│ - I will utilize the 'tavily-search' tool to find the most recent articles or updates related to the UEFA │
│ Champions League 2025. This tool is effective for quickly gathering a wide range of information from various │
│ sources. │
│ - If I find relevant articles that contain predictions or insights about the tournament, I will use │
│ 'tavily-extract' to pull specific data from those articles. This will allow me to present concise and │
│ relevant information to answer the question accurately. │
│ │
│ 5. Expected Outcome: │
│ - The expected outcome is to provide a well-informed answer regarding the UEFA Champions League 2025 │
│ champion, based on the latest available information and expert predictions. This aligns with my goal of │
│ answering questions accurately and effectively. │
│ │
│ 6. Final Assessment: I will ensure that I have a clear understanding of the latest developments in the UEFA │
│ Champions League leading up to 2025 before concluding my readiness to execute the task. │
│ │
│ 7. Tool Usage Strategy: │
│ - I will first use 'tavily-search' to gather a broad range of articles and insights about the UEFA │
│ Champions League 2025. This will help me identify key teams and expert opinions. │
│ - After gathering the articles, I will use 'tavily-extract' to pull specific predictions or analyses from │
│ the most relevant articles. This two-step approach ensures that I have both a wide view and detailed │
│ insights. │
│ │
│ 8. Conclusion: After refining my plan and ensuring I have a comprehensive strategy for gathering and │
│ analyzing information, I feel prepared to execute the task effectively.
'As of now, the UEFA Champions League 2025 champion has not yet been determined, as the tournament is still upcoming. However, based on current predictions and betting odds, several teams are considered strong contenders:\n\n1. **Liverpool** is currently viewed as a frontrunner with odds around +550 to +600, reflecting their strong performance in the Premier League and their potential to excel in Europe.\n\n2. **Paris Saint-Germain (PSG)**, the reigning champions, are also among the favorites with odds ranging from +700 to +800. Their recent success and stable core make them a formidable opponent.\n\n3. **Real Madrid** is consistently a strong contender in the Champions League, with odds around +650 to +700. Their historical success in the tournament adds to their credibility as a potential champion.\n\n4. Other notable teams include **Arsenal**, **Barcelona**, and **Manchester City**, all of which have competitive odds and strong squads capable of making deep runs in the tournament.\n\nOverall, while PSG is favored to defend their title, Liverpool and Real Madrid are also seen as serious threats to claim the championship in 2025. The tournament will begin with qualifiers starting on July 8, 2025, and the competition will be fierce as teams vie for the prestigious title.'

Google adk

requirements.txt

google-adk
litellm
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset, StdioServerParameters
  • StdioServerParameters — Configuration for connecting to an MCP server over standard I/O
  • MCPToolset — Enables connection to and interaction with MCP-compatible tools, acts as an interface for discovering and accessing tools via MCP, convert MCP to the tools consumable in ADK
from google.adk.agents import LlmAgent
from google.adk.tools.agent_tool import AgentTool
from google.adk.runners import InMemoryRunner
from google.genai import types
from google.adk.models.lite_llm import LiteLlm
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset, StdioConnectionParams, StdioServerParameters

os.environ["AZURE_API_KEY"] = api_key # "my-azure-api-key"
os.environ["AZURE_API_BASE"] = azure_openai_endpoint # "https://example-endpoint.openai.azure.com"
os.environ["AZURE_API_VERSION"] = api_version

question_answer_agent = LlmAgent(
name="question_answer",
model=LiteLlm(model=f"azure/{model_name}"),
description=(
"question answer "
),
instruction="answer questions",
tools=[
MCPToolset(
connection_params=StdioConnectionParams(
server_params = StdioServerParameters(
command="~/.nvm/versions/node/v22.14.0/bin/npx",
args=[
"-y",
"tavily-mcp@0.1.4"],
env={"TAVILY_API_KEY": os.environ.get("TAVILY_API_KEY")},
),
),
)
],
)

root_agent = question_answer_agent
app_name = "question_answer"

runner = InMemoryRunner(agent=root_agent, app_name=app_name)
session = await runner.session_service.create_session(
app_name=runner.app_name, user_id="test_user"
)
content = types.Content(role='user', parts=[types.Part(text=f"""who is Uefa championship league 2025 champion?""")])
async for event in runner.run_async(
user_id=session.user_id,
session_id=session.id,
new_message=content,
):
print(event)
if event.content.parts and event.content.parts[0].text:
response = event.content.parts[0].text

Result

content=Content(
parts=[
Part(
function_call=FunctionCall(
args={
'query': 'UEFA Champions League 2025 champion',
'search_depth': 'basic',
'topic': 'general'
},
id='call_Y9DB7jSK8sgRK6TA3Jw7QMIB',
name='tavily-search'
)
),
],
role='model'
) grounding_metadata=None partial=False turn_complete=None error_code=None error_message=None interrupted=None custom_metadata=None usage_metadata=GenerateContentResponseUsageMetadata(
candidates_token_count=33,
prompt_token_count=620,
total_token_count=653
) live_session_resumption_update=None invocation_id='e-29d152f5-3142-4d43-a0f2-e45b4d023b15' author='question_answer' actions=EventActions(skip_summarization=None, state_delta={}, artifact_delta={}, transfer_to_agent=None, escalate=None, requested_auth_configs={}) long_running_tool_ids=set() branch=None id='76230eb7-0b7e-4fae-8e2e-91ca68e76bb2' timestamp=1754860793.210705
2025-08-10 14:19:56,378 - 8304254720 - base_authenticated_tool.py-base_authenticated_tool:72 - WARNING: auth_config or auth_config.auth_scheme is missing. Will skip authentication.Using FunctionTool instead if authentication is not required.
2025-08-10 14:19:56,379 - 8304254720 - base_authenticated_tool.py-base_authenticated_tool:72 - WARNING: auth_config or auth_config.auth_scheme is missing. Will skip authentication.Using FunctionTool instead if authentication is not required.
content=Content(
parts=[
Part(
function_response=FunctionResponse(
id='call_Y9DB7jSK8sgRK6TA3Jw7QMIB',
name='tavily-search',
response={
'result': CallToolResult(
content=[
<... Max depth ...>,
],
isError=False
)
}
)
),
],
role='user'
) grounding_metadata=None partial=None turn_complete=None error_code=None error_message=None interrupted=None custom_metadata=None usage_metadata=None live_session_resumption_update=None invocation_id='e-29d152f5-3142-4d43-a0f2-e45b4d023b15' author='question_answer' actions=EventActions(skip_summarization=None, state_delta={}, artifact_delta={}, transfer_to_agent=None, escalate=None, requested_auth_configs={}) long_running_tool_ids=None branch=None id='638bca84-4960-4f27-9ca0-8f32d4105a88' timestamp=1754860796.376019
content=Content(
parts=[
Part(
text="The champion of the UEFA Champions League in 2025 is Paris Saint-Germain (PSG). They won the final by beating Inter Milan with a score of 5-0. This victory marked PSG's first title in the UEFA Champions League."
),
],
role='model'
) grounding_metadata=None partial=False turn_complete=None error_code=None error_message=None interrupted=None custom_metadata=None usage_metadata=GenerateContentResponseUsageMetadata(
candidates_token_count=51,
prompt_token_count=2569,
total_token_count=2620
) live_session_resumption_update=None invocation_id='e-29d152f5-3142-4d43-a0f2-e45b4d023b15' author='question_answer' actions=EventActions(skip_summarization=None, state_delta={}, artifact_delta={}, transfer_to_agent=None, escalate=None, requested_auth_configs={}) long_running_tool_ids=None branch=None id='b66fd622-ae55-49a1-841b-18c3442157c4' timestamp=1754860796.380119

smolagents

requirements.txt

"smolagents[toolkit]"
import os

from mcp import StdioServerParameters
from smolagents import CodeAgent, LiteLLMModel # type: ignore

from mcpadapt.core import MCPAdapt
from mcpadapt.smolagents_adapter import SmolAgentsAdapter

os.environ["AZURE_API_KEY"] = api_key # "my-azure-api-key"
os.environ["AZURE_API_BASE"] = azure_openai_endpoint # "https://example-endpoint.openai.azure.com"
os.environ["AZURE_API_VERSION"] = api_version
model_name = os.getenv("AZURE_OPENAI_GPT4O_MODEL_NAME", "gpt-4o-mini")
question = f"""who is Uefa championship league 2025 champion?"""
with MCPAdapt(
StdioServerParameters(
command=".venv/bin/uvx",
args=[
"duckduckgo-mcp-server",
],
),
SmolAgentsAdapter(),
) as tools:
agent = CodeAgent(tools=tools, model=LiteLLMModel(model_id=f"azure/{model_name}"))
agent.run(question)

Result

Code execution failed at line 'champion_prediction = search("UEFA Champions League 2025 champion prediction")' due 
to: ValueError: tool search does not support multiple positional arguments or combined positional and keyword
arguments

Seems MCP integration has issue. Below code using native tool works well

from smolagents import CodeAgent, DuckDuckGoSearchTool, VisitWebpageTool

agent = CodeAgent(tools=[DuckDuckGoSearchTool(), VisitWebpageTool()], model=LiteLLMModel(model_id=f"azure/{model_name}"))

agent.run("UEFA Champions League 2025 champion?")

openai agents sdk

requirements.txt

openai-agents
openai==1.99.1
from openai import AsyncAzureOpenAI
from agents import Agent, Runner, OpenAIChatCompletionsModel
from agents.mcp import MCPServerStdio
from agents.run_context import RunContextWrapper

client = AsyncAzureOpenAI(
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
api_version=os.getenv("AZURE_OPENAI_API_VERSION", "2024-08-01-preview"),
azure_endpoint=os.getenv("AZURE_OPENAI_ENDPOINT")
)
model_name = os.getenv("AZURE_OPENAI_GPT4O_MODEL_NAME", "gpt-4o-mini")

question="UEFA Champions League 2025 champion?"
async with MCPServerStdio(
params={
"command": ".venv/bin/uvx",
"args": [
"duckduckgo-mcp-server",
],
}
) as server:
agent = Agent(name="Assistant", instructions="You are a helpful assistant",
model=OpenAIChatCompletionsModel(
model=model_name,
openai_client=client,
),
mcp_servers=[server],
)
run_context = RunContextWrapper(context=None)
tools = await server.list_tools(run_context, agent)
result = Runner.run_sync(agent, question)
print(result.final_output)

Result

The champion of the UEFA Champions League in 2025 was Paris Saint-Germain (PSG), who won the final against Inter Milan with a score of 5-0. The final took place on May 31, 2025, at the Allianz Arena in Munich, Germany. This victory marked PSG's first Champions League title.

LLamaIndex

Command pattern for stdio MCP server is not so well-aligned with native MCP config.

requirements.txt

llama-index
llama-index-llms-azure-openai
llama-index-tools-mcp
import asyncio
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.azure_openai import AzureOpenAI
import os
from llama_index.tools.mcp import BasicMCPClient, aget_tools_from_mcp_url

api_key = os.getenv("AZURE_OPENAI_API_KEY")
azure_openai_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
api_version=os.getenv("AZURE_OPENAI_API_VERSION", "2024-08-01-preview")
llm = AzureOpenAI(
model="gpt-4o-mini",
deployment_name="gpt-4o-mini",
api_key=api_key,
azure_endpoint=azure_openai_endpoint,
api_version=api_version,
)

local_client = BasicMCPClient(".venv/bin/uvx",
args=["duckduckgo-mcp-server"],)
mcp_command = ["\.venv/bin/uvx"]
tools = await aget_tools_from_mcp_url(command_or_url=mcp_command, client=local_client,)
# Create an agent workflow with our calculator tool
agent = FunctionAgent(
tools=tools,
llm=llm,
system_prompt="You are a helpful assistant.",
)


async def main():
# Run the agent
question = "UEFA Champions League 2025 champion?"
response = await agent.run(question)
print(str(response))


# Run the agent
asyncio.run(main())

Result

The champion of the UEFA Champions League in 2025 was Paris Saint-Germain (PSG). They won their first Champions League title by defeating Inter Milan with a score of 2-0 in the final, which took place on May 31, 2025, at the Allianz Arena in Munich.

For more details, you can check the following sources:
- [Sporting News article on PSG's victory](https://www.sportingnews.com/us/soccer/news/who-won-uefa-champions-league-final-2025-psg-inter-milan/a6898e7be49d6234feda2b6b)
- [PK Alert article on the final](https://pkalert.com/2025-uefa-champions-league-final-psg-v-s-inter-milan-historic-win-in-munich/)
- [Topend Sports overview](https://www.topendsports.com/events/soccer/uefa-champions/2025.htm)

PydanticAI

requirements.txt

"pydantic-ai[openai,mcp]"
openai==1.99.1
# https://ai.pydantic.dev/models/openai/#azure-ai-foundry
from pydantic_ai import Agent
from pydantic_ai.models.openai import OpenAIModel
from pydantic_ai.providers.azure import AzureProvider
from pydantic_ai.mcp import MCPServerStdio
import os

api_key = os.getenv("AZURE_OPENAI_API_KEY")
azure_openai_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
api_version=os.getenv("AZURE_OPENAI_API_VERSION", "2024-08-01-preview")
model_name = os.getenv("AZURE_OPENAI_GPT4O_MODEL_NAME", "gpt-4o-mini")

model = OpenAIModel(
model_name,
provider=AzureProvider(
azure_endpoint=azure_openai_endpoint,
api_version=api_version,
api_key=api_key,
),
)

server = MCPServerStdio(
command=".venv/bin/uvx",
args=["duckduckgo-mcp-server"]
)
agent = Agent(model, toolsets=[server])

async def main():
question = "UEFA Champions League 2025 champion?"
async with agent:
result = await agent.run(question)
print(result)

asyncio.run(main())

Result

AgentRunResult(output='The champion of the UEFA Champions League for 2025 is Paris Saint-Germain (PSG). They achieved this victory by defeating Inter Milan with a score of 5-0 in the final match, which took place at the Allianz Arena in Munich, Germany, on May 31, 2025. This win marked a significant moment in European football history for PSG.')

Semantic Kernel

requirements.txt

semantic-kernel
import asyncio

from semantic_kernel import Kernel
from semantic_kernel.connectors.ai.open_ai import AzureChatCompletion
from semantic_kernel.agents import ChatCompletionAgent, ChatHistoryAgentThread
from semantic_kernel.connectors.ai.function_choice_behavior import FunctionChoiceBehavior
from semantic_kernel.contents.chat_history import ChatHistory
from semantic_kernel.connectors.mcp import MCPStdioPlugin

import os

api_key = os.getenv("AZURE_OPENAI_API_KEY")
azure_openai_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
api_version=os.getenv("AZURE_OPENAI_API_VERSION", "2024-08-01-preview")
model_name = os.getenv("AZURE_OPENAI_GPT4O_MODEL_NAME", "gpt-4o-mini")

async def main():

# Add Azure OpenAI chat completion
chat_completion = AzureChatCompletion(
deployment_name=model_name,
api_key=api_key,
# base_url 404 resource not found error
endpoint=azure_openai_endpoint,
api_version=api_version,
)

async with (
MCPStdioPlugin(
name="search",
description="duckduckgo search",
command=".venv/bin/uvx",
args=["duckduckgo-mcp-server"],
) as tool1
):
agent = ChatCompletionAgent(service=chat_completion,
name="PersonalAssistant",
instructions="You are helpful assistant.",
plugins=[tool1]
)

thread: ChatHistoryAgentThread | None = None

question = "UEFA Champions League 2025 champion?"

# Get the response from the AI
response = await agent.get_response(messages=question, thread=thread)
print(f"# {response.name}: {response} ")

await thread.delete() if thread else None

asyncio.run(main())

Result

# PersonalAssistant: The champion of the UEFA Champions League in 2025 was Paris Saint-Germain (PSG). They won the final against Inter Milan with a score of 5-0. The match took place on May 31, 2025, at the Allianz Arena in Munich, Germany.

For more details, you can check the following sources:
1. [Athlon Sports](https://athlonsports.com/soccer/uefa-recap-paris-saint-germain-captures-long-sought-champions-league-title)
2. [Sporting News](https://www.sportingnews.com/us/soccer/news/who-won-uefa-champions-league-final-2025-psg-inter-milan/a6898e7be49d6234feda2b6b)
3. [Topend Sports](https://www.topendsports.com/events/soccer/uefa-champions/2025.htm)

Appendix

--

--