mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-08 00:10:21 +08:00
fix(frontend): passing the MCP header and env setting to backend (#810)
This pull request adds support for custom HTTP headers to the MCP server configuration and ensures that these headers are properly validated and included when adding new MCP servers. The changes are primarily focused on extending the schema and data handling for MCP server metadata.
This commit is contained in:
@@ -99,6 +99,8 @@ export function AddMCPServerDialog({
|
||||
transport: server.transport,
|
||||
name: key,
|
||||
url: server.url,
|
||||
env: server.env,
|
||||
headers: server.headers,
|
||||
};
|
||||
addingServers.push(metadata);
|
||||
}
|
||||
|
||||
@@ -47,6 +47,11 @@ export const MCPConfigSchema = z.object({
|
||||
message: "`env` must be an object of key-value pairs",
|
||||
})
|
||||
.optional(),
|
||||
headers: z
|
||||
.record(z.string(), {
|
||||
message: "`headers` must be an object of key-value pairs",
|
||||
})
|
||||
.optional(),
|
||||
transport: z
|
||||
.enum(["sse", "streamable_http"], {
|
||||
message: "transport must be either sse or streamable_http"
|
||||
|
||||
Reference in New Issue
Block a user