File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ class MCPToolConfig(FunctionBaseConfig, name="mcp_tool_wrapper"):
33
33
function.
34
34
"""
35
35
# Add your custom configuration parameters here
36
- url : HttpUrl = Field (description = "The URL of the MCP server (for SSE mode)" )
36
+ url : HttpUrl | None = Field (default = None , description = "The URL of the MCP server (for SSE mode)" )
37
37
mcp_tool_name : str = Field (description = "The name of the tool served by the MCP Server that you want to use" )
38
38
client_type : str = Field (default = "sse" , description = "The type of client to use ('sse' or 'stdio')" )
39
39
command : str | None = Field (default = None , description = "The command to run for stdio mode (e.g. 'mcp-server')" )
@@ -64,6 +64,8 @@ async def mcp_tool(config: MCPToolConfig, builder: Builder): # pylint: disable=
64
64
raise ValueError ("command is required when using stdio client type" )
65
65
client = MCPBuilder (url = config .command , client_type = config .client_type , args = config .args )
66
66
else :
67
+ if not config .url :
68
+ raise ValueError ("url is required when using sse client type" )
67
69
client = MCPBuilder (url = str (config .url ), client_type = config .client_type )
68
70
69
71
tool : MCPToolClient = await client .get_tool (config .mcp_tool_name )
You can’t perform that action at this time.
0 commit comments