Skip to content

建立DB类型的MCP server时,无法录入mysql密码带@字符的实例 #628

@DamosChen

Description

@DamosChen
  • I have searched the issues of this repository and believe that this is not a duplicate.

Ⅰ. Issue Description

2.1.8版本,使用AI网关管理>MCP管理。建立DB类型的MCP server时,无法录入密码带@字符的实例

Ⅱ. Describe what happened

录入DB类型的mcp,且密码带@符号时,会引发mcp.form.databaseConfigInvalid的前端异常,提示“数据库配置格式不正确”。通过代码查看,与以下正则验证相关

If there is an exception, please attach the exception trace:
frontend/src/pages/mcp/constant.ts

  MYSQL: /^(\w+):([^@]+)@tcp\(([^:]+):(\d+)\)\/([^?]+)\?(.+)$/,

Ⅲ. Describe what you expected to happen

在确保dsn格式正确的情况下,兼容含特殊字符的mysql密码

Ⅳ. How to reproduce it (as minimally and precisely as possible)

  1. 建立服务来源,填入mysql地址
  2. 在AI网关管理>MCP管理中,创建类型为db的mcp server
  3. 填入带@符号的mysql密码

Ⅴ. Anything else we need to know?

Ⅵ. Environment:

  • Higress version: 2.1.8
  • OS :
  • Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions