066383de83
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
20 lines
430 B
Go
20 lines
430 B
Go
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)
|
||
}
|