mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-21 13:24:44 +08:00
feat: Add configurable timeout support for MCP server operations with improved defaults
This commit is contained in:
@@ -283,6 +283,13 @@ async def generate_prose(request: GenerateProseRequest):
|
||||
async def mcp_server_metadata(request: MCPServerMetadataRequest):
|
||||
"""Get information about an MCP server."""
|
||||
try:
|
||||
# Set default timeout with a longer value for this endpoint
|
||||
timeout = 300 # Default to 300 seconds for this endpoint
|
||||
|
||||
# Use custom timeout from request if provided
|
||||
if request.timeout_seconds is not None:
|
||||
timeout = request.timeout_seconds
|
||||
|
||||
# Load tools from the MCP server using the utility function
|
||||
tools = await load_mcp_tools(
|
||||
server_type=request.transport,
|
||||
@@ -290,6 +297,7 @@ async def mcp_server_metadata(request: MCPServerMetadataRequest):
|
||||
args=request.args,
|
||||
url=request.url,
|
||||
env=request.env,
|
||||
timeout_seconds=timeout,
|
||||
)
|
||||
|
||||
# Create the response with tools
|
||||
|
||||
Reference in New Issue
Block a user