Class McpServerRestController
java.lang.Object
com.bytedesk.core.base.BaseRestController<McpServerRequest,McpServerRestService>
com.bytedesk.ai.springai.mcp_server.McpServerRestController
@RestController
@RequestMapping("/api/v1/mcp/server")
@Description("McpServer Management Controller - Content mcpServer management and categorization APIs")
public class McpServerRestController
extends BaseRestController<McpServerRequest,McpServerRestService>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final McpServerRestService
private final McpServerService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<?>
callTool
(ToolCallRequest request) org.springframework.http.ResponseEntity<?>
connectToServer
(String serverUid) org.springframework.http.ResponseEntity<?>
create
(McpServerRequest request) 通用的create实现 减少子类重复代码org.springframework.http.ResponseEntity<?>
delete
(McpServerRequest request) 通用的delete实现 减少子类重复代码export
(McpServerRequest request, jakarta.servlet.http.HttpServletResponse response) exportorg.springframework.http.ResponseEntity<?>
org.springframework.http.ResponseEntity<?>
getAvailablePrompts
(String serverUid) org.springframework.http.ResponseEntity<?>
getAvailableResources
(String serverUid) org.springframework.http.ResponseEntity<?>
getAvailableTools
(String serverUid) org.springframework.http.ResponseEntity<?>
org.springframework.http.ResponseEntity<?>
getServerStatus
(String serverUid) org.springframework.http.ResponseEntity<?>
healthCheck
(String serverUid) org.springframework.http.ResponseEntity<?>
queryByOrg
(McpServerRequest request) 通用的queryByOrg实现 减少子类重复代码org.springframework.http.ResponseEntity<?>
queryByUid
(McpServerRequest request) 通用的queryByUid实现 减少子类重复代码org.springframework.http.ResponseEntity<?>
queryByUser
(McpServerRequest request) 通用的queryByUser实现 减少子类重复代码org.springframework.http.ResponseEntity<?>
readResource
(String serverUid, String resourceUri) org.springframework.http.ResponseEntity<?>
update
(McpServerRequest request) 通用的update实现 减少子类重复代码Methods inherited from class com.bytedesk.core.base.BaseRestController
deleteByOrgUid, exportTemplate, getService
-
Field Details
-
mcpServerRestService
-
mcpServerService
-
-
Constructor Details
-
McpServerRestController
public McpServerRestController()
-
-
Method Details
-
queryByOrg
@ActionAnnotation(title="McpServer", action="\u7ec4\u7ec7\u67e5\u8be2", description="query mcpServer by org") public org.springframework.http.ResponseEntity<?> queryByOrg(McpServerRequest request) Description copied from class:BaseRestController
通用的queryByOrg实现 减少子类重复代码- Overrides:
queryByOrg
in classBaseRestController<McpServerRequest,
McpServerRestService>
-
queryByUser
@ActionAnnotation(title="McpServer", action="\u7528\u6237\u67e5\u8be2", description="query mcpServer by user") public org.springframework.http.ResponseEntity<?> queryByUser(McpServerRequest request) Description copied from class:BaseRestController
通用的queryByUser实现 减少子类重复代码- Overrides:
queryByUser
in classBaseRestController<McpServerRequest,
McpServerRestService>
-
queryByUid
@ActionAnnotation(title="McpServer", action="\u67e5\u8be2\u8be6\u60c5", description="query mcpServer by uid") public org.springframework.http.ResponseEntity<?> queryByUid(McpServerRequest request) Description copied from class:BaseRestController
通用的queryByUid实现 减少子类重复代码- Overrides:
queryByUid
in classBaseRestController<McpServerRequest,
McpServerRestService>
-
create
@ActionAnnotation(title="McpServer", action="\u65b0\u5efa", description="create mcpServer") public org.springframework.http.ResponseEntity<?> create(McpServerRequest request) Description copied from class:BaseRestController
通用的create实现 减少子类重复代码- Overrides:
create
in classBaseRestController<McpServerRequest,
McpServerRestService>
-
update
@ActionAnnotation(title="McpServer", action="\u66f4\u65b0", description="update mcpServer") public org.springframework.http.ResponseEntity<?> update(McpServerRequest request) Description copied from class:BaseRestController
通用的update实现 减少子类重复代码- Overrides:
update
in classBaseRestController<McpServerRequest,
McpServerRestService>
-
delete
@ActionAnnotation(title="McpServer", action="\u5220\u9664", description="delete mcpServer") public org.springframework.http.ResponseEntity<?> delete(McpServerRequest request) Description copied from class:BaseRestController
通用的delete实现 减少子类重复代码- Overrides:
delete
in classBaseRestController<McpServerRequest,
McpServerRestService>
-
export
@ActionAnnotation(title="McpServer", action="\u5bfc\u51fa", description="export mcpServer") @GetMapping("/export") public Object export(McpServerRequest request, jakarta.servlet.http.HttpServletResponse response) Description copied from class:BaseRestController
export- Overrides:
export
in classBaseRestController<McpServerRequest,
McpServerRestService> - Parameters:
request
- role- Returns:
- json
-
connectToServer
@ActionAnnotation(title="McpServer", action="\u8fde\u63a5\u670d\u52a1\u5668", description="connect to MCP server") @PostMapping("/connect/{serverUid}") public org.springframework.http.ResponseEntity<?> connectToServer(@PathVariable String serverUid) -
callTool
@ActionAnnotation(title="McpServer", action="\u8c03\u7528\u5de5\u5177", description="call MCP tool") @PostMapping("/call-tool") public org.springframework.http.ResponseEntity<?> callTool(@RequestBody ToolCallRequest request) -
getAvailableTools
@ActionAnnotation(title="McpServer", action="\u83b7\u53d6\u5de5\u5177\u5217\u8868", description="get available tools") @GetMapping("/tools/{serverUid}") public org.springframework.http.ResponseEntity<?> getAvailableTools(@PathVariable String serverUid) -
getAvailableResources
@ActionAnnotation(title="McpServer", action="\u83b7\u53d6\u8d44\u6e90\u5217\u8868", description="get available resources") @GetMapping("/resources/{serverUid}") public org.springframework.http.ResponseEntity<?> getAvailableResources(@PathVariable String serverUid) -
getAvailablePrompts
@ActionAnnotation(title="McpServer", action="\u83b7\u53d6\u63d0\u793a\u5217\u8868", description="get available prompts") @GetMapping("/prompts/{serverUid}") public org.springframework.http.ResponseEntity<?> getAvailablePrompts(@PathVariable String serverUid) -
readResource
@ActionAnnotation(title="McpServer", action="\u8bfb\u53d6\u8d44\u6e90", description="read resource content") @GetMapping("/resource/{serverUid}") public org.springframework.http.ResponseEntity<?> readResource(@PathVariable String serverUid, @RequestParam String resourceUri) -
getPrompt
@ActionAnnotation(title="McpServer", action="\u83b7\u53d6\u63d0\u793a\u5185\u5bb9", description="get prompt content") @PostMapping("/prompt/{serverUid}/{promptName}") public org.springframework.http.ResponseEntity<?> getPrompt(@PathVariable String serverUid, @PathVariable String promptName, @RequestBody(required=false) Map<String, Object> arguments) -
healthCheck
@ActionAnnotation(title="McpServer", action="\u5065\u5eb7\u68c0\u67e5", description="health check") @GetMapping("/health/{serverUid}") public org.springframework.http.ResponseEntity<?> healthCheck(@PathVariable String serverUid) -
getServerStatus
@ActionAnnotation(title="McpServer", action="\u83b7\u53d6\u670d\u52a1\u5668\u72b6\u6001", description="get server status") @GetMapping("/status/{serverUid}") public org.springframework.http.ResponseEntity<?> getServerStatus(@PathVariable String serverUid) -
getActiveServers
@ActionAnnotation(title="McpServer", action="\u83b7\u53d6\u6d3b\u8dc3\u670d\u52a1\u5668", description="get active servers") @GetMapping("/active") public org.springframework.http.ResponseEntity<?> getActiveServers()
-