President Donald Trump's plans to reembrace fossil fuels as the foundation of American energy production and consumption has been a bright spot for the once-battered energy sector. His policy platform was the biggest driver behind the gains made by oil and gas stocks in January.

Kinder Morgan International (KMI) led the way, rising 7.87% on the month to $22.34. The largest oil pipeline company in North America -- for now -- Kinder Morgan presumably stands to gain if more major lines are built. Trump signed executive orders on Jan. 24 that revived the Keystone XL and Dakota Access Pipeline projects, which suggests he's amenable to such projects.

Kinder Morgan would probably have been happier if Keystone XL remained on the shelf: it's a direct competitor to its proposed Trans Mountain Expansion Project pipeline in Canada.

Oil and gas producer Concho Resources (CXO) was the second-biggest gainer. It jumped 5.16% in January to $139.44. Concho is heavily exposed to the Permian Basin of West Texas, which has become the hottest place to be for domestic oil and gas producers.

As oil prices slowly recover and drilling activity picks up, investors are largely betting on Halliburton (HAL) to do brisk business. Shares of the oilfield services company soared 4.58% to $56.57 in January.

The other two notable oil and gas gainers could chalk up their success to M&A activity.

Noble Energy (NBL) rose 4.47% to $39.76 in January. The oil producer is making a big push in the Permian and is set to snap up Clayton Williams Energy CWEI to expand its position there in a $2.7 billion cash-and-stock that was announced on Jan. 16.

Pipeline company Spectra Energy (SE) is in the process of merging with Enbridge (ENB) to form an energy infrastructure giant that will surpass even Kinder Morgan. Their $28 billion all-stock deal is expected to close at the end of February.

Spectra was a strong performer in January, but its sudden decline at the end of the month shows the risks of investing in an industry so sensitive to political considerations. Norman Bay, one of three commissioners of the Federal Energy Regulatory Commission (FERC), announced his resignation last Thursday after Trump appointed Cheryl LaFleur as acting chair of the commission.

Trump now needs to appoint a replacement after Bay departs Friday since the agency can't make decisions on approving pipeline construction projects with only two commissioners. The longer FERC languishes without a quorum; the more delays will mount for projects like Spectra's Nexus gas line in Michigan.

The day after Bay's resignation, Spectra's stock fell 3.1%, wiping out most of the progress it made in January. Spectra rose only 1.36% for January to $41.65.

KMI Chart KMI data by YCharts

More from Stocks

Finding Stocks Right for You: Cramer's 'Mad Money' Recap (Friday 8/25/18)

Finding Stocks Right for You: Cramer's 'Mad Money' Recap (Friday 8/25/18)

Flashback Friday: Amazon, Chip Stocks, Memorial Day

Flashback Friday: Amazon, Chip Stocks, Memorial Day

Week Ahead: Wall Street Looks to Jobs Report as North Korea Meeting Less Certain

Week Ahead: Wall Street Looks to Jobs Report as North Korea Meeting Less Certain

Dow and S&P 500 Decline, Energy Shares Fall as U.S. Crude Oil Slides 4%

Dow and S&P 500 Decline, Energy Shares Fall as U.S. Crude Oil Slides 4%

Replay: Jim Cramer on the Markets, 10-Year Yield, Oil Prices and Foot Locker

Replay: Jim Cramer on the Markets, 10-Year Yield, Oil Prices and Foot Locker