| 159 | } |
| 160 | |
| 161 | func (i *imlMcpController) GlobalMCPHandle(ctx *gin.Context) { |
| 162 | cfg := i.settingModule.Get(ctx) |
| 163 | req := ctx.Request.WithContext(utils.SetGatewayInvoke(ctx.Request.Context(), cfg.InvokeAddress)) |
| 164 | locale := utils.I18n(ctx) |
| 165 | if v, ok := i.sseServers[locale]; ok { |
| 166 | v.ServeHTTP(ctx.Writer, req) |
| 167 | return |
| 168 | } |
| 169 | i.sseServers[languageEnUs].ServeHTTP(ctx.Writer, req) |
| 170 | } |
| 171 | |
| 172 | func (i *imlMcpController) GlobalHandleSSE(ctx *gin.Context) { |
| 173 | apikey := ctx.Request.URL.Query().Get("apikey") |