Skip to content

cannot work with "mcp.map.qq.com" Streamable HTTP or SSE #3397

Closed

Description

@zsq2010

Docs
https://lbs.qq.com/service/MCPServer/MCPServerGuide/userGuide


./adk_agent_samples/mcp_agent/agent.py

import os
from google.adk.agents import LlmAgent
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset
from google.adk.tools.mcp_tool.mcp_session_manager import (
SseConnectionParams,
StreamableHTTPConnectionParams,
)

你的腾讯地图 API Key

TENCENT_MAP_API_KEY = "xxxxx" // warn: fill in your key....

腾讯地图 MCP 端点

SSE (Server-Sent Events) 方式

TENCENT_MAP_SSE_URL = (
f"https://mcp.map.qq.com/sse?key={TENCENT_MAP_API_KEY}&format=0"
)

Streamable HTTP 方式

TENCENT_MAP_STREAMABLE_HTTP_URL = (
f"https://mcp.map.qq.com/mcp?key={TENCENT_MAP_API_KEY}&format=0"
)

root_agent = LlmAgent(
model="gemini-2.0-flash",
name="tencent_map_agent", #
instruction="You are a helpful assistant that can answer map-related questions using Tencent Map tools.",
tools=[
# 工具集1: 使用 SSE 方式连接
MCPToolset(
connection_params=SseConnectionParams(
url=TENCENT_MAP_SSE_URL,
timeout=30.0, # 增加连接超时时间
sse_read_timeout=60.0, # 增加读取超时时间
)
),
# 工具集2: 使用 Streamable HTTP 方式连接
MCPToolset(
connection_params=StreamableHTTPConnectionParams(
url=TENCENT_MAP_STREAMABLE_HTTP_URL,
timeout=30.0, # 增加连接超时时间
sse_read_timeout=60.0, # 增加读取超时时间
)
),
],
)

I cannnot connect both ways

Activity

  1. added
    mcp[Component] This issues is related to MCP support
    on Nov 5, 2025
  2. added
    tools[Component] This issue is related to tools
    on Nov 5, 2025
  3. added theissue type on Nov 5, 2025
  4. zsq2010 commented on Nov 5, 2025

    @zsq2010
    Author
    import os
    from google.adk.agents import LlmAgent
    from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset
    from google.adk.tools.mcp_tool.mcp_session_manager import (
        SseConnectionParams,
        StreamableHTTPConnectionParams,
    )
    
    # 你的腾讯地图 API Key
    TENCENT_MAP_API_KEY = ""
    
    # 腾讯地图 MCP 端点
    # SSE (Server-Sent Events) 方式
    TENCENT_MAP_SSE_URL = (
        f"https://mcp.map.qq.com/sse?key={TENCENT_MAP_API_KEY}&format=0"
    )
    # Streamable HTTP 方式
    TENCENT_MAP_STREAMABLE_HTTP_URL = (
        f"https://mcp.map.qq.com/mcp?key={TENCENT_MAP_API_KEY}&format=0"
    )
    
    
    root_agent = LlmAgent(
        model="gemini-2.0-flash",
        name="tencent_map_agent",  # 更新 agent 名称
        instruction="You are a helpful assistant that can answer map-related questions using Tencent Map tools.",
        tools=[
            # 工具集1: 使用 SSE 方式连接
            MCPToolset(
                connection_params=SseConnectionParams(
                    url=TENCENT_MAP_SSE_URL,
                    timeout=30.0,  # 增加连接超时时间
                    sse_read_timeout=60.0, # 增加读取超时时间
                )
            ),
            # 工具集2: 使用 Streamable HTTP 方式连接
            MCPToolset(
                connection_params=StreamableHTTPConnectionParams(
                    url=TENCENT_MAP_STREAMABLE_HTTP_URL,
                    timeout=30.0, # 增加连接超时时间
                    sse_read_timeout=60.0, # 增加读取超时时间
                )
            ),
        ],
    )
    
    
    
  5. locked and limited conversation to collaborators on Nov 8, 2025
  6. converted this issue into a discussion #3453 on Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

mcp[Component] This issues is related to MCP supporttools[Component] This issue is related to tools

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions