Files
TaskPool/internal/controllers/mcp_controller.go
T
admin 066383de83
Build and Deploy / build-and-push (push) Successful in 54s
feat(mcp): integrate MCP Server into backend service as built-in endpoint
- 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
2026-07-27 02:38:09 +08:00

20 lines
430 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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)
}