fix: copy env_vars when duplicating MCP server

Addresses Greptile feedback: servers using ${VAR_NAME} interpolation in
static_headers would have broken references after duplication because
env_vars was not being copied.

https://claude.ai/code/session_01Wx49QQnsCngnJ7hsfaC1yC
This commit is contained in:
mateo-berri 2026-06-06 22:33:24 +00:00
parent 7c23282da7
commit e3f8813dfc
No known key found for this signature in database

View file

@ -347,6 +347,15 @@ const CreateMCPServer: React.FC<CreateMCPServerProps> = ({
}));
}
if (duplicateServer.env_vars && duplicateServer.env_vars.length > 0) {
prefillValues.env_vars = duplicateServer.env_vars.map((v) => ({
name: v.name,
value: v.value,
scope: v.scope,
description: v.description || "",
}));
}
if (duplicateServer.is_byok) {
prefillValues.is_byok = true;
prefillValues.byok_description = duplicateServer.byok_description || [];