MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / Set

Method Set

mcp-server/server.go:59–71  ·  view source on GitHub ↗
(id string, ser *server.MCPServer)

Source from the content-addressed store, hash-verified

57}
58
59func (s *Server) Set(id string, ser *server.MCPServer) {
60 s.locker.Lock()
61 defer s.locker.Unlock()
62 tmp := &Handler{
63 MCPServer: ser,
64 handlers: make(map[string]http.Handler),
65 }
66 tmp.handlers["api-sse"] = server.NewSSEServer(ser, server.WithStaticBasePath(fmt.Sprintf("/api/v1/%s/%s", ServiceBasePath, id)))
67 tmp.handlers["openapi-sse"] = server.NewSSEServer(ser, server.WithStaticBasePath(fmt.Sprintf("/openapi/v1/%s/%s", ServiceBasePath, id)))
68 tmp.handlers["openapi-stream"] = server.NewStreamableHTTPServer(ser, server.WithEndpointPath(OpenServiceMCPPath))
69 s.servers[id] = tmp
70
71}
72
73func (s *Server) Del(id string) {
74 s.locker.Lock()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected