feat: Adds MCP_SSE to be filled from frontend (#7594)
* add mcp sse to copy field
* add MCP_SSE from frontend
* [autofix.ci] apply automated fixes
* refactor: reorder imports in mcp_component.py for consistency
* ✅ (mcp-server.spec.ts): refactor code to use consistent selector for sse_url textarea element in tests
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
This commit is contained in:
parent
67f744cdf2
commit
0ba8f6559c
4 changed files with 31 additions and 30 deletions
|
|
@ -15,7 +15,7 @@ from langflow.base.mcp.util import (
|
|||
from langflow.custom import Component
|
||||
from langflow.inputs import DropdownInput
|
||||
from langflow.inputs.inputs import InputTypes
|
||||
from langflow.io import MessageTextInput, Output, TabInput
|
||||
from langflow.io import MessageTextInput, MultilineInput, Output, TabInput
|
||||
from langflow.io.schema import schema_to_langflow_inputs
|
||||
from langflow.logging import logger
|
||||
from langflow.schema import Message
|
||||
|
|
@ -52,7 +52,7 @@ class MCPToolsComponent(Component):
|
|||
show=True,
|
||||
refresh_button=True,
|
||||
),
|
||||
MessageTextInput(
|
||||
MultilineInput(
|
||||
name="sse_url",
|
||||
display_name="MCP SSE URL",
|
||||
info="URL for MCP SSE connection",
|
||||
|
|
@ -147,9 +147,7 @@ class MCPToolsComponent(Component):
|
|||
elif field_value == "SSE":
|
||||
build_config["command"]["show"] = False
|
||||
build_config["sse_url"]["show"] = True
|
||||
_, port, _ = await self.find_langflow_instance()
|
||||
if port:
|
||||
build_config["sse_url"]["value"] = f"http://localhost:{port}/api/v1/mcp/sse"
|
||||
build_config["sse_url"]["value"] = "MCP_SSE"
|
||||
return build_config
|
||||
if field_name in ("command", "sse_url", "mode"):
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue