mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-05-21 15:36:48 +00:00
fix(config): Add support for MCP server configuration parameters (#812)
* fix(config): Add support for MCP server configuration parameters * refact: rename the sse_readtimeout to sse_read_timeout * update the code with review comments * update the MCP document for the latest change
This commit is contained in:
+6
-2
@@ -1046,13 +1046,16 @@ async def mcp_server_metadata(request: MCPServerMetadataRequest):
|
||||
)
|
||||
|
||||
try:
|
||||
# Set default timeout with a longer value for this endpoint
|
||||
timeout = 300 # Default to 300 seconds for this endpoint
|
||||
# Set default timeout for this endpoint (configurable via env)
|
||||
timeout = get_int_env("MCP_DEFAULT_TIMEOUT_SECONDS", 60)
|
||||
|
||||
# Use custom timeout from request if provided
|
||||
if request.timeout_seconds is not None:
|
||||
timeout = request.timeout_seconds
|
||||
|
||||
# Get sse_read_timeout from request if provided
|
||||
sse_read_timeout = request.sse_read_timeout
|
||||
|
||||
# Load tools from the MCP server using the utility function
|
||||
tools = await load_mcp_tools(
|
||||
server_type=request.transport,
|
||||
@@ -1062,6 +1065,7 @@ async def mcp_server_metadata(request: MCPServerMetadataRequest):
|
||||
env=request.env,
|
||||
headers=request.headers,
|
||||
timeout_seconds=timeout,
|
||||
sse_read_timeout=sse_read_timeout,
|
||||
)
|
||||
|
||||
# Create the response with tools
|
||||
|
||||
Reference in New Issue
Block a user