Skip to main content
Glama

CentralMind/Gateway

cors.go785 B
package cors import "net/http" // ApplyCORSHeaders adds the standard CORS headers to a response // For handlers that are not wrapped in middleware func ApplyCORSHeaders(w http.ResponseWriter, allowedMethods string) { w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Access-Control-Allow-Methods", allowedMethods+", OPTIONS") w.Header().Set("Access-Control-Allow-Headers", "Content-Type, Authorization, mcp-protocol-version") } // HandlePreflight checks if the request is a preflight OPTIONS request and handles it // Returns true if the request was handled (caller should return immediately) func HandlePreflight(w http.ResponseWriter, r *http.Request) bool { if r.Method == http.MethodOptions { w.WriteHeader(http.StatusOK) return true } return false }

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/centralmind/gateway'

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