使用说明
sheets-finance-mcp
MCP server for the SheetsFinance formula catalog.
This package exposes three tools:
sf_search: search metrics/functions and get rankedmetric_idcandidates.sf_formula: build validated SheetsFinance formulas from ametric_idor explicit function/category/metric fields.sf_describe: inspect category/function metadata, metric lists, and examples.
What Is SheetsFinance?
SheetsFinance is a Google Sheets add-on for financial market/company data retrieval using spreadsheet formulas.
Installation
From this package directory:
pip install -e .
Run as a module:
python -m sheets_finance_mcp
Or via console script (installed by pyproject.toml):
sheets-finance-mcp
Claude Code MCP Config
{
"mcpServers": {
"sheetsfinance": {
"command": "python",
"args": ["-m", "sheets_finance_mcp"]
}
}
}
Tool Reference
| Tool | Purpose | Typical Next Step |
|---|---|---|
sf_search(query, limit=10) |
Find matching metrics/functions | Use returned metric_id with sf_formula |
sf_formula(...) |
Construct a formula string (single or multi-symbol) | Paste formula in Sheets |
sf_describe(target) |
Inspect category/function metrics and options | Pick a metric/function for sf_formula |
Example Workflow
-
Search for a metric:
sf_search(query="gross margin") -
Build a formula from the selected metric id:
sf_formula(symbol="AAPL", metric_id="SF.ratios.grossProfitMargin") -
Inspect a category/function when needed:
sf_describe(target="income")
For a non-SF function, symbol supplies the function signature's first
argument, while the selected metric_id supplies the cataloged selector
parameter. Pass all remaining named parameters through extra_args. For
example, SF_OPTIONS_PRO.calls selects dataType="calls", while
SF_BROKERAGE.holdings selects type="holdings"; in the latter case symbol
contains the brokerage account nickname rather than a market ticker.
