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

Function SetServer

mcp-server/server.go:135–149  ·  view source on GitHub ↗
(sid string, name string, version string, tools ...ITool)

Source from the content-addressed store, hash-verified

133}
134
135func SetServer(sid string, name string, version string, tools ...ITool) {
136 ser, has := mcpServer.Get(sid)
137 if !has {
138 mcpServer.Set(sid, server.NewMCPServer(name, version, server.WithToolCapabilities(true)))
139 ser, has = mcpServer.Get(sid)
140 if !has {
141 return
142 }
143 }
144 ts := make([]server.ServerTool, 0, len(tools))
145 for _, tool := range tools {
146 ts = append(ts, tool.Tool())
147 }
148 ser.SetTools(ts...)
149}
150
151func DelServer(sid string) {
152 mcpServer.Del(sid)

Callers 1

SetServerByOpenapiFunction · 0.85

Calls 3

GetMethod · 0.65
SetMethod · 0.65
ToolMethod · 0.65

Tested by

no test coverage detected