mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-11 08:16:03 +00:00
feat(mcp): add streamable HTTP and stdio (#1911)
* feat(mcp): add streamable HTTP alongside with frontend UI change, w/ support for stdio * fix(mcp): address copilot reviews * Update src/langbot/pkg/provider/tools/loaders/mcp.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: resolve copilot reviews * fix: Message -> MessageChunk * feat: upgrade mcp module * feat: add i18n * feat(mcp): enhance MCPCardComponent with mode badge and reorder select items in MCPFormDialog --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: WangCham <651122857@qq.com> Co-authored-by: Junyan Qin (Chin) <rockchinq@gmail.com>
This commit is contained in:
@@ -365,6 +365,18 @@ export interface MCPServerExtraArgsSSE {
|
||||
ssereadtimeout: number;
|
||||
}
|
||||
|
||||
export interface MCPServerExtraArgsStdio {
|
||||
command: string;
|
||||
args: string[];
|
||||
env: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface MCPServerExtraArgsHttp {
|
||||
url: string;
|
||||
headers: Record<string, string>;
|
||||
timeout: number;
|
||||
}
|
||||
|
||||
export enum MCPSessionStatus {
|
||||
CONNECTING = 'connecting',
|
||||
CONNECTED = 'connected',
|
||||
@@ -373,21 +385,42 @@ export enum MCPSessionStatus {
|
||||
|
||||
export interface MCPServerRuntimeInfo {
|
||||
status: MCPSessionStatus;
|
||||
error_message: string;
|
||||
error_message?: string;
|
||||
tool_count: number;
|
||||
tools: MCPTool[];
|
||||
}
|
||||
|
||||
export interface MCPServer {
|
||||
uuid?: string;
|
||||
name: string;
|
||||
mode: 'stdio' | 'sse';
|
||||
enable: boolean;
|
||||
extra_args: MCPServerExtraArgsSSE;
|
||||
runtime_info?: MCPServerRuntimeInfo;
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
}
|
||||
export type MCPServer =
|
||||
| {
|
||||
uuid?: string;
|
||||
name: string;
|
||||
mode: 'sse';
|
||||
enable: boolean;
|
||||
extra_args: MCPServerExtraArgsSSE;
|
||||
runtime_info?: MCPServerRuntimeInfo;
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
}
|
||||
| {
|
||||
uuid?: string;
|
||||
name: string;
|
||||
mode: 'http';
|
||||
enable: boolean;
|
||||
extra_args: MCPServerExtraArgsHttp;
|
||||
runtime_info?: MCPServerRuntimeInfo;
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
}
|
||||
| {
|
||||
uuid?: string;
|
||||
name: string;
|
||||
mode: 'stdio';
|
||||
enable: boolean;
|
||||
extra_args: MCPServerExtraArgsStdio;
|
||||
runtime_info?: MCPServerRuntimeInfo;
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
};
|
||||
|
||||
export interface MCPTool {
|
||||
name: string;
|
||||
|
||||
Reference in New Issue
Block a user