(rw http.ResponseWriter, r *http.Request)
| 1231 | } |
| 1232 | |
| 1233 | func parseMCPServerConfigID(rw http.ResponseWriter, r *http.Request) (uuid.UUID, bool) { |
| 1234 | mcpServerID, err := uuid.Parse(chi.URLParam(r, "mcpServer")) |
| 1235 | if err != nil { |
| 1236 | httpapi.Write(r.Context(), rw, http.StatusBadRequest, codersdk.Response{ |
| 1237 | Message: "Invalid MCP server config ID.", |
| 1238 | Detail: err.Error(), |
| 1239 | }) |
| 1240 | return uuid.Nil, false |
| 1241 | } |
| 1242 | return mcpServerID, true |
| 1243 | } |
| 1244 | |
| 1245 | // convertMCPServerConfig converts a database MCP server config to the |
| 1246 | // SDK type. Secrets are never returned; only has_* booleans are set. |
no test coverage detected