feat(mcp): enhance MCP transport support and add server management UI

- Extend McpTransport to support "sse" in schemas.
- Refactor McpToolClient to handle both "streamable_http" and "sse" transports.
- Introduce McpServerDialog for managing MCP server configurations, including transport settings and tool synchronization.
- Replace McpServersSection with the new dialog component for improved server management.
- Add tests for MCP transport handling and server dialog functionality.
This commit is contained in:
Xin Wang
2026-07-19 12:04:11 +08:00
parent c54dac403b
commit f027ed99b7
8 changed files with 887 additions and 784 deletions

View File

@@ -399,7 +399,7 @@ export type McpServer = {
id: string;
name: string;
description: string;
transport: "streamable_http";
transport: "streamable_http" | "sse";
url: string;
timeoutSeconds: number;
headers: Record<string, string>;
@@ -438,6 +438,8 @@ export const mcpServersApi = {
request<McpSyncResult>(`/api/mcp-servers/${id}/sync`, {
method: "POST",
}),
tools: (id: string) =>
request<Tool[]>(`/api/mcp-servers/${id}/tools`),
remove: (id: string) =>
request<{ ok: boolean }>(`/api/mcp-servers/${id}`, {
method: "DELETE",