Files
LangBot/web/src/app/home/plugins/components/plugin-installed/ExtensionCardVO.ts
T
RockChinQ 64ed6d994b 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
2026-06-21 11:20:32 -04:00

62 lines
1.6 KiB
TypeScript

export type ExtensionType = 'plugin' | 'mcp' | 'skill';
export interface IExtensionCardVO {
id: string;
author: string;
label: string;
name: string;
description: string;
version: string;
enabled: boolean;
type: ExtensionType;
iconURL?: string;
install_source?: string;
install_info?: Record<string, unknown>;
status?: string;
debug?: boolean;
hasUpdate?: boolean;
runtimeStatus?: 'connecting' | 'connected' | 'error' | 'disabled';
tools?: number;
mode?: 'stdio' | 'sse' | 'http' | 'remote';
}
export class ExtensionCardVO implements IExtensionCardVO {
id: string;
author: string;
label: string;
name: string;
description: string;
version: string;
enabled: boolean;
type: ExtensionType;
iconURL?: string;
install_source?: string;
install_info?: Record<string, unknown>;
status?: string;
debug?: boolean;
hasUpdate?: boolean;
runtimeStatus?: 'connecting' | 'connected' | 'error' | 'disabled';
tools?: number;
mode?: 'stdio' | 'sse' | 'http' | 'remote';
constructor(prop: IExtensionCardVO) {
this.id = prop.id;
this.author = prop.author;
this.label = prop.label;
this.name = prop.name;
this.description = prop.description;
this.version = prop.version;
this.enabled = prop.enabled;
this.type = prop.type;
this.iconURL = prop.iconURL;
this.install_source = prop.install_source;
this.install_info = prop.install_info;
this.status = prop.status;
this.debug = prop.debug;
this.hasUpdate = prop.hasUpdate;
this.runtimeStatus = prop.runtimeStatus;
this.tools = prop.tools;
this.mode = prop.mode;
}
}