Repository: alibaba/nacos (2025-07-28T07:53:01Z)

Issue:
nacos 支持 mcp server 配置透明认证
higress 开启透明认证 (Passthrough Authentication)，需要配置 securitySchemes，但是如果是使用托管的nacos 的 mcp server 配置，没有地方设置

----------------------------------------------

When enabling Passthrough Authentication in Higress, it is necessary to configure securitySchemes. However, if using a managed Nacos MCP server for configuration, there is no place to set it.


Discussion:
cc @luoxiner 
+1
这个有计划做吗，太需要这个功能了，托管的接口需要多个headers透传，现在请求higress->nacos->原始接口，header没办法一直带下去
新版本正在支持中，预计下个版本支持
HuaJieHappy ***@***.***>于2025年7月23日 周三17:28写道：

> *HuaJieHappy* left a comment (alibaba/nacos#13455)
> <https://github.com/alibaba/nacos/issues/13455#issuecomment-3106703993>
>
> 这个有计划做吗，太需要这个功能了，托管的接口需要多个headers透传，现在请求higress->nacos->原始接口，header没办法一直带下去
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/alibaba/nacos/issues/13455#issuecomment-3106703993>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/APT6JS3GRQVDOSGAZMOISGL3J5ITTAVCNFSM6AAAAAB6ORE24CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCMBWG4YDGOJZGM>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>




Patch:
diff --git a/ai/src/main/java/com/alibaba/nacos/ai/service/McpServerOperationService.java b/ai/src/main/java/com/alibaba/nacos/ai/service/McpServerOperationService.java
index 2cc642de624..836180037d1 100644
--- a/ai/src/main/java/com/alibaba/nacos/ai/service/McpServerOperationService.java
+++ b/ai/src/main/java/com/alibaba/nacos/ai/service/McpServerOperationService.java
@@ -466,8 +466,11 @@ public void deleteMcpServer(String namespaceId, String mcpName, String mcpServer
     private void injectToolAndEndpoint(String namespaceId, String mcpServerId, McpServerStorageInfo serverSpecification,
             McpToolSpecification toolSpecification, McpEndpointSpec endpointSpecification) throws NacosException {
         serverSpecification.setCapabilities(new LinkedList<>());
-        if (null != toolSpecification && null != toolSpecification.getTools() && !toolSpecification.getTools()
-                .isEmpty()) {
+        boolean hasToolSpec = toolSpecification != null;
+        boolean hasTools = hasToolSpec && toolSpecification.getTools() != null;
+        boolean hasSecuritySchemes = hasToolSpec && toolSpecification.getSecuritySchemes() != null;
+        boolean shouldCreateToolConfig = hasToolSpec && (hasTools || hasSecuritySchemes);
+        if (shouldCreateToolConfig) {
             toolOperationService.refreshMcpTool(namespaceId, serverSpecification, toolSpecification);
             serverSpecification.getCapabilities().add(McpCapability.TOOL);
             String version = serverSpecification.getVersionDetail().getVersion();
diff --git a/api/src/main/java/com/alibaba/nacos/api/ai/model/mcp/McpToolSpecification.java b/api/src/main/java/com/alibaba/nacos/api/ai/model/mcp/McpToolSpecification.java
index 527b88d041f..21e520cb2a2 100644
--- a/api/src/main/java/com/alibaba/nacos/api/ai/model/mcp/McpToolSpecification.java
+++ b/api/src/main/java/com/alibaba/nacos/api/ai/model/mcp/McpToolSpecification.java
@@ -16,6 +16,7 @@
 
 package com.alibaba.nacos.api.ai.model.mcp;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
@@ -32,6 +33,8 @@ public class McpToolSpecification {
     
     private Map<String, McpToolMeta> toolsMeta = new HashMap<>(1);
     
+    private List<SecurityScheme> securitySchemes = new ArrayList<>();
+    
     public List<McpTool> getTools() {
         return tools;
     }
@@ -47,4 +50,12 @@ public Map<String, McpToolMeta> getToolsMeta() {
     public void setToolsMeta(Map<String, McpToolMeta> toolsMeta) {
         this.toolsMeta = toolsMeta;
     }
+
+    public List<SecurityScheme> getSecuritySchemes() {
+        return securitySchemes;
+    }
+
+    public void setSecuritySchemes(List<SecurityScheme> securitySchemes) {
+        this.securitySchemes = securitySchemes;
+    }
 }
diff --git a/api/src/main/java/com/alibaba/nacos/api/ai/model/mcp/SecurityScheme.java b/api/src/main/java/com/alibaba/nacos/api/ai/model/mcp/SecurityScheme.java
new file mode 100644
index 00000000000..a8b8186e054
--- /dev/null
+++ b/api/src/main/java/com/alibaba/nacos/api/ai/model/mcp/SecurityScheme.java
@@ -0,0 +1,70 @@
+package com.alibaba.nacos.api.ai.model.mcp;
+
+/**
+ * SecurityScheme 表示安全认证方案的模型，包括类型、方案、位置、名称及默认凭证等信息.
+ * 用于描述 API 的安全机制.
+ *
+ * @author xinluo
+ */
+public class SecurityScheme {
+    
+    private String id;
+    
+    private String type;
+    
+    private String scheme;
+    
+    private String in;
+    
+    private String name;
+    
+    private String defaultCredential;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getScheme() {
+        return scheme;
+    }
+
+    public void setScheme(String scheme) {
+        this.scheme = scheme;
+    }
+
+    public String getIn() {
+        return in;
+    }
+
+    public void setIn(String in) {
+        this.in = in;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDefaultCredential() {
+        return defaultCredential;
+    }
+
+    public void setDefaultCredential(String defaultCredential) {
+        this.defaultCredential = defaultCredential;
+    }
+}
diff --git a/console-ui/src/locales/en-US.js b/console-ui/src/locales/en-US.js
index ebd7ba763f0..e72a0dc52bf 100644
--- a/console-ui/src/locales/en-US.js
+++ b/console-ui/src/locales/en-US.js
@@ -736,6 +736,7 @@ const I18N_CONF = {
     basicInformation: 'Basic Information',
     serviceRef: 'Service Reference',
     mcpServerDetail: 'MCP Server Details',
+    version: 'Version',
     operationToolDetail: 'Details',
     operationToolEdit: 'Edit',
     operationToolDelete: 'Delete',
@@ -799,6 +800,19 @@ const I18N_CONF = {
     versionIsPublished: 'published',
     versionIsDraft: 'draft',
     noAvailableEndpoint: 'no available endpoint',
+    // Transparent authentication related
+    transparentAuth: 'Enable Transparent Auth',
+    enable: 'Enable',
+    disable: 'Disable',
+    selectSecurityScheme: 'Select Security Scheme',
+    pleaseSelectSecurityScheme: 'Please select security scheme',
+    // Security Schemes display related
+    backendServiceAuth: 'Backend Service Authentication',
+    authType: 'Authentication Type',
+    authScheme: 'Authentication Scheme',
+    keyLocation: 'Key Location',
+    keyName: 'Key Name',
+    defaultCredential: 'Default Credential',
   },
   NewMcpServer: {
     pleaseComplete: 'Please complete the basic configuration first',
@@ -912,6 +926,8 @@ const I18N_CONF = {
       'Converting existing HTTP services to MCP services requires the use of a gateway. Please refer to the documentation. https://nacos.io/docs/v3.0/manual/user/mcp-template',
     httpToMcpDoc:
       'Protocol transformation is performed using the conversion template provided by the gateway. For more details, please refer to the documentation. https://nacos.io/docs/v3.0/manual/user/mcp-template',
+    versionFormatError: 'Version must follow x.y.z format, where x, y, z are numbers',
+    cannotUseExistVersion: 'Cannot use an existing version',
     editServerMustChangVersion: 'edit MCP Server must change version',
     editExistVersionMessage:
       'The currently published version is being modified; only the descriptions of the Tool and parameters, as well as the toggle switches, can be changed.',
@@ -920,6 +936,29 @@ const I18N_CONF = {
     createNewVersionAndSave: 'Save',
     createNewVersionAndPublish: 'Publish',
     off: 'off',
+    // Transparent authentication related
+    transparentAuth: 'Enable Transparent Auth',
+    enable: 'Enable',
+    disable: 'Disable',
+    selectSecurityScheme: 'Select Security Scheme',
+    pleaseSelectSecurityScheme: 'Please select security scheme',
+    // Security Schemes related
+    securitySchemes: 'Security Schemes',
+    addSecurityScheme: 'Add Security Scheme',
+    schemeId: 'ID',
+    schemeType: 'Authentication Type',
+    scheme: 'Scheme',
+    keyLocation: 'Key Location',
+    keyName: 'Key Name',
+    defaultCredential: 'Default Credential',
+    pleaseSelect: 'Please select',
+    selectScheme: 'Select Authentication Scheme',
+    delete: 'Delete',
+    templateParseError: 'Template format error, please check JSON format',
+    templatePreview: 'Template Preview (After Security Injection)',
+    templatePreviewError: 'Template format error, unable to preview',
+    backendAuth: 'Backend Authentication',
+    clientAuth: 'Client Authentication',
   },
   CredentialManagement: {
     credentialManagement8: 'Credential Management',
diff --git a/console-ui/src/locales/zh-CN.js b/console-ui/src/locales/zh-CN.js
index 7ff18224047..96e573fcf1f 100644
--- a/console-ui/src/locales/zh-CN.js
+++ b/console-ui/src/locales/zh-CN.js
@@ -730,6 +730,7 @@ const I18N_CONF = {
   McpDetail: {
     basicInformation: '基本信息',
     serviceRef: '服务引用',
+    version: '版本',
     mcpServerDetail: 'MCP Server 详情',
     operationToolDetail: '详情',
     operationToolEdit: '编辑',
@@ -794,6 +795,19 @@ const I18N_CONF = {
     versionIsPublished: '已发布',
     versionIsDraft: '草稿',
     noAvailableEndpoint: '无可用的endpoint',
+    // 透明认证相关
+    transparentAuth: '启用透明认证',
+    enable: '启用',
+    disable: '禁用',
+    selectSecurityScheme: '选择认证方案',
+    pleaseSelectSecurityScheme: '请选择认证方案',
+    // Security Schemes 展示相关
+    backendServiceAuth: '后端服务认证方式',
+    authType: '认证类型',
+    authScheme: '认证方案',
+    keyLocation: '密钥位置',
+    keyName: '密钥名称',
+    defaultCredential: '默认凭证',
   },
   NewMcpServer: {
     pleaseComplete: '请先完善基础配置',
@@ -915,6 +929,29 @@ const I18N_CONF = {
     editExistVersionMessage: '当前正在修改已发布的版本，只能修改Tool以及参数的描述信息以及开关',
     editMoreNeedNewVersion: '修改其他信息请使用新的版本号',
     off: '关闭',
+    // 透明认证相关
+    transparentAuth: '启用透明认证',
+    enable: '启用',
+    disable: '禁用',
+    selectSecurityScheme: '选择认证方案',
+    pleaseSelectSecurityScheme: '请选择认证方案',
+    // Security Schemes 相关
+    securitySchemes: '安全认证方案',
+    addSecurityScheme: '添加认证方案',
+    schemeId: 'ID',
+    schemeType: '认证类型',
+    scheme: 'Scheme',
+    keyLocation: '密钥位置',
+    keyName: '密钥名称',
+    defaultCredential: '默认凭证',
+    pleaseSelect: '请选择',
+    selectScheme: '选择认证方案',
+    delete: '删除',
+    templateParseError: '模板格式错误，请检查 JSON 格式',
+    templatePreview: '模板预览（注入安全配置后）',
+    templatePreviewError: '模板格式错误，无法预览',
+    backendAuth: '后端认证方式',
+    clientAuth: '客户端认证方式',
   },
 };
 
diff --git a/console-ui/src/pages/AI/McpDetail/CreateTools/index.js b/console-ui/src/pages/AI/McpDetail/CreateTools/index.js
index 11aca926605..fcca4dc8a2b 100644
--- a/console-ui/src/pages/AI/McpDetail/CreateTools/index.js
+++ b/console-ui/src/pages/AI/McpDetail/CreateTools/index.js
@@ -16,6 +16,7 @@ import {
 import { formitemLayout, GetTitle, tableOperation } from './components';
 import { request } from '../../../../globalLib';
 import { object } from 'prop-types';
+import MonacoEditor from '../../../../components/MonacoEditor';
 
 const { Row, Col } = Grid;
 
@@ -28,6 +29,9 @@ const CreateTools = React.forwardRef((props, ref) => {
       toolParams: [],
       invokeContext: [],
       templates: '',
+      transparentAuth: false,
+      securitySchemeId: '',
+      clientSecuritySchemeId: '',
     },
   });
   const { init } = field;
@@ -39,6 +43,8 @@ const CreateTools = React.forwardRef((props, ref) => {
   const [rawData, setRawData] = useState([]);
   const [data, setData] = useState([]);
   const [args, setArgs] = useState({});
+  const [originalTemplate, setOriginalTemplate] = useState(''); // 存储原始模板
+  const [expandedKeys, setExpandedKeys] = useState(['args']); // 控制树节点展开状态
   const [currentNode, setCurrentNode] = useState({
     description: '',
     type: 'object',
@@ -96,6 +102,21 @@ const CreateTools = React.forwardRef((props, ref) => {
     return result;
   };
 
+  // 收集树中所有节点的key用于展开
+  const collectAllKeys = nodes => {
+    const keys = [];
+    const traverse = nodeList => {
+      nodeList.forEach(node => {
+        keys.push(node.key);
+        if (node.children && node.children.length > 0) {
+          traverse(node.children);
+        }
+      });
+    };
+    traverse(nodes);
+    return keys;
+  };
+
   const openVisible = ({ record, type, toolsMeta }) => {
     const { name, description, inputSchema } = record;
     setType(type);
@@ -131,6 +152,10 @@ const CreateTools = React.forwardRef((props, ref) => {
     setData(JSON.parse(JSON.stringify(rawData)));
     setArgs(args);
 
+    // 初始化时展开所有节点
+    const allKeys = collectAllKeys([rootNode]);
+    setExpandedKeys(allKeys);
+
     const _invokeContext = toolsMeta?.invokeContext
       ? Object.keys(toolsMeta?.invokeContext).map(key => ({
           key,
@@ -140,10 +165,44 @@ const CreateTools = React.forwardRef((props, ref) => {
     setInvokeIdx(_invokeContext.length + 1);
 
     let templatesStr = '';
+    let extractedSecuritySchemeId = '';
+    let extractedClientSecuritySchemeId = '';
+    let extractedTransparentAuth = false;
+
     if (toolsMeta?.templates !== undefined && 'json-go-template' in toolsMeta?.templates) {
       templatesStr = JSON.stringify(toolsMeta?.templates['json-go-template']);
+
+      // 从模板中提取安全方案ID和透明认证状态
+      try {
+        const templateObj = toolsMeta?.templates['json-go-template'];
+
+        // 提取后端认证方式 (从 requestTemplate.security 中)
+        if (templateObj?.requestTemplate?.security) {
+          const securityKeys = Object.keys(templateObj.requestTemplate.security);
+          if (securityKeys.length > 0) {
+            const securityObj = templateObj.requestTemplate.security[securityKeys[0]];
+            extractedSecuritySchemeId = securityObj?.id || securityKeys[0];
+          }
+        }
+
+        // 提取客户端认证方式和透明认证状态 (从根级别 security 中)
+        if (templateObj?.security) {
+          if (templateObj.security.id) {
+            extractedClientSecuritySchemeId = templateObj.security.id;
+          }
+          // 检查 passthrough 字段来确定透明认证状态
+          if (templateObj.security.passthrough === true) {
+            extractedTransparentAuth = true;
+          }
+        }
+      } catch (error) {
+        console.warn('Failed to parse template for security schemes:', error);
+      }
     }
 
+    // 设置原始模板
+    setOriginalTemplate(templatesStr);
+
     field.setValues({
       name,
       description,
@@ -152,6 +211,10 @@ const CreateTools = React.forwardRef((props, ref) => {
       invokeContext: _invokeContext,
       templates: templatesStr,
       enabled: toolsMeta?.enabled,
+      transparentAuth: extractedTransparentAuth || toolsMeta?.transparentAuth || false,
+      securitySchemeId: extractedSecuritySchemeId || toolsMeta?.securitySchemeId || '',
+      clientSecuritySchemeId:
+        extractedClientSecuritySchemeId || toolsMeta?.clientSecuritySchemeId || '',
     });
     setOkLoading(false);
     setVisible(true);
@@ -170,6 +233,9 @@ const CreateTools = React.forwardRef((props, ref) => {
       type: '',
       toolsMeta: {
         enabled: true,
+        transparentAuth: false,
+        securitySchemeId: '',
+        clientSecuritySchemeId: '',
       },
     });
   };
@@ -177,6 +243,8 @@ const CreateTools = React.forwardRef((props, ref) => {
   const closeDialog = () => {
     setVisible(false);
     setType('');
+    setOriginalTemplate('');
+    setExpandedKeys(['args']); // 重置展开状态
     setCurrentNode({
       description: '',
       type: 'object',
@@ -208,9 +276,18 @@ const CreateTools = React.forwardRef((props, ref) => {
         (records.protocol === 'http' || records.protocol === 'https') &&
         values?.templates?.length > 0
       ) {
-        const jsonGoTemplate = JSON.parse(values?.templates);
-        if (Object.keys(jsonGoTemplate).length > 0) {
-          templates['json-go-template'] = jsonGoTemplate;
+        try {
+          // 使用生成的模板（已经注入了安全配置）
+          let jsonGoTemplate = JSON.parse(generateTemplateWithSecurity());
+
+          if (Object.keys(jsonGoTemplate).length > 0) {
+            templates['json-go-template'] = jsonGoTemplate;
+          }
+        } catch (error) {
+          console.error('Error parsing template JSON:', error);
+          // 如果解析失败，跳过模板注入
+          Message.error(locale.templateParseError || '模板格式错误，请检查 JSON 格式');
+          return;
         }
       }
 
@@ -243,6 +320,9 @@ const CreateTools = React.forwardRef((props, ref) => {
           enabled: values?.enabled,
           invokeContext,
           templates,
+          transparentAuth: values?.transparentAuth || false,
+          securitySchemeId: values?.securitySchemeId || '',
+          clientSecuritySchemeId: values?.clientSecuritySchemeId || '',
         },
       };
       if (type == 'edit') {
@@ -345,6 +425,58 @@ const CreateTools = React.forwardRef((props, ref) => {
     }
   };
 
+  // 生成注入了安全配置的模板
+  const generateTemplateWithSecurity = () => {
+    try {
+      if (!originalTemplate || !field.getValue('transparentAuth')) {
+        return originalTemplate;
+      }
+
+      let jsonGoTemplate = JSON.parse(originalTemplate);
+      let modified = false;
+
+      // 注入后端认证方式
+      const securitySchemeId = field.getValue('securitySchemeId');
+      if (securitySchemeId) {
+        const selectedScheme = props?.serverConfig?.toolSpec?.securitySchemes?.find(
+          scheme => scheme.id === securitySchemeId
+        );
+
+        if (selectedScheme) {
+          if (!jsonGoTemplate.requestTemplate) {
+            jsonGoTemplate.requestTemplate = {};
+          }
+          jsonGoTemplate.requestTemplate.security = {
+            [selectedScheme.id]: {
+              id: selectedScheme.id,
+            },
+          };
+          modified = true;
+        }
+      }
+
+      // 注入客户端认证方式
+      const clientSecuritySchemeId = field.getValue('clientSecuritySchemeId');
+      if (clientSecuritySchemeId) {
+        const clientSelectedScheme = props?.serverConfig?.toolSpec?.securitySchemes?.find(
+          scheme => scheme.id === clientSecuritySchemeId
+        );
+
+        if (clientSelectedScheme) {
+          jsonGoTemplate.security = {
+            id: clientSelectedScheme.id,
+            passthrough: true,
+          };
+          modified = true;
+        }
+      }
+
+      return modified ? JSON.stringify(jsonGoTemplate, null, 2) : originalTemplate;
+    } catch (error) {
+      return originalTemplate;
+    }
+  };
+
   // 渲染表格
   const renderTableCell = params => {
     const {
@@ -425,31 +557,165 @@ const CreateTools = React.forwardRef((props, ref) => {
   };
 
   const AddPropertiesToArgs = () => {
-    const parentNode = args[currentNode.key];
+    // 总是在根级 args 下添加新参数
+    const parentNode = args['args'];
     if (!parentNode.children) {
       parentNode.children = [];
     }
     const childLen = parentNode.children.length + 1;
     const newArgsName = `newArg${childLen}`;
+    const newNodeKey = `args@@${newArgsName}`;
     const newNode = {
       label: newArgsName,
-      key: `${currentNode.key}@@${newArgsName}`,
+      key: newNodeKey,
       type: 'string',
       description: '',
       children: [],
     };
 
-    args[`${currentNode.key}@@${newArgsName}`] = newNode;
+    args[newNodeKey] = newNode;
     if (!parentNode.children) {
       parentNode.children = [];
     }
     parentNode.children.push(newNode);
+
+    // 确保新节点的父节点展开
+    const updatedExpandedKeys = [...expandedKeys];
+    if (!updatedExpandedKeys.includes('args')) {
+      updatedExpandedKeys.push('args');
+    }
+    setExpandedKeys(updatedExpandedKeys);
+
     setRawData(rawData);
     setArgs(args);
     setData(JSON.parse(JSON.stringify(rawData)));
     saveParamToFiled();
   };
 
+  // 为指定的节点添加属性
+  const AddPropertiesToCurrentNode = () => {
+    if (!currentNode || !currentNode.key || currentNode.type !== 'object') {
+      return;
+    }
+
+    const parentNode = args[currentNode.key];
+    if (!parentNode.children) {
+      parentNode.children = [];
+    }
+    const childLen = parentNode.children.length + 1;
+    const newPropertyName = `newProperty${childLen}`;
+    const newNodeKey = `${currentNode.key}@@${newPropertyName}`;
+    const newNode = {
+      label: newPropertyName,
+      key: newNodeKey,
+      type: 'string',
+      description: '',
+      children: [],
+    };
+
+    args[newNodeKey] = newNode;
+    if (!parentNode.children) {
+      parentNode.children = [];
+    }
+    parentNode.children.push(newNode);
+
+    // 确保当前节点展开，以显示新添加的属性
+    const updatedExpandedKeys = [...expandedKeys];
+    if (!updatedExpandedKeys.includes(currentNode.key)) {
+      updatedExpandedKeys.push(currentNode.key);
+    }
+    setExpandedKeys(updatedExpandedKeys);
+
+    setRawData(rawData);
+    setArgs(args);
+    setData(JSON.parse(JSON.stringify(rawData)));
+    saveParamToFiled();
+  };
+
+  // 删除参数或属性
+  const deleteNode = nodeKey => {
+    if (nodeKey === 'args') {
+      // 不允许删除根节点
+      return;
+    }
+
+    // 显示确认对话框
+    Dialog.confirm({
+      title: locale.confirmDelete || '确认删除',
+      content: locale.confirmDeleteMessage || '确定要删除此项及其所有子项吗？',
+      onOk: () => {
+        // 执行删除操作
+        const performDelete = targetKey => {
+          // 递归删除所有子节点
+          const deleteChildrenRecursively = key => {
+            Object.keys(args).forEach(argKey => {
+              if (argKey.startsWith(key + '@@')) {
+                delete args[argKey];
+              }
+            });
+          };
+          deleteChildrenRecursively(targetKey);
+
+          // 从args对象中删除该节点
+          delete args[targetKey];
+
+          // 找到父节点并从其children数组中删除该节点
+          const keyParts = targetKey.split('@@');
+          const parentKey = keyParts.slice(0, -1).join('@@');
+
+          if (parentKey && args[parentKey]) {
+            const parentNode = args[parentKey];
+            if (parentNode.children) {
+              parentNode.children = parentNode.children.filter(child => child.key !== targetKey);
+
+              // 检查父节点是否为object类型且删除后没有子节点了
+              if (
+                parentNode.type === 'object' &&
+                parentNode.children.length === 0 &&
+                parentKey !== 'args'
+              ) {
+                // 递归删除空的object父节点
+                performDelete(parentKey);
+                return;
+              }
+            }
+          }
+        };
+
+        // 开始删除操作
+        performDelete(nodeKey);
+
+        // 如果删除的节点或其父节点是当前选中的节点，重置当前节点
+        if (
+          currentNode.key === nodeKey ||
+          currentNode.key.startsWith(nodeKey + '@@') ||
+          nodeKey.startsWith(currentNode.key + '@@') ||
+          !args[currentNode.key]
+        ) {
+          setCurrentNode({
+            key: '',
+            label: '',
+            type: 'string',
+            description: '',
+          });
+        }
+
+        // 重新构建rawData
+        const rebuildRawData = () => {
+          const rootNode = args['args'];
+          if (rootNode) {
+            setRawData([rootNode]);
+            setData(JSON.parse(JSON.stringify([rootNode])));
+            setArgs(args);
+            saveParamToFiled();
+          }
+        };
+
+        rebuildRawData();
+      },
+    });
+  };
+
   const changeNodeInfo = () => {
     setData(JSON.parse(JSON.stringify(rawData)));
     saveParamToFiled();
@@ -469,13 +735,7 @@ const CreateTools = React.forwardRef((props, ref) => {
           footer={
             onlyEditRuntimeInfo ? (
               <p style={{ color: 'red' }}>{locale.editExistVersionMessage}</p>
-            ) : (
-              ''
-            )
-          }
-          visible
-          footer={
-            isPreview ? (
+            ) : isPreview ? (
               <Button type="primary" onClick={closeDialog}>
                 {locale.close}
               </Button>
@@ -483,6 +743,7 @@ const CreateTools = React.forwardRef((props, ref) => {
               true
             )
           }
+          visible
           footerActions={isPreview ? [] : ['ok', 'cancel']}
           onOk={createItems}
           okProps={{ loading: okLoading }}
@@ -543,22 +804,36 @@ const CreateTools = React.forwardRef((props, ref) => {
             {/* 入参描述 */}
             <Form.Item label={locale.toolInputSchema} required style={{ margin: '16px 0 0' }} />
             <Form.Item label={locale.ArgumentTree} style={{ margin: '16px 0 0' }}>
-              {!isPreview && !onlyEditRuntimeInfo && (
-                <Row>
-                  <Col style={{ marginTop: 5 }}>
-                    <Button
-                      type="primary"
-                      size={'small'}
-                      onClick={AddPropertiesToArgs}
-                      disabled={currentNode.type !== 'object'}
-                    >
-                      {currentNode.key === 'args' ? locale.AddNewArg : locale.AddNewProperties}
-                    </Button>
-                    &nbsp;&nbsp;
-                    {currentNode.type !== 'object' ? locale.OnlyObjectSupportAddProperties : ''}
-                  </Col>
-                </Row>
-              )}
+              <Row>
+                <Col style={{ marginTop: 5 }}>
+                  <Button
+                    type="primary"
+                    size={'small'}
+                    onClick={AddPropertiesToArgs}
+                    disabled={isPreview || onlyEditRuntimeInfo}
+                  >
+                    {locale.AddNewArg || '增加参数'}
+                  </Button>
+                  &nbsp;&nbsp;
+                  {/* 为 object 类型节点添加属性按钮 */}
+                  {currentNode.type === 'object' && currentNode.key !== 'args' && (
+                    <>
+                      <Button
+                        type="primary"
+                        size="small"
+                        onClick={AddPropertiesToCurrentNode}
+                        disabled={isPreview || onlyEditRuntimeInfo}
+                      >
+                        {locale.AddNewProperties || '增加属性'}
+                      </Button>
+                      &nbsp;&nbsp;
+                    </>
+                  )}
+                  {isPreview || onlyEditRuntimeInfo
+                    ? locale.editExistVersionMessage || '只读模式不可编辑'
+                    : ''}
+                </Col>
+              </Row>
               <Row style={{ marginTop: 5 }}>
                 <Col>
                   <Tree
@@ -568,18 +843,51 @@ const CreateTools = React.forwardRef((props, ref) => {
                     isLabelBlock
                     dataSource={data}
                     defaultSelectedKeys={['args']}
+                    expandedKeys={expandedKeys}
+                    onExpand={keys => setExpandedKeys(keys)}
                     aria-label={'test'}
                     labelRender={node => {
                       return (
-                        <Row style={{ fontSize: 'medium' }}>
+                        <Row
+                          style={{ fontSize: 'medium', width: '100%' }}
+                          justify="space-between"
+                          align="middle"
+                        >
                           <Col>
-                            <a>{node.label}</a>&nbsp;&nbsp;({args[node.key].type})
-                          </Col>
-                          <Col style={{ textOverflow: 'ellipsis' }}>
-                            {args[node.key].description?.length <= 25
-                              ? args[node.key].description
-                              : `${args[node.key].description?.substring(0, 20)}...`}
+                            <Row>
+                              <Col>
+                                <a>{node.label}</a>&nbsp;&nbsp;({args[node.key].type})
+                              </Col>
+                              <Col style={{ textOverflow: 'ellipsis', marginLeft: 10 }}>
+                                {args[node.key].description?.length <= 25
+                                  ? args[node.key].description
+                                  : `${args[node.key].description?.substring(0, 20)}...`}
+                              </Col>
+                            </Row>
                           </Col>
+                          {/* 删除按钮 - 不能删除根节点args */}
+                          {node.key !== 'args' && !isPreview && !onlyEditRuntimeInfo && (
+                            <Col>
+                              <Button
+                                type="primary"
+                                warning
+                                size="small"
+                                onClick={e => {
+                                  e.stopPropagation(); // 阻止事件冒泡，避免触发节点选择
+                                  deleteNode(node.key);
+                                }}
+                                style={{
+                                  marginLeft: 10,
+                                  padding: '2px 8px',
+                                  fontSize: '12px',
+                                  height: '20px',
+                                  lineHeight: '16px',
+                                }}
+                              >
+                                ×
+                              </Button>
+                            </Col>
+                          )}
                         </Row>
                       );
                     }}
@@ -655,10 +963,35 @@ const CreateTools = React.forwardRef((props, ref) => {
                               currentNode.type = data;
                               currentNode.children = [itemNode];
                               args[`${currentNode.key}@@items`] = itemNode;
+
+                              // 确保当前节点展开，以显示新添加的items
+                              const updatedExpandedKeys = [...expandedKeys];
+                              if (!updatedExpandedKeys.includes(currentNode.key)) {
+                                updatedExpandedKeys.push(currentNode.key);
+                              }
+                              setExpandedKeys(updatedExpandedKeys);
+
                               changeNodeInfo(currentNode);
                             } else if (data === 'object') {
-                              currentNode.children = [];
+                              // 为 object 类型自动创建一个默认属性
+                              const defaultPropertyNode = {
+                                label: 'property1',
+                                type: 'string',
+                                description: '',
+                                key: `${currentNode.key}@@property1`,
+                                children: [],
+                              };
+                              currentNode.children = [defaultPropertyNode];
                               currentNode.type = data;
+                              args[`${currentNode.key}@@property1`] = defaultPropertyNode;
+
+                              // 确保当前节点展开，以显示新添加的属性
+                              const updatedExpandedKeys = [...expandedKeys];
+                              if (!updatedExpandedKeys.includes(currentNode.key)) {
+                                updatedExpandedKeys.push(currentNode.key);
+                              }
+                              setExpandedKeys(updatedExpandedKeys);
+
                               changeNodeInfo(currentNode);
                             } else {
                               currentNode.type = data;
@@ -699,17 +1032,150 @@ const CreateTools = React.forwardRef((props, ref) => {
                   extra={locale.httpToMcpDoc}
                   style={{ marginTop: '10px' }}
                 >
-                  <Input.TextArea
-                    isPreview={onlyEditRuntimeInfo}
-                    aria-label="auto height"
-                    style={{ minHeight: 32 }}
-                    multiline
-                    autoHeight={{ minRows: 5, maxRows: 8 }}
-                    {...field.init('templates', {
-                      rules: [{ validator: validateTemplateJsonFormat }],
+                  {onlyEditRuntimeInfo ? (
+                    <pre
+                      style={{
+                        backgroundColor: '#f6f7f9',
+                        border: '1px solid #dcdee3',
+                        borderRadius: '4px',
+                        padding: '8px 12px',
+                        fontSize: '12px',
+                        fontFamily: 'Monaco, Menlo, "Ubuntu Mono", monospace',
+                        lineHeight: '1.5',
+                        whiteSpace: 'pre-wrap',
+                        wordBreak: 'break-all',
+                        maxHeight: '300px',
+                        overflow: 'auto',
+                        margin: 0,
+                      }}
+                    >
+                      {(() => {
+                        try {
+                          const templateValue = generateTemplateWithSecurity();
+                          return templateValue
+                            ? JSON.stringify(JSON.parse(templateValue), null, 2)
+                            : templateValue;
+                        } catch (error) {
+                          return generateTemplateWithSecurity();
+                        }
+                      })()}
+                    </pre>
+                  ) : (
+                    <MonacoEditor
+                      language="json"
+                      height="200px"
+                      value={generateTemplateWithSecurity()}
+                      onChange={value => {
+                        // 当用户直接编辑时，更新原始模板和表单值
+                        setOriginalTemplate(value);
+                        field.setValue('templates', value);
+                      }}
+                      options={{
+                        minimap: { enabled: false },
+                        scrollBeyondLastLine: false,
+                        fontSize: 12,
+                        tabSize: 2,
+                        insertSpaces: true,
+                        wordWrap: 'on',
+                        lineNumbers: 'on',
+                        formatOnPaste: true,
+                        formatOnType: true,
+                      }}
+                    />
+                  )}
+                </Form.Item>
+
+                {/* 透明认证开关 */}
+                <Form.Item label={locale.transparentAuth || '启用透明认证'}>
+                  <Switch
+                    {...init('transparentAuth', {
+                      valueName: 'checked',
+                      initValue: false,
                     })}
+                    checkedChildren={locale.enable || '启用'}
+                    unCheckedChildren={locale.disable || '禁用'}
+                    isPreview={onlyEditRuntimeInfo}
                   />
                 </Form.Item>
+
+                {/* Security Schemes 选择器 */}
+                {field.getValue('transparentAuth') && (
+                  <Form.Item label={locale.securitySchemes || '认证方案'}>
+                    <Row gutter={16}>
+                      {/* 后端认证方式 */}
+                      <Col span={12}>
+                        <Form.Item
+                          label={locale.backendAuth || '后端认证方式'}
+                          style={{ marginBottom: 0 }}
+                        >
+                          <Select
+                            {...init('securitySchemeId', {
+                              rules: [
+                                {
+                                  required: true,
+                                  message: locale.pleaseSelectSecurityScheme || '请选择认证方案',
+                                },
+                              ],
+                            })}
+                            dataSource={
+                              props?.serverConfig?.toolSpec?.securitySchemes?.map(scheme => ({
+                                label: `${scheme.id} (${scheme.type})`,
+                                value: scheme.id,
+                              })) || []
+                            }
+                            placeholder={locale.pleaseSelectSecurityScheme || '请选择认证方案'}
+                            style={{ width: '100%' }}
+                            isPreview={onlyEditRuntimeInfo}
+                            onChange={value => {
+                              // 更新字段值
+                              field.setValue('securitySchemeId', value);
+                              // 当认证方案改变时，强制重新渲染
+                              setTimeout(() => {
+                                field.setValue('templates', generateTemplateWithSecurity());
+                              }, 0);
+                            }}
+                          />
+                        </Form.Item>
+                      </Col>
+
+                      {/* 客户端认证方式 */}
+                      <Col span={12}>
+                        <Form.Item
+                          label={locale.clientAuth || '客户端认证方式'}
+                          style={{ marginBottom: 0 }}
+                        >
+                          <Select
+                            {...init('clientSecuritySchemeId', {
+                              rules: [
+                                {
+                                  required: true,
+                                  message: locale.pleaseSelectSecurityScheme || '请选择认证方案',
+                                },
+                              ],
+                            })}
+                            dataSource={
+                              props?.serverConfig?.toolSpec?.securitySchemes?.map(scheme => ({
+                                label: `${scheme.id} (${scheme.type})`,
+                                value: scheme.id,
+                              })) || []
+                            }
+                            placeholder={locale.pleaseSelectSecurityScheme || '请选择认证方案'}
+                            style={{ width: '100%' }}
+                            isPreview={onlyEditRuntimeInfo}
+                            onChange={value => {
+                              // 更新字段值
+                              field.setValue('clientSecuritySchemeId', value);
+                              // 当认证方案改变时，强制重新渲染
+                              setTimeout(() => {
+                                field.setValue('templates', generateTemplateWithSecurity());
+                              }, 0);
+                            }}
+                          />
+                        </Form.Item>
+                      </Col>
+                    </Row>
+                  </Form.Item>
+                )}
               </>
             ) : null}
           </Form>
diff --git a/console-ui/src/pages/AI/McpDetail/McpDetail.js b/console-ui/src/pages/AI/McpDetail/McpDetail.js
index cab9b03f1ac..a88f4717a2d 100644
--- a/console-ui/src/pages/AI/McpDetail/McpDetail.js
+++ b/console-ui/src/pages/AI/McpDetail/McpDetail.js
@@ -189,7 +189,7 @@ class McpDetail extends React.Component {
               </h1>
             </Col>
             <Col span={4}>
-              <span>版本</span>
+              <span>{locale.version}</span>
               <Select
                 dataSource={versionSelections}
                 style={{
@@ -248,7 +248,7 @@ class McpDetail extends React.Component {
               this.getFormItem({
                 list: [
                   {
-                    label: '服务引用',
+                    label: locale.serviceRef,
                     value: (
                       <a
                         onClick={() => {
@@ -266,6 +266,88 @@ class McpDetail extends React.Component {
                 ],
               })}
           </div>
+
+          {/* Security Schemes 展示 - 只在非 stdio 协议且有数据时显示 */}
+          {this.state.serverConfig?.protocol !== 'stdio' &&
+            this.state.serverConfig?.toolSpec?.securitySchemes?.length > 0 && (
+              <>
+                <Divider></Divider>
+                <h2
+                  style={{
+                    color: '#333',
+                    fontWeight: 'bold',
+                  }}
+                >
+                  {locale.backendServiceAuth || '后端服务认证方式'}
+                </h2>
+                <div style={{ marginTop: '16px' }}>
+                  {this.state.serverConfig.toolSpec.securitySchemes.map((scheme, index) => (
+                    <div
+                      key={index}
+                      style={{
+                        border: '1px solid #e6e6e6',
+                        borderRadius: '4px',
+                        padding: '16px',
+                        marginBottom: '12px',
+                        backgroundColor: '#fafafa',
+                      }}
+                    >
+                      <Row wrap style={{ textAlign: 'left' }}>
+                        <Col span={12} style={{ display: 'flex', marginBottom: '8px' }}>
+                          <p style={{ minWidth: 120, fontWeight: 'bold' }}>
+                            {locale.authType || '认证类型'}:
+                          </p>
+                          <p>{scheme.type}</p>
+                        </Col>
+                        {scheme.scheme && (
+                          <Col span={12} style={{ display: 'flex', marginBottom: '8px' }}>
+                            <p style={{ minWidth: 120, fontWeight: 'bold' }}>
+                              {locale.authScheme || '认证方案'}:
+                            </p>
+                            <p>{scheme.scheme}</p>
+                          </Col>
+                        )}
+                        {scheme.in && (
+                          <Col span={12} style={{ display: 'flex', marginBottom: '8px' }}>
+                            <p style={{ minWidth: 120, fontWeight: 'bold' }}>
+                              {locale.keyLocation || '密钥位置'}:
+                            </p>
+                            <p>{scheme.in}</p>
+                          </Col>
+                        )}
+                        {scheme.name && (
+                          <Col span={12} style={{ display: 'flex', marginBottom: '8px' }}>
+                            <p style={{ minWidth: 120, fontWeight: 'bold' }}>
+                              {locale.keyName || '密钥名称'}:
+                            </p>
+                            <p>{scheme.name}</p>
+                          </Col>
+                        )}
+                        {scheme.defaultCredential && (
+                          <Col span={24} style={{ display: 'flex', marginBottom: '8px' }}>
+                            <p style={{ minWidth: 120, fontWeight: 'bold' }}>
+                              {locale.defaultCredential || '默认凭证'}:
+                            </p>
+                            <p
+                              style={{
+                                wordBreak: 'break-all',
+                                fontFamily: 'monospace',
+                                backgroundColor: '#f5f5f5',
+                                padding: '4px 8px',
+                                borderRadius: '3px',
+                              }}
+                            >
+                              {scheme.defaultCredential}
+                            </p>
+                          </Col>
+                        )}
+                      </Row>
+                    </div>
+                  ))}
+                </div>
+              </>
+            )}
+
           {this.state.serverConfig?.protocol === 'stdio' && (
             <>
               <Divider></Divider>
diff --git a/console-ui/src/pages/AI/McpDetail/ShowTools.js b/console-ui/src/pages/AI/McpDetail/ShowTools.js
index 4f820fdd3ba..424ed3f337f 100644
--- a/console-ui/src/pages/AI/McpDetail/ShowTools.js
+++ b/console-ui/src/pages/AI/McpDetail/ShowTools.js
@@ -267,7 +267,7 @@ const ShowTools = props => {
         key={JSON.stringify(serverConfig)}
         locale={locale}
         serverConfig={serverConfig}
-        showTemplates={restToMcpSwitch !== 'off'}
+        showTemplates={frontProtocol !== 'stdio' && restToMcpSwitch !== 'off'}
         ref={toolsRef}
         getServerDetail={getServerDetail}
         onChange={props?.onChange}
diff --git a/console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js b/console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js
index b6e804c0cdd..9d1589e6013 100644
--- a/console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js
+++ b/console-ui/src/pages/AI/NewMcpServer/NewMcpServer.js
@@ -18,13 +18,13 @@ import {
   Switch,
 } from '@alifd/next';
 import ShowTools from '../McpDetail/ShowTools';
+import MonacoEditor from '../../../components/MonacoEditor';
 import { McpServerManagementRoute } from '../../../layouts/menu';
 const { Row, Col } = Grid;
 
 const FormItem = Form.Item;
 const { Group: RadioGroup } = Radio;
-const localServerConfigDesc = `示例：
-{
+const localServerConfigDesc = `{
     "mcpServers":
     {
         "amap-mcp-server":
@@ -56,7 +56,13 @@ class NewMcpServer extends React.Component {
 
   constructor(props) {
     super(props);
-    this.field = new Field(this);
+    this.field = new Field(this, {
+      parseName: true,
+      values: {
+        securitySchemes: [],
+        localServerConfig: localServerConfigDesc,
+      },
+    });
     this.tenant = getParams('namespace') || '';
     this.state = {
       loading: false,
@@ -70,6 +76,7 @@ class NewMcpServer extends React.Component {
       isLatestVersion: false,
       versionsList: [],
       isInputError: false,
+      securitySchemeIdx: 0,
     };
   }
 
@@ -145,6 +152,21 @@ class NewMcpServer extends React.Component {
 
         this.field.setValues(initFileData);
 
+        // 初始化 securitySchemes 数据
+        const securitySchemes = result.data?.toolSpec?.securitySchemes || [];
+        const securitySchemesFormData = securitySchemes.map((scheme, index) => ({
+          // 如果后端数据中有 id 则使用，否则生成一个用于表单管理
+          id: scheme.id || `securityScheme_${index + 1}`,
+          ...scheme,
+        }));
+        this.setState({
+          securitySchemeIdx: securitySchemes.length,
+        });
+        this.field.setValues({
+          ...this.field.getValues(),
+          securitySchemes: securitySchemesFormData,
+        });
+
         let restToMcpBackendProtocol = 'off';
         if (protocol === 'https' || protocol === 'http') {
           restToMcpBackendProtocol = protocol;
@@ -194,6 +216,21 @@ class NewMcpServer extends React.Component {
           protocol = values.frontProtocol;
         }
         const mcpServerId = getParams('id') || '';
+
+        // 处理 securitySchemes 数据
+        const formSecuritySchemes = values?.securitySchemes || [];
+        const securitySchemes = formSecuritySchemes.map(scheme => {
+          // 保留所有字段，包括 id
+          return {
+            id: scheme.id,
+            type: scheme.type,
+            scheme: scheme.scheme,
+            in: scheme.in,
+            name: scheme.name,
+            defaultCredential: scheme.defaultCredential,
+          };
+        });
+
         const params = {
           id: mcpServerId,
           serverSpecification: JSON.stringify(
@@ -214,7 +251,12 @@ class NewMcpServer extends React.Component {
             null,
             2
           ),
-          toolSpecification: JSON.stringify(this.state?.serverConfig?.toolSpec || {}),
+          toolSpecification: JSON.stringify(
+            {
+              ...this.state?.serverConfig?.toolSpec,
+              securitySchemes: securitySchemes,
+            } || {}
+          ),
         };
 
         if (values?.frontProtocol !== 'stdio') {
@@ -266,11 +308,13 @@ class NewMcpServer extends React.Component {
 
   publishConfig = async isPublish => {
     if (this.state.isInputError) {
+      console.log('input error');
       return;
     }
 
     const params = await this.handleData();
     if (params.errors) {
+      console.log('handleData errors', params.errors);
       return;
     }
 
@@ -401,9 +445,61 @@ class NewMcpServer extends React.Component {
     }
   };
 
+  // 添加新的安全认证方案
+  addNewSecurityScheme = () => {
+    const { securitySchemeIdx } = this.state;
+    const newIdx = securitySchemeIdx + 1;
+    this.setState({
+      securitySchemeIdx: newIdx,
+    });
+    this.field.addArrayValue('securitySchemes', newIdx, {
+      id: `securityScheme_${newIdx}`,
+      type: 'http',
+      scheme: '',
+      in: '',
+      name: '',
+      defaultCredential: '',
+    });
+    // 更新 serverConfig 以便 CreateTools 能够实时获取到最新的 securitySchemes
+    setTimeout(() => {
+      this.toolsChange();
+    }, 100);
+  };
+
+  // 删除安全认证方案
+  deleteSecurityScheme = index => {
+    this.field.deleteArrayValue('securitySchemes', index);
+    // 更新 serverConfig 以便 CreateTools 能够实时获取到最新的 securitySchemes
+    setTimeout(() => {
+      this.toolsChange();
+    }, 100);
+  };
+
+  // 处理 securitySchemes 字段变化
+  handleSecuritySchemeChange = () => {
+    // 延迟执行，确保表单字段已经更新
+    setTimeout(() => {
+      this.toolsChange();
+    }, 100);
+  };
+
   toolsChange = async (_toolSpec = {}, cb = () => {}) => {
     const { locale = {} } = this.props;
 
+    // 获取当前表单中的 securitySchemes 数据
+    const formSecuritySchemes = this.field.getValue('securitySchemes') || [];
+    const securitySchemes = formSecuritySchemes.map(scheme => {
+      // 保留所有字段，包括 id
+      return {
+        id: scheme.id,
+        type: scheme.type,
+        scheme: scheme.scheme,
+        in: scheme.in,
+        name: scheme.name,
+        defaultCredential: scheme.defaultCredential,
+      };
+    });
+
     await new Promise(resolve => {
       this.setState(
         {
@@ -413,6 +509,7 @@ class NewMcpServer extends React.Component {
               ...this.state?.serverConfig?.toolSpec,
               tools: _toolSpec?.tools || [],
               toolsMeta: _toolSpec?.toolsMeta || {},
+              securitySchemes: securitySchemes,
             },
           },
         },
@@ -717,45 +814,246 @@ class NewMcpServer extends React.Component {
                   />
                 </FormItem>
               )}
+
+              {/* Security Schemes 配置 - 只在 restToMcpSwitch 不为 off 时显示 */}
+              {this.state.restToMcpSwitch !== 'off' && (
+                <FormItem label={locale.securitySchemes || '安全认证方案'}>
+                  <Button
+                    type="primary"
+                    size="small"
+                    onClick={this.addNewSecurityScheme}
+                    style={{ marginBottom: 10 }}
+                  >
+                    {locale.addSecurityScheme || '添加认证方案'}
+                  </Button>
+
+                  {this.field.getValue('securitySchemes') &&
+                    this.field.getValue('securitySchemes').map((item, index) => (
+                      <div
+                        key={index}
+                        style={{
+                          border: '1px solid #ddd',
+                          padding: '15px',
+                          marginBottom: '10px',
+                          borderRadius: '4px',
+                        }}
+                      >
+                        <Row gutter={8}>
+                          <Col span={6}>
+                            <FormItem label={locale.schemeId || 'ID'} required>
+                              <Input
+                                {...init(`securitySchemes.${index}.id`, {
+                                  rules: [{ required: true, message: locale.pleaseEnter }],
+                                  props: {
+                                    onChange: this.handleSecuritySchemeChange,
+                                  },
+                                })}
+                                placeholder="unique-id"
+                              />
+                            </FormItem>
+                          </Col>
+                          <Col span={6}>
+                            <FormItem label={locale.schemeType || '认证类型'} required>
+                              <Select
+                                {...init(`securitySchemes.${index}.type`, {
+                                  initValue: 'http',
+                                  rules: [{ required: true, message: locale.pleaseSelect }],
+                                  props: {
+                                    onChange: this.handleSecuritySchemeChange,
+                                  },
+                                })}
+                                dataSource={[
+                                  { label: 'HTTP (Basic/Bearer)', value: 'http' },
+                                  { label: 'API Key', value: 'apiKey' },
+                                ]}
+                              />
+                            </FormItem>
+                          </Col>
+                          <Col span={6}>
+                            {this.field.getValue(`securitySchemes.${index}.type`) === 'http' ? (
+                              <FormItem label={locale.scheme || 'Scheme'}>
+                                <Select
+                                  {...init(`securitySchemes.${index}.scheme`, {
+                                    props: {
+                                      onChange: this.handleSecuritySchemeChange,
+                                    },
+                                  })}
+                                  dataSource={[
+                                    { label: 'Basic', value: 'basic' },
+                                    { label: 'Bearer', value: 'bearer' },
+                                  ]}
+                                  placeholder={locale.selectScheme || '选择认证方案'}
+                                />
+                              </FormItem>
+                            ) : (
+                              <FormItem label={locale.keyLocation || '密钥位置'}>
+                                <Select
+                                  {...init(`securitySchemes.${index}.in`, {
+                                    props: {
+                                      onChange: this.handleSecuritySchemeChange,
+                                    },
+                                  })}
+                                  dataSource={[
+                                    { label: 'Header', value: 'header' },
+                                    { label: 'Query', value: 'query' },
+                                  ]}
+                                  placeholder="选择位置"
+                                />
+                              </FormItem>
+                            )}
+                          </Col>
+                          <Col span={4}>
+                            <FormItem label=" ">
+                              <Button
+                                type="normal"
+                                warning
+                                size="small"
+                                onClick={() => this.deleteSecurityScheme(index)}
+                              >
+                                {locale.delete || '删除'}
+                              </Button>
+                            </FormItem>
+                          </Col>
+                        </Row>
+
+                        <Row gutter={8}>
+                          {this.field.getValue(`securitySchemes.${index}.type`) === 'apiKey' && (
+                            <Col span={12}>
+                              <FormItem label={locale.keyName || '密钥名称'}>
+                                <Input
+                                  {...init(`securitySchemes.${index}.name`, {
+                                    props: {
+                                      onChange: this.handleSecuritySchemeChange,
+                                    },
+                                  })}
+                                  placeholder="X-API-Key"
+                                />
+                              </FormItem>
+                            </Col>
+                          )}
+                          <Col span={12}>
+                            <FormItem label={locale.defaultCredential || '默认凭证'}>
+                              <Input
+                                {...init(`securitySchemes.${index}.defaultCredential`, {
+                                  props: {
+                                    onChange: this.handleSecuritySchemeChange,
+                                  },
+                                })}
+                                placeholder="默认凭证值"
+                              />
+                            </FormItem>
+                          </Col>
+                        </Row>
+                      </div>
+                    ))}
+                </FormItem>
+              )}
             </>
           ) : (
             // Local Server 配置
             <>
               <FormItem label={this.LocalServerConfigLabel()} required>
-                <Input.TextArea
-                  isPreview={currentVersionExist}
-                  {...init('localServerConfig', {
-                    props: textAreaProps,
-                    rules: [
-                      {
-                        required: true,
-                        message: locale.pleaseEnter,
-                      },
-                      {
-                        validator: (rule, value, callback) => {
-                          try {
-                            if (value?.length > 0) {
-                              const parsedValue = JSON.parse(value);
-                              if (parsedValue['description']) {
-                                this.field.setValue('description', parsedValue['description']);
+                {currentVersionExist ? (
+                  // 预览模式使用格式化的 pre 标签
+                  <pre
+                    style={{
+                      backgroundColor: '#f6f7f9',
+                      border: '1px solid #dcdee3',
+                      borderRadius: '4px',
+                      padding: '8px 12px',
+                      fontSize: '12px',
+                      fontFamily: 'Monaco, Menlo, "Ubuntu Mono", monospace',
+                      lineHeight: '1.5',
+                      whiteSpace: 'pre-wrap',
+                      wordBreak: 'break-all',
+                      maxHeight: '400px',
+                      overflow: 'auto',
+                      margin: 0,
+                    }}
+                  >
+                    {(() => {
+                      try {
+                        const configValue = this.field.getValue('localServerConfig');
+                        return configValue
+                          ? JSON.stringify(JSON.parse(configValue), null, 2)
+                          : configValue;
+                      } catch (error) {
+                        return this.field.getValue('localServerConfig');
+                      }
+                    })()}
+                  </pre>
+                ) : (
+                  // 编辑模式使用 Monaco Editor
+                  <MonacoEditor
+                    language="json"
+                    height="300px"
+                    value={this.field.getValue('localServerConfig') || localServerConfigDesc}
+                    onChange={value => {
+                      this.field.setValue('localServerConfig', value);
+                      // 执行验证逻辑
+                      try {
+                        if (value?.length > 0) {
+                          const parsedValue = JSON.parse(value);
+                          if (parsedValue['description']) {
+                            this.field.setValue('description', parsedValue['description']);
+                          }
+                        }
+                        this.setState({
+                          isInputError: false,
+                        });
+                      } catch (e) {
+                        this.setState({
+                          isInputError: true,
+                        });
+                      }
+                    }}
+                    options={{
+                      minimap: { enabled: false },
+                      scrollBeyondLastLine: false,
+                      fontSize: 12,
+                      tabSize: 2,
+                      insertSpaces: true,
+                      wordWrap: 'on',
+                      lineNumbers: 'on',
+                      formatOnPaste: true,
+                      formatOnType: true,
+                    }}
+                  />
+                )}
+                {/* 隐藏的表单字段，用于验证 */}
+                <div style={{ display: 'none' }}>
+                  <Input.TextArea
+                    {...init('localServerConfig', {
+                      rules: [
+                        {
+                          required: true,
+                          message: locale.pleaseEnter,
+                        },
+                        {
+                          validator: (rule, value, callback) => {
+                            try {
+                              if (value?.length > 0) {
+                                const parsedValue = JSON.parse(value);
+                                if (parsedValue['description']) {
+                                  this.field.setValue('description', parsedValue['description']);
+                                }
                               }
+                              callback();
+                              this.setState({
+                                isInputError: false,
+                              });
+                            } catch (e) {
+                              callback(locale.localServerConfigError);
+                              this.setState({
+                                isInputError: true,
+                              });
                             }
-                            callback();
-                            this.setState({
-                              isInputError: false,
-                            });
-                          } catch (e) {
-                            callback(locale.localServerConfigError);
-                            this.setState({
-                              isInputError: true,
-                            });
-                          }
+                          },
                         },
-                      },
-                    ],
-                  })}
-                  placeholder={localServerConfigDesc}
-                />
+                      ],
+                    })}
+                  />
+                </div>
               </FormItem>
             </>
           )}


Test patch:
diff --git a/api/src/test/java/com/alibaba/nacos/api/ai/model/mcp/registry/NacosMcpRegistryServerDetailTest.java b/api/src/test/java/com/alibaba/nacos/api/ai/model/mcp/registry/NacosMcpRegistryServerDetailTest.java
index 86bae7930f1..07fd3eb430f 100644
--- a/api/src/test/java/com/alibaba/nacos/api/ai/model/mcp/registry/NacosMcpRegistryServerDetailTest.java
+++ b/api/src/test/java/com/alibaba/nacos/api/ai/model/mcp/registry/NacosMcpRegistryServerDetailTest.java
@@ -66,7 +66,7 @@ void testSerialize() throws JsonProcessingException {
         assertTrue(json.contains("\"url\":\"127.0.0.1:8848/sse\""));
         assertTrue(json.contains("\"transport_type\":\"https\""));
         assertTrue(json.contains("\"nacosMcpEndpointSpec\":{\"data\":{}}"));
-        assertTrue(json.contains("\"mcpToolSpecification\":{\"tools\":[],\"toolsMeta\":{}}"));
+        assertTrue(json.contains("\"mcpToolSpecification\":{\"tools\":[],\"toolsMeta\":{},\"securitySchemes\":[]}"));
         assertTrue(json.contains("\"nacosNamespaceId\":\"public\""));
     }
     
@@ -95,4 +95,4 @@ void testDeserialize() throws JsonProcessingException {
         assertNotNull(mcpRegistryServerDetail.getMcpToolSpecification());
         assertEquals("public", mcpRegistryServerDetail.getNacosNamespaceId());
     }
-}
\ No newline at end of file
+}