MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / ServeHTTP

Method ServeHTTP

mcp-server/server.go:42–57  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

40}
41
42func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
43 r.URL.Path = strings.TrimSuffix(r.URL.Path, "/")
44 if strings.HasSuffix(r.URL.Path, "/mcp") {
45 h.handlers["openapi-stream"].ServeHTTP(w, r)
46 return
47 }
48 if strings.HasPrefix(r.URL.Path, "/api") {
49 h.handlers["api-sse"].ServeHTTP(w, r)
50 return
51 } else if strings.HasPrefix(r.URL.Path, "/openapi") {
52 h.handlers["openapi-sse"].ServeHTTP(w, r)
53 return
54 }
55 http.NotFound(w, r)
56 return
57}
58
59func (s *Server) Set(id string, ser *server.MCPServer) {
60 s.locker.Lock()

Callers

nothing calls this directly

Calls 1

ServeHTTPMethod · 0.45

Tested by

no test coverage detected