mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-18 03:54:46 +08:00
improve: add abort btn to abort the mcp add request. (#284)
This commit is contained in:
@@ -5,13 +5,14 @@ import type { SimpleMCPServerMetadata } from "../mcp";
|
||||
|
||||
import { resolveServiceURL } from "./resolve-service-url";
|
||||
|
||||
export async function queryMCPServerMetadata(config: SimpleMCPServerMetadata) {
|
||||
export async function queryMCPServerMetadata(config: SimpleMCPServerMetadata, signal?: AbortSignal) {
|
||||
const response = await fetch(resolveServiceURL("mcp/server/metadata"), {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(config),
|
||||
signal,
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
|
||||
Reference in New Issue
Block a user