Skip to content

Commit 9d8f220

Browse files
Zhengcy05KomachiSion
authored andcommitted
[#ISSUE 15430] Preserve transportProtocol in auto-built mcp endpoint spec (#15445)
* fix: normalize null MCP endpoint protocol in console management flow * fix: console-ui-new fix (cherry picked from commit acd679c)
1 parent 3f284df commit 9d8f220

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎console-ui-next/src/pages/mcpServerDetail/index.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,12 +875,13 @@ function EndpointItem({
875875
endpoint: { protocol: string; address: string; port: string; path?: string; headers?: { name: string; value?: string }[] };
876876
t: (key: string) => string;
877877
}) {
878-
const url = `${endpoint.protocol}://${endpoint.address}${endpoint.port ? ':' + endpoint.port : ''}${endpoint.path || ''}`;
878+
const protocol = endpoint.protocol || 'http';
879+
const url = `${protocol}://${endpoint.address}${endpoint.port ? ':' + endpoint.port : ''}${endpoint.path || ''}`;
879880
return (
880881
<div className="rounded-lg border bg-muted/20 p-3 space-y-2">
881882
<div className="flex items-center gap-2">
882883
<span className="inline-flex items-center rounded-md bg-primary/10 text-primary px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider">
883-
{endpoint.protocol}
884+
{protocol}
884885
</span>
885886
<span className="text-xs font-mono text-muted-foreground truncate">{url}</span>
886887
</div>

‎console-ui/src/pages/AI/McpManagement/McpManagement.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ class McpManagement extends React.Component {
367367
// 外部直连
368368
else if (data && data.backendEndpoints && data.backendEndpoints.length > 0) {
369369
// 解析address
370-
const protocol = data.backendEndpoints[0].protocol;
370+
const protocol = data.backendEndpoints[0].protocol || 'http';
371371
const address = data.backendEndpoints[0].address;
372372
const port = data.backendEndpoints[0].port;
373373
const exportPath = data.backendEndpoints[0].path;

0 commit comments

Comments
 (0)