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:
Willem Jiang
2026-01-09 22:52:49 +08:00
committed by GitHub
parent 8c59f63d1b
commit 336040310c
2 changed files with 7 additions and 0 deletions

View File

@@ -99,6 +99,8 @@ export function AddMCPServerDialog({
transport: server.transport,
name: key,
url: server.url,
env: server.env,
headers: server.headers,
};
addingServers.push(metadata);
}

View File

@@ -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"