feat(mcp): simplify external MCP server config to local/remote modes

Replace the three-way transport choice (stdio / sse / httpstream) for
connecting LangBot to external MCP servers with two modes: local (stdio)
and remote. Remote servers only require a URL; the runtime auto-detects
the transport (tries Streamable HTTP, falls back to SSE).

- provider/tools/loaders/mcp.py: add _init_remote_server() with
  Streamable-HTTP-then-SSE probing; dispatch 'remote' lifecycle, keep
  legacy sse/http branches for back-compat
- plugin/connector.py: normalize legacy http/sse marketplace modes to
  'remote' on Space install, preserving connection params
- entity/persistence/mcp.py: document mode as stdio, remote (legacy: sse, http)
- alembic 0006: idempotent data migration mapping existing sse/http rows
  to remote (downgrade maps back to http)
- api/http/service/mcp.py: stash runtime_info (status + tool list) into
  test task metadata before tearing down the temp session
- web: collapse mode dropdown to local/remote, remote renders URL+timeout
  only, edit auto-maps legacy sse/http to remote; show tools after test in
  create mode from task metadata; remove dead plugins/mcp-server/ tree
- i18n: local/remote labels + mode/url hints across 8 locales
This commit is contained in:
RockChinQ
2026-06-21 11:20:32 -04:00
parent 2ff854f79a
commit 64ed6d994b
21 changed files with 268 additions and 1389 deletions
+9
View File
@@ -754,6 +754,15 @@ const enUS = {
stdio: 'Stdio Mode',
sse: 'SSE Mode',
http: 'HTTP Mode',
local: 'Local (Stdio)',
remote: 'Remote',
localModeDescription:
'Run an MCP server locally as a subprocess inside the Box sandbox.',
remoteModeDescription:
'Connect to a remote MCP server by URL. The transport (Streamable HTTP or SSE) is detected automatically.',
remoteUrlPlaceholder: 'https://example.com/mcp',
remoteUrlDescription:
'Paste the MCP server URL. Both Streamable HTTP and legacy SSE endpoints are supported.',
noServerInstalled: 'No MCP servers configured',
serverNameRequired: 'Server name cannot be empty',
commandRequired: 'Command cannot be empty',
+9
View File
@@ -768,6 +768,15 @@ const esES = {
stdio: 'Modo Stdio',
sse: 'Modo SSE',
http: 'Modo HTTP',
local: 'Local (Stdio)',
remote: 'Remoto',
localModeDescription:
'Ejecuta un servidor MCP localmente como subproceso dentro del sandbox de Box.',
remoteModeDescription:
'Conéctate a un servidor MCP remoto por URL. El transporte (Streamable HTTP o SSE) se detecta automáticamente.',
remoteUrlPlaceholder: 'https://example.com/mcp',
remoteUrlDescription:
'Pega la URL del servidor MCP. Se admiten tanto endpoints Streamable HTTP como SSE heredados.',
noServerInstalled: 'No hay servidores MCP configurados',
serverNameRequired: 'El nombre del servidor no puede estar vacío',
commandRequired: 'El comando no puede estar vacío',
+8
View File
@@ -759,6 +759,14 @@ const jaJP = {
stdio: 'Stdioモード',
sse: 'SSEモード',
http: 'HTTPモード',
local: 'ローカル(Stdio',
remote: 'リモート',
localModeDescription: 'Box サンドボックス内でサブプロセスとして MCP サーバーをローカル実行します。',
remoteModeDescription:
'URL でリモート MCP サーバーに接続します。トランスポート(Streamable HTTP または SSE)は自動検出されます。',
remoteUrlPlaceholder: 'https://example.com/mcp',
remoteUrlDescription:
'MCP サーバーの URL を貼り付けてください。Streamable HTTP と従来の SSE エンドポイントの両方に対応しています。',
selectMode: '接続モードを選択',
noServerInstalled: 'MCPサーバーが設定されていません',
serverNameRequired: 'サーバー名は必須です',
+9
View File
@@ -765,6 +765,15 @@ const ruRU = {
stdio: 'Режим Stdio',
sse: 'Режим SSE',
http: 'Режим HTTP',
local: 'Локально (Stdio)',
remote: 'Удалённо',
localModeDescription:
'Запуск MCP-сервера локально как подпроцесса внутри песочницы Box.',
remoteModeDescription:
'Подключение к удалённому MCP-серверу по URL. Транспорт (Streamable HTTP или SSE) определяется автоматически.',
remoteUrlPlaceholder: 'https://example.com/mcp',
remoteUrlDescription:
'Вставьте URL MCP-сервера. Поддерживаются как Streamable HTTP, так и устаревшие SSE-эндпоинты.',
noServerInstalled: 'MCP-серверы не настроены',
serverNameRequired: 'Имя сервера не может быть пустым',
commandRequired: 'Команда не может быть пустой',
+9
View File
@@ -743,6 +743,15 @@ const thTH = {
stdio: 'โหมด Stdio',
sse: 'โหมด SSE',
http: 'โหมด HTTP',
local: 'ภายในเครื่อง (Stdio)',
remote: 'ระยะไกล',
localModeDescription:
'รันเซิร์ฟเวอร์ MCP ภายในเครื่องเป็นโปรเซสย่อยภายในแซนด์บ็อกซ์ Box',
remoteModeDescription:
'เชื่อมต่อกับเซิร์ฟเวอร์ MCP ระยะไกลด้วย URL ระบบจะตรวจจับการขนส่ง (Streamable HTTP หรือ SSE) โดยอัตโนมัติ',
remoteUrlPlaceholder: 'https://example.com/mcp',
remoteUrlDescription:
'วาง URL ของเซิร์ฟเวอร์ MCP รองรับทั้งเอนด์พอยต์ Streamable HTTP และ SSE แบบเดิม',
noServerInstalled: 'ยังไม่มีเซิร์ฟเวอร์ MCP ที่กำหนดค่า',
serverNameRequired: 'ชื่อเซิร์ฟเวอร์ต้องไม่ว่างเปล่า',
commandRequired: 'คำสั่งต้องไม่ว่างเปล่า',
+9
View File
@@ -758,6 +758,15 @@ const viVN = {
stdio: 'Chế độ Stdio',
sse: 'Chế độ SSE',
http: 'Chế độ HTTP',
local: 'Cục bộ (Stdio)',
remote: 'Từ xa',
localModeDescription:
'Chạy máy chủ MCP cục bộ dưới dạng tiến trình con bên trong sandbox Box.',
remoteModeDescription:
'Kết nối đến máy chủ MCP từ xa bằng URL. Phương thức truyền tải (Streamable HTTP hoặc SSE) được phát hiện tự động.',
remoteUrlPlaceholder: 'https://example.com/mcp',
remoteUrlDescription:
'Dán URL của máy chủ MCP. Hỗ trợ cả endpoint Streamable HTTP và SSE cũ.',
noServerInstalled: 'Chưa cấu hình máy chủ MCP nào',
serverNameRequired: 'Tên máy chủ không được để trống',
commandRequired: 'Lệnh không được để trống',
+8
View File
@@ -722,6 +722,14 @@ const zhHans = {
stdio: 'Stdio模式',
sse: 'SSE模式',
http: 'HTTP模式',
local: '本地(Stdio',
remote: '远程',
localModeDescription: '在 Box 沙箱中以子进程方式本地运行 MCP 服务器。',
remoteModeDescription:
'通过 URL 连接远程 MCP 服务器,传输方式(Streamable HTTP 或 SSE)将自动检测。',
remoteUrlPlaceholder: 'https://example.com/mcp',
remoteUrlDescription:
'粘贴 MCP 服务器链接即可,同时支持 Streamable HTTP 和旧版 SSE 端点。',
noServerInstalled: '暂未配置任何 MCP 服务器',
serverNameRequired: '服务器名称不能为空',
commandRequired: '命令不能为空',
+8
View File
@@ -721,6 +721,14 @@ const zhHant = {
sse: 'SSE模式',
selectMode: '選擇連接模式',
http: 'HTTP模式',
local: '本機(Stdio',
remote: '遠端',
localModeDescription: '在 Box 沙箱中以子程序方式於本機執行 MCP 伺服器。',
remoteModeDescription:
'透過 URL 連接遠端 MCP 伺服器,傳輸方式(Streamable HTTP 或 SSE)將自動偵測。',
remoteUrlPlaceholder: 'https://example.com/mcp',
remoteUrlDescription:
'貼上 MCP 伺服器連結即可,同時支援 Streamable HTTP 與舊版 SSE 端點。',
noServerInstalled: '暫未設定任何MCP伺服器',
serverNameRequired: '伺服器名稱不能為空',
commandRequired: '命令不能為空',