Extend FMP MCP with additional financial statements, peer comparison, and representative tests#2
Open
ZhijingEu wants to merge 12 commits into
Open
Extend FMP MCP with additional financial statements, peer comparison, and representative tests#2ZhijingEu wants to merge 12 commits into
ZhijingEu wants to merge 12 commits into
Conversation
Note on changes to this fork
Add DCF valuation tools (discounted-cash-flow, levered, custom with scenario overrides) and the corresponding tests and docs
…ix dividends field get_balance_sheet: adds totalDebt and capitalLeaseObligations to formatted output. Previously only longTermDebt was included, causing downstream pipelines to understate invested capital and ROIC for tickers with significant lease liabilities (confirmed: BAH finding #008, CACI #011). get_cash_flow_statement: replaces hardcoded 'dividendsPaid' field with a fallback chain (commonDividendsPaid -> netDividendsPaid -> dividendsPaid) matching the actual FMP API response field name. Also adds preferredDividendsPaid, incomeTaxesPaid, and interestPaid to the formatted output. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Activities typo
get_cash_flow_statement was using 'commonStockIssued' (wrong FMP field name)
and 'otherFinancingActivites' (typo, missing 'i'). Both caused N/A to be
returned for all tickers even when FMP REST response contains non-zero values
(confirmed: BAH $6-28M/yr equity issuance; KBR $130-280M/yr other financing).
Fix: 'commonStockIssued' -> 'commonStockIssuance'
'otherFinancingActivites' -> 'otherFinancingActivities'
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ipoDate from FMP is the stock market listing date, not the company founding date (e.g. PSN: founded ~1984, IPO 2008 -- different dates). Mislabeling caused downstream confusion when VIPER reads the field to compute pre_ipo_periods for post-IPO analytical scoping. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ACC values FMP custom DCF endpoints return rates as already-percentage values (e.g. 14.9 = 14.9%), not decimals. The old _pct() multiplied by 100 unconditionally, producing 1490% for NVDA WACC=14.9. Fix: guard on value <= 1.0 -- multiply by 100 only for decimal-form values; display as-is for already-percentage values. Handles both forms safely without breaking existing behaviour for decimal inputs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ocs URL Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
helloooo maintainer??? anyone here? |
Author
|
@yairEO FMP now publishes an official hosted MCP server that wraps their full REST API (~250 tools) https://site.financialmodelingprep.com/developer/docs/mcp-server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR extends the Financial Modeling Prep (FMP) MCP server with additional financial statement coverage as the original statements.py file only covered the extraction of income_sheet data but not cashflow statements or balance sheet, peer comparison functionality, and representative unit tests.
Key Changes
New & Extended Tools
MCP Server Updates
src/server.pyserver.pyentrypoint to resolve import/path issues when running under Claude Desktop (STDIO MCP execution)Tests
test_statements.pyusing a representative-test strategy:test_peers.pyfor stock peer comparison toolNotes
annual, quarterly, and TTM endpoints