-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Description
Is your feature request related to a problem? Please describe.
目前 Registry API 会将所有的 MCP Server 都暴露出去, 但是 Registry API 对外并没有鉴权,任何人都可以获取到 MCP Server 的数据。因此需要在 Nacos 中存储的 MCP Server 到 Registry API 暴露的 API 有一个管控面控制有哪些 MCP Server 能够暴露到 Registry API。
Local Server 在创建的时候即带上的了使用配置,可以直接暴露,无需额外的配置。而对于Remote Server,用户选择暴露 MCP 服务到 Registry 中时需要填写 Remote server 对外暴露的 Endpoint,对于标准的 MCP Server,默认就是后端服务对应的实例地址,对于 Higress 转化的 MCP 服务来说就是 Higress 对外暴露的域名和 path
因此需要在当前的数据结构中增加字段存储对外暴露的具体的endpoint的信息,这些信息包含
Describe the solution you'd like
| 项目名称 | 类型 | 值枚举 | 说明 |
|---|---|---|---|
| type | string | sse/streamable | endpoint对应的协议类型 |
| protocol | string | http/https | 传输协议类型 |
| endpointType | string | direct/refToBackend | endpoint的地址信息,可以是固定的域名信息,也可以是 Nacos 中的服务引用 |
| endpointData | object | endpoint数据 | 如果是DIRECT类型,则填写对应的 域名+ 端口号,如果是REF 类型则表示引用后端的地址,无需其他信息 |
| path | string | -- | 对外暴露的 http path, 例如 /sse |
这些信息是remoteServer独有的信息,因此添加在 remoteServerConfig中,使用frontEndpointsConfig存储
例如以下实例定义了一个固定域名的 endpoint
{
"frontEndpointsConfig": [
"type": "sse",
"protocol": "https",
"endpointType": "DIRECT",
"endpointAddress": "example.com:8080",
"path": "/sse"
]
}Describe alternatives you've considered
具体的改动项:
-
增加 FrontEndpointConfig 类型
class FrontEndpointConfig {
private String type;
private String protocol;
private String endpointType;
private String endpointAddress;
private String path;
} -
修改 McpServerRemoteServiceConfig 类型增加 frontEndpointsConfig 属性
public class McpServerRemoteServiceConfig {private McpServiceRef serviceRef;
private String exportPath;
private List frontEndpointsConfig;
} -
在控制台创建和更新 MCP Server 的时候增加 frontEndpoint 的配置(页面中可选项,作为高级设置默认折叠)
Additional context
TODO List
- 增加 FrontEndpointConfig 类型
- 修改 McpServerRemoteServiceConfig 类型增加 frontEndpointsConfig 属性
-
在控制台创建和更新 MCP Server 的时候增加 frontEndpoint 的配置(页面中可选项,作为高级设置默认折叠)(由于frontEndpoint一般由gateway来写入, 暂时不做UI)