diff --git a/frontend/src/api/mcp-server.ts b/frontend/src/api/mcp-server.ts index 14f9f14..b098b67 100644 --- a/frontend/src/api/mcp-server.ts +++ b/frontend/src/api/mcp-server.ts @@ -9,3 +9,4 @@ export function deleteMcpServer(id: string): Promise { return reque export function toggleMcpServer(id: string, active: boolean): Promise { return request.put(`/mcp-server/${id}/toggle?active=${active}`).then(r => r.data) } export function testMcpServer(id: string): Promise { return request.post(`/mcp-server/${id}/test`, {}).then(r => r.data) } export function refreshMcpServers(): Promise { return request.post('/mcp-server/refresh', {}).then(r => r.data) } +export function listAvailableMcpTools(): Promise { return request.get('/mcp-server/tools').then(r => r.data) } diff --git a/frontend/src/api/role.ts b/frontend/src/api/role.ts index 5351cdb..d37b9e2 100644 --- a/frontend/src/api/role.ts +++ b/frontend/src/api/role.ts @@ -9,3 +9,6 @@ export function deleteRole(roleId: string): Promise { return reques export function updateRoleCategories(roleId: string, categoryIds: string[]): Promise { return request.put(`/role/${roleId}/categories`, { categoryIds }).then(r => r.data) } +export function updateRoleMcpTools(roleId: string, allowedMcpTools: string[]): Promise { + return request.put(`/role/${roleId}/mcp-tools`, { allowedMcpTools }).then(r => r.data) +} diff --git a/frontend/src/types/models.ts b/frontend/src/types/models.ts index 96a03da..e6dbaad 100644 --- a/frontend/src/types/models.ts +++ b/frontend/src/types/models.ts @@ -150,8 +150,10 @@ export interface SupportRole { id: string name: string description?: string + prompt?: string systemPrompt?: string categoryIds?: string[] + allowedMcpTools?: string[] enabled: boolean createTime?: string updateTime?: string diff --git a/frontend/src/views/RoleManager.vue b/frontend/src/views/RoleManager.vue index a14685e..a2dbeee 100644 --- a/frontend/src/views/RoleManager.vue +++ b/frontend/src/views/RoleManager.vue @@ -115,6 +115,40 @@ 暂无知识库分类,请先在知识库管理中创建分类 + + +
+ + 全部授权(允许调用所有已接入的 MCP 工具) + + + +
+
{{ s.serverName }}
+ + {{ t.rawName }} + — {{ t.description }} + +
+
+ + 暂无已接入的 MCP 工具,请先在「MCP 服务管理」中配置并启用 Server + +
+
+