feat: mcp server

This commit is contained in:
Jacky 2025-04-29 17:15:42 +08:00
parent c4a9d03bb3
commit e8ee931e16
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
51 changed files with 2749 additions and 1526 deletions

18
mcp/router.go Normal file
View file

@ -0,0 +1,18 @@
package mcp
import (
"github.com/0xJacky/Nginx-UI/internal/mcp"
"github.com/0xJacky/Nginx-UI/internal/middleware"
"github.com/gin-gonic/gin"
)
func InitRouter(r *gin.Engine) {
r.Any("/mcp", middleware.IPWhiteList(), middleware.AuthRequired(),
func(c *gin.Context) {
mcp.ServeHTTP(c)
})
r.Any("/mcp_message", middleware.IPWhiteList(),
func(c *gin.Context) {
mcp.ServeHTTP(c)
})
}