feat(mcp): integrate MCP Server into backend service as built-in endpoint
Build and Deploy / build-and-push (push) Successful in 54s
Build and Deploy / build-and-push (push) Successful in 54s
- Add MCP Controller and register /mcp route - MCP Server now uses OpenAPI Token for authentication - Update frontend settings to show built-in MCP endpoint config - Update docs to reflect integrated MCP endpoint
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/engigu/taskpool/internal/mcp"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type MCPController struct{}
|
||||
|
||||
func NewMCPController() *MCPController {
|
||||
return &MCPController{}
|
||||
}
|
||||
|
||||
// HandleMCP 处理 MCP 请求(StreamableHTTP)
|
||||
func (c *MCPController) HandleMCP(ctx *gin.Context) {
|
||||
// 获取 MCP HTTP Handler 并处理请求
|
||||
handler := mcp.GetHTTPHandler()
|
||||
handler.ServeHTTP(ctx.Writer, ctx.Request)
|
||||
}
|
||||
Reference in New Issue
Block a user