On the 6th of May, 2023, Microsoft’s Price-to-Earnings ratio was reported as 28.93 by Stockopedia, 32.05 by Morningstar, 32.66 by Macrotrends, 33.67 by the Wall Street Journal, and 34.4 by Companies Market Cap. Every one of those numbers is “correct.” They just use different definitions of earnings, different share counts and different rounding. None of the providers publish the formula, so there is no way to know which one matches the calculation you actually want. Ask an AI assistant for the same number and it inherits the problem: it picks one of those figures from a web search, or recalls one from its training data, and when it finds nothing it may produce a plausible-looking number of its own.

That inconsistency is why I built the Finance Toolkit, an open-source Python library where every ratio, indicator and model is plain, readable code you can audit. The Finance Toolkit MCP server puts the same 500+ methods behind the Model Context Protocol, so Claude, ChatGPT, Copilot, Cursor and other assistants calculate the number instead of recalling it. It is hosted at one URL, so there is nothing to install. This article shows how to connect it and works through four questions, from semiconductor valuations to Asia’s investment cycle, with every tool call and result.

The source code for every calculation is on GitHub. Installation steps for every client are on the Finance Toolkit MCP server page.

1 URLhosted server, nothing to install
500+financial methods behind 22 tools, plus 3 search tools
4worked questions below, with every tool call
Freeopen source, MIT-licensed

Connecting the Server

The hosted server lives at this URL:

https://financetoolkit.jeroenbouma.com/mcp

Company data comes from Financial Modeling Prep (FMP), so the server needs an FMP API key. You don’t paste it into a config file: the first time your assistant calls the server, it opens an OAuth page that asks for the key, and you enter it once. The free plan covers five years of history and 250 requests a day; a paid plan adds the full 30+ years and quarterly data, at a 15% discount through that (affiliate) link. Macroeconomic data needs no key.

In Claude Desktop or claude.ai the steps are the same:

  1. Click Customize in the left sidebar and open the Connectors tab.
  2. Click + and select Add custom connector.
  3. Name it Finance Toolkit, paste the URL above and click Add.
  4. Ask a financial question in a new chat. On the first tool call a browser window asks for your FMP key.

Every other client has its own installation card on the MCP server page:

If you would rather run the server on your own machine, the local route uses the same code. One command finds the configuration file of Claude Desktop, Claude Code, VS Code, Cursor, Windsurf or Gemini and writes the entry, including your key:

uvx --from "financetoolkit[mcp]" financetoolkit-mcp-setup

For Claude Desktop there is also a one-click MCPB bundle on the latest GitHub release. The local installation cards cover each client by hand.

One Engine, Two Front Doors

The Python library and the MCP server run the same calculations. The server groups the 500+ methods into 22 categorical tools, such as profitability, valuation, models, performance, risk, momentum and macroeconomics. Each takes an indicator that selects the exact metric, for example valuation with indicator='get_price_to_earnings_ratio'. Three search tools (search_metric_categories, search_by_category and search_metrics) help the assistant find the right one. You never name a tool yourself: you ask in plain English, and the assistant picks the tool, the indicator and the period.

Every tool call maps to one line of Python, so you can reproduce any answer below. Install the library with pip install financetoolkit -U, then:

from financetoolkit import Toolkit

companies = Toolkit(
    tickers=["MSFT", "AAPL"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2020-01-01",
)

pe = companies.ratios.get_price_to_earnings_ratio()

The server returns the same numbers to every model. A larger model mostly adds depth: more follow-up calculations and better caveats. Smaller models pick the right tools and report the same figures. You can also use your own data instead in the Python library.

What You Can Ask

Below are four questions an analyst or portfolio manager might ask, each answered through the hosted server. Every step lists the tool and indicator that were called, and every chart shows what those calls returned: prices up to October 13, 2026, financial statements up to fiscal 2025 and macroeconomic data up to 2025, retrieved on October 14, 2026. The “What the data shows” box is my reading of those numbers. Below each answer is the same calculation in Python.

Which chipmakers are priced for their growth?

Semiconductors are a good test for equity ratios, because growth rates differ wildly between companies that are nominally in the same business. EV/EBITDA compares the value of the whole company, debt included, with its operating cash earnings, which makes it less sensitive to leverage and one-off charges than the P/E.

Compare NVDA, AMD, AVGO, TSM, ASML, AMAT, QCOM, TXN and INTC. How did the shares do since 2015, how fast did earnings grow last year, how profitable are they, and what does the market pay for them?

9 companies5 tool calls11 years of prices
The steps behind the answer
  1. performanceget_returns: yearly and cumulative, rebased to 1 at the end of 2015, with SPY for the S&P 500
  2. valuationget_price_to_earnings_ratio, fiscal 2021 to 2025
  3. valuationget_ev_to_ebitda_ratio, fiscal 2021 to 2025
  4. valuationget_earnings_per_share with growth=true, fiscal 2021 to 2025
  5. profitabilityget_operating_margin, fiscal 2021 to 2025

What the data shows

The dispersion inside one industry is extreme. A dollar in Nvidia at the end of 2015 grew to $286, in AMD to $211, while Intel grew to $3.78, the only one of the nine behind the S&P 500 ($4.54). On fiscal 2025 numbers, Nvidia is not the expensive one: 34.2 times EBITDA and 38.0 times earnings, for 66.7% EPS growth and a 60.4% operating margin. AMD (52.1x) and Broadcom (50.2x) cost more, and their EPS growth of 164% and 286% is partly a rebound from depressed years (Broadcom's EPS fell 62.6% in 2024). TSMC pairs a 50.8% operating margin with 56.7% EPS growth at 17.9 times EBITDA, the second-lowest multiple in the group after Qualcomm, whose EPS fell 44.1%. Intel's P/E of −671 says only that it barely lost money: its EPS fell 98.75% on a −4.2% operating margin.

$286 vs $3.78$1 since 2015, Nvidia vs Intel34.2xNvidia EV/EBITDA, below AMD and Broadcom50.8%TSMC operating margin at 17.9x EBITDA

Fiscal years are aligned to the calendar year they mostly fall in, so Nvidia’s fiscal year to January 2026 shows as 2025, and ASML’s and TSMC’s statements are converted to US dollars to match their US listings. The server says both in the notes of its answer. In Python:

from financetoolkit import Toolkit

chips = Toolkit(
    tickers=["NVDA", "AMD", "AVGO", "TSM", "ASML", "AMAT", "QCOM", "TXN", "INTC"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2015-01-02",
)

growth_of_one_dollar = chips.performance.get_returns(period="yearly", cumulative=True)
pe = chips.ratios.get_price_to_earnings_ratio()
ev_ebitda = chips.ratios.get_ev_to_ebitda_ratio()
eps_growth = chips.ratios.get_earnings_per_share(growth=True)
operating_margin = chips.ratios.get_operating_margin()

How did Europe’s sectors move through the 2020 crash?

Technical indicators work off price data, so they apply to ETFs as well as stocks. The Relative Strength Index (RSI) compares the size of recent gains with recent losses on a scale of 0 to 100: below 30 is conventionally oversold, above 70 overbought. A market shock is the clearest test, so this question looks at seven iShares STOXX Europe 600 sector ETFs listed in Germany: EXV9.DE (Travel & Leisure), EXV1.DE (Banks), EXV4.DE (Health Care), EXI5.DE (Real Estate), EXV3.DE (Technology), EXH9.DE (Utilities) and EXH1.DE (Oil & Gas).

How did European sectors move through the 2020 crash and the recovery? Use the weekly RSI of the iShares STOXX Europe 600 sector ETFs, and add their drawdowns and annual returns for 2020 and 2021.

7 sector ETFs3 tool calls108 weeks of RSI
The steps behind the answer
  1. momentumget_relative_strength_index, weekly, September 2019 to December 2021
  2. riskget_maximum_drawdown over the daily series, 2020 to 2021
  3. performanceget_returns, yearly, 2020 and 2021

What the data shows

Every sector fell in the same weeks; the recovery split them in two. In the week to March 22, 2020, the RSI of Oil & Gas dropped to 15.4 and Travel & Leisure to 16.1, far below the oversold line of 30. Health Care bottomed at 29.9 a week earlier and was back above 50 by mid-April. Banks stayed below 50 until the week of November 9, 2020, when the first vaccine trial results came out, and Oil & Gas spent all but one week of that stretch below 50 too. They ended 2020 down 26.6% and 22.5% while Technology and Utilities gained about 12%. In 2021 the order reversed: Banks returned 39.4%, the best of the seven. Travel & Leisure, with the deepest drawdown (−55.3%), gained only 0.8% in 2021, and its RSI fell back to 27.3 in early December, after the Omicron variant appeared.

15.4Oil & Gas RSI, March 2020−55.3%Travel & Leisure maximum drawdown−26.6% → +39.4%Banks, 2020 to 2021

A single RSI reading would miss all of this; the regime change only shows up in the full series. The returns are in euros, the currency the ETFs trade in. In Python:

from financetoolkit import Toolkit

sector_etfs = ["EXV9.DE", "EXV1.DE", "EXV4.DE", "EXI5.DE", "EXV3.DE", "EXH9.DE", "EXH1.DE"]

rsi = Toolkit(
    tickers=sector_etfs,
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2019-09-02",
    end_date="2021-12-31",
).technicals.get_relative_strength_index(period="weekly")

crisis = Toolkit(
    tickers=sector_etfs,
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2020-01-02",
    end_date="2021-12-31",
)
drawdown = crisis.risk.get_maximum_drawdown(period="daily")
returns = crisis.performance.get_returns(period="yearly")

How much of a South American stock does the US factor model explain?

Beta and alpha treat the market as the only systematic risk. The Fama-French five-factor model adds four more: company size (SMB, small minus big), value versus growth (HML, high minus low book-to-market), profitability (RMW, robust minus weak) and investment (CMA, conservative minus aggressive). The R-squared says how much of a stock’s return that combination explains. The Toolkit regresses each calendar year of daily excess returns on the US factors from Kenneth French’s data library. US-listed South American stocks are a good test, since they mix commodity exporters, banks and an e-commerce company.

Run the Fama-French five-factor model on Petrobras, YPF, Vale, Southern Copper, Itaú, Bancolombia, MercadoLibre and Gerdau for every year since 2021. How much do the factors explain, and which exposures stand out?

8 stocks1 tool call48 regressions
The steps behind the answer
  1. performanceget_fama_and_french_model, yearly, multiple regression on all five factors, 2021 to October 2026

What the data shows

For most of these stocks, the US factors explain little. In 2025 the R-squared ranged from 0.16 for Itaú to 0.41 for Southern Copper, so more than half of every stock's daily return variance came from something else: currencies, local rates, commodity prices and politics. MercadoLibre was the exception early on, at 0.69 in 2022, when it traded like a US growth stock, before dropping to 0.12 in 2024. Its profitability (RMW) loading was negative in every year from 2021 to 2025 (−1.11 in 2025): its returns moved like those of less profitable, growth-style companies. Petrobras carried a value (HML) tilt in every year, between 0.13 and 1.14. In 2026 so far, the two oil companies decoupled from the US market: market loadings of −0.30 for Petrobras and −0.11 for YPF, with an R-squared of 0.06 and 0.11, while Southern Copper's rose to 2.15.

0.16 to 0.41R-squared range in 20250.69 → 0.12MercadoLibre, 2022 to 2024−0.30Petrobras market loading, 2026

None of that shows up in a beta on its own, which is the case for running the full model. The 2026 regressions cover the year so far, as far as the French data library has been updated. In Python:

from financetoolkit import Toolkit

south_america = Toolkit(
    tickers=["PBR", "YPF", "VALE", "SCCO", "ITUB", "CIB", "MELI", "GGB"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
)

fama_french = south_america.performance.get_fama_and_french_model(period="yearly")

Is Asia’s investment boom fading?

Macroeconomic data comes from the Global Macro Database and the OECD, covers 60+ countries and goes back over a century. Investment as a share of GDP is one of the clearest measures of how an economy is building: a high ratio funds factories, housing and infrastructure, and a falling one usually means an economy is maturing or slowing its build-out.

Compare investment as a share of GDP in India, Vietnam, Indonesia, China, South Korea and Bangladesh since 2000. How fast are they growing now, and how much of that is inflation?

6 economies3 tool calls26 years of data
The steps behind the answer
  1. macroeconomicsget_investment_to_gdp_ratio, 2000 to 2025
  2. macroeconomicsget_gross_domestic_product with growth=true, 2015 to 2025
  3. macroeconomicsget_inflation_rate, 2025

What the data shows

China still invests the largest share, but less than it did: 39.1% of GDP in 2025, down from a peak of 46.3% in 2011 and the lowest since 2002. India peaked earlier, at 41.1% in 2010, fell to 29.0% in 2020 and recovered to 34.4%; Indonesia (34.9%) now invests a slightly larger share. South Korea's 29.2% is its lowest in the 26 years of data. Growth needs inflation next to it: Bangladesh grew 10.2% in nominal terms in 2025, but with 10.0% inflation, while India grew 8.8% with 2.1% inflation. Vietnam combined the fastest nominal growth (11.6%) with 3.3% inflation. China's nominal growth of 4.0% came with flat consumer prices (−0.1%).

46.3% → 39.1%China's investment share, 2011 to 202510.2% vs 10.0%Bangladesh nominal growth vs inflation11.6%Vietnam nominal growth, 2025

Consumer price inflation is not the GDP deflator, so nominal growth minus inflation is only a rough guide to real growth. In Python, the macro data needs no Toolkit instance and no API key:

from financetoolkit import Economics

economics = Economics(start_date="2000-01-01")

investment_share = economics.get_investment_to_gdp_ratio()
nominal_gdp_growth = economics.get_gross_domestic_product(growth=True)
inflation = economics.get_inflation_rate()

What This Means for Analysts

Each of the four answers combines several calculations, and each would be hard to get right from a model’s memory: a P/E for the right fiscal year, a weekly RSI through a crash, 48 factor regressions, and a ratio from a macro database. With the server, the assistant decides what to calculate and explains the result, but the numbers come from documented code. If you doubt a figure, the documentation gives the formula, and the Python lines above reproduce it.

The limits are the usual ones. The data is only as good as the filings and the provider, and fiscal years, currencies and share classes need the care the server’s notes point out. The 2015 start of the chip comparison needs a paid FMP plan, since the free plan covers five years. RSI readings, factor loadings and investment ratios describe what happened; they don’t forecast it. None of this is investment advice.

The MCP server page has four more worked conversations, and How to Connect Claude to Live Financial Data has ten shorter questions to try. Problems or ideas for a new tool are welcome as an issue on GitHub.

Try this with the Finance Toolkit MCP: “Compare the operating margin, return on invested capital and EV/EBITDA of ASML, Applied Materials, Lam Research and KLA over the last five years. Which one does the market pay the most for per unit of return on capital?”

Tags: MCP Server

Updated:

Share