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

Method OnComplete

controller/mcp/iml.go:146–159  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144}
145
146func (i *imlMcpController) OnComplete() {
147 i.sseServers = make(map[string]http.Handler)
148 for language, tools := range mcpToolsByLanguage {
149 s := server.NewMCPServer("APIPark MCP Server", "1.0.0", server.WithLogging())
150 s.AddTool(tools[ToolServiceList], i.mcpModule.Services)
151 s.AddTool(tools[ToolOpenAPIDocument], i.mcpModule.APIs)
152 s.AddTool(tools[ToolInvokeAPI], i.mcpModule.Invoke)
153 i.sseServers[language] = server.NewSSEServer(s, server.WithStaticBasePath(fmt.Sprintf("/api/v1/%s", mcp_server.GlobalBasePath)))
154 if language == languageEnUs {
155 i.openSseServer = server.NewSSEServer(s, server.WithStaticBasePath(fmt.Sprintf("/openapi/v1/%s", strings.Trim(mcp_server.GlobalBasePath, "/"))))
156 i.openStreamableServer = server.NewStreamableHTTPServer(s, server.WithEndpointPath(mcp_server.OpenGlobalMCPPath))
157 }
158 }
159}
160
161func (i *imlMcpController) GlobalMCPHandle(ctx *gin.Context) {
162 cfg := i.settingModule.Get(ctx)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected