mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-04-27 04:08:30 +00:00
* fix: _create_streamable_http_session() got an unexpected keyword argument 'env' fix unit error * update md --------- Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
65 lines
2.0 KiB
Python
65 lines
2.0 KiB
Python
# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
from typing import Dict, List, Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class MCPServerMetadataRequest(BaseModel):
|
|
"""Request model for MCP server metadata."""
|
|
|
|
transport: str = Field(
|
|
...,
|
|
description=(
|
|
"The type of MCP server connection (stdio or sse or streamable_http)"
|
|
),
|
|
)
|
|
command: Optional[str] = Field(
|
|
None, description="The command to execute (for stdio type)"
|
|
)
|
|
args: Optional[List[str]] = Field(
|
|
None, description="Command arguments (for stdio type)"
|
|
)
|
|
url: Optional[str] = Field(
|
|
None, description="The URL of the SSE server (for sse type)"
|
|
)
|
|
env: Optional[Dict[str, str]] = Field(
|
|
None, description="Environment variables (for stdio type)"
|
|
)
|
|
headers: Optional[Dict[str, str]] = Field(
|
|
None, description="HTTP headers (for sse/streamable_http type)"
|
|
)
|
|
timeout_seconds: Optional[int] = Field(
|
|
None, description="Optional custom timeout in seconds for the operation"
|
|
)
|
|
|
|
|
|
class MCPServerMetadataResponse(BaseModel):
|
|
"""Response model for MCP server metadata."""
|
|
|
|
transport: str = Field(
|
|
...,
|
|
description=(
|
|
"The type of MCP server connection (stdio or sse or streamable_http)"
|
|
),
|
|
)
|
|
command: Optional[str] = Field(
|
|
None, description="The command to execute (for stdio type)"
|
|
)
|
|
args: Optional[List[str]] = Field(
|
|
None, description="Command arguments (for stdio type)"
|
|
)
|
|
url: Optional[str] = Field(
|
|
None, description="The URL of the SSE server (for sse type)"
|
|
)
|
|
env: Optional[Dict[str, str]] = Field(
|
|
None, description="Environment variables (for stdio type)"
|
|
)
|
|
headers: Optional[Dict[str, str]] = Field(
|
|
None, description="HTTP headers (for sse/streamable_http type)"
|
|
)
|
|
tools: List = Field(
|
|
default_factory=list, description="Available tools from the MCP server"
|
|
)
|