1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| package routes
import ( "net/http"
"github.com/gorilla/mux"
"{{{ .Package }}}/app/controller/clib/cmcp" )
func mcpRoutes(base string, r *mux.Router) { if base == "" { base = "/mcp" } makeRoute(r, http.MethodGet, base, cmcp.MCPIndex) makeRoute(r, http.MethodDelete, base, cmcp.MCPServe) makeRoute(r, http.MethodPatch, base, cmcp.MCPServe) makeRoute(r, http.MethodPost, base, cmcp.MCPServe) makeRoute(r, http.MethodPut, base, cmcp.MCPServe)
makeRoute(r, http.MethodGet, base+"/resource/{resource}", cmcp.MCPResource) makeRoute(r, http.MethodGet, base+"/resourcetemplate/{rt}", cmcp.MCPResourceTemplate) makeRoute(r, http.MethodPost, base+"/resourcetemplate/{rt}", cmcp.MCPResourceTemplateRun) makeRoute(r, http.MethodGet, base+"/tool/{tool}", cmcp.MCPTool) makeRoute(r, http.MethodPost, base+"/tool/{tool}", cmcp.MCPToolRun) makeRoute(r, http.MethodGet, base+"/prompt/{prompt}", cmcp.MCPPrompt) }
|