Skip to main content
Glama

MCPJungle mcp gateway

by mcpjungle
Mozilla Public License 2.0
638
  • Apple
mcp_clients.go•1.44 kB
package api import ( "net/http" "github.com/gin-gonic/gin" "github.com/mcpjungle/mcpjungle/internal/model" ) func (s *Server) listMcpClientsHandler() gin.HandlerFunc { return func(c *gin.Context) { clients, err := s.mcpClientService.ListClients() if err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) return } c.JSON(http.StatusOK, clients) } } func (s *Server) createMcpClientHandler() gin.HandlerFunc { return func(c *gin.Context) { var req model.McpClient if err := c.ShouldBindJSON(&req); err != nil { c.JSON(http.StatusBadRequest, gin.H{"error": "invalid request body"}) return } if req.Name == "" { c.JSON(http.StatusBadRequest, gin.H{"error": "name is required"}) return } // TODO: if allow list in the request is null, convert it to an empty JSON array client, err := s.mcpClientService.CreateClient(req) if err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) return } c.JSON(http.StatusCreated, client) } } func (s *Server) deleteMcpClientHandler() gin.HandlerFunc { return func(c *gin.Context) { name := c.Param("name") if name == "" { c.JSON(http.StatusBadRequest, gin.H{"error": "name is required"}) return } if err := s.mcpClientService.DeleteClient(name); err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) return } c.Status(http.StatusNoContent) } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mcpjungle/MCPJungle'

If you have feedback or need assistance with the MCP directory API, please join our Discord server