Skip to content

Error in sse_reader for MCP #6372

New issue

Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “No Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? No Sign in to your account

Open
amd-srijaroy opened this issue Apr 23, 2025 · 0 comments
Open

Error in sse_reader for MCP #6372

amd-srijaroy opened this issue Apr 23, 2025 · 0 comments

Comments

@amd-srijaroy
Copy link

What happened?

Describe the bug
Error in sse_reader: Expected response header Content-Type to contain 'text/event-stream', got 'text/html'

To Reproduce

from autogen_ext.tools.mcp import SseMcpToolAdapter, SseServerParams, mcp_server_tools
from autogen_agentchat.agents import AssistantAgent


# Create server params for the remote MCP service
server_params = SseServerParams(
    url="http://127.0.0.1:6274/",
    headers={"Authorization": "Bearer your-api-key"},
    timeout=30,  # Connection timeout in seconds
)

tools = await mcp_server_tools(server_params)

or

adapter = await SseMcpToolAdapter.from_server_params(server_params, "WikipediaAssistant")

Error: Error in sse_reader: Expected response header Content-Type to contain 'text/event-stream', got 'text/html'

But when I use the below (StdioServerParams), it works [both in local]

from autogen_agentchat.agents import AssistantAgent
from autogen_ext.tools.mcp import StdioServerParams, mcp_server_tools

# Get the fetch tool from mcp-server-fetch.
fetch_mcp_server = StdioServerParams(command="uvx", args=["mcp-server-fetch"])
tools = await mcp_server_tools(fetch_mcp_server)

Which packages was the bug in?

Python Extensions (autogen-ext)

AutoGen library version.

Python 0.5.4

Other library version.

No response

Model used

No response

Model provider

Azure OpenAI

Other model provider

No response

Python version

3.12

.NET version

None

Operating system

Ubuntu

No Sign up for free to join this conversation on GitHub. Already have an account? No Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant