Research & screening

yfinance Agent Skill

Prototype an agent that can inspect price history, company metadata and corporate events.

Source
Open-source community
Access
Open source

What this adds to your agent

Download adjusted price history

Read selected company metadata

Inspect dividends and splits

Implementation statusGuide reviewed · 2026-07
Implementation status

Open source

Expected result

Download adjusted price history

Known failure mode

yfinance is an unofficial wrapper and can change unexpectedly; do not treat it as a production market-data contract.

Compatibility

Open-source community · research

Build the tool server

server.py
from mcp.server.fastmcp import FastMCP
import yfinance as yf

mcp = FastMCP("yfinance")

@mcp.tool()
def price_history(symbol: str, period: str = "1y") -> list:
    """Return adjusted historical prices for a ticker."""
    data = yf.Ticker(symbol).history(period=period, auto_adjust=True)
    return data.reset_index().tail(100).astype({"Date": "str"}).to_dict("records")

if __name__ == "__main__": mcp.run()

Examples and expected outcomes

Example 1

Fetch prices and statements in agent chat

  • Sourced evidence
  • Repeatable steps
  • Explicit uncertainty
Example 2

Create a read-only research brief

  • Sourced evidence
  • Repeatable steps
  • Explicit uncertainty
Example 3

Compare tickers with source timestamps

  • Sourced evidence
  • Repeatable steps
  • Explicit uncertainty

Access requirements

Keys and runtime

Open source

License and data rights

Review source and upstream data licenses

Rate limits

Use caching, backoff and bounded concurrency

Connect to your Agent

Claude config
{
  "mcpServers": {
    "yfinance-agent": {
      "command": "python",
      "args": [
        "server.py"
      ]
    }
  }
}
Prompt example

“Use yfinance Agent Skill to research AAPL. List sources and timestamps first, then separate facts, calculations, risks and missing data. Do not give personalized trading advice.”

When not to use it

  • yfinance is an unofficial wrapper and can change unexpectedly; do not treat it as a production market-data contract.

Connect it to your agent

Claude Desktop
{
  "mcpServers": {
    "yfinance-agent": {
      "command": "python",
      "args": [
        "server.py"
      ]
    }
  }
}
Prompt to test

“Use the connected tool to research AAPL. State the source and timestamp for every factual claim, separate facts from interpretation, and do not give personalized financial advice.”

Production checklist

  • Keep secrets outside prompts and source code
  • Allowlist read-only tools first
  • Log tool inputs, outputs and source timestamps
  • Require citations and handle missing data explicitly

When not to use it

yfinance is an unofficial wrapper and can change unexpectedly; do not treat it as a production market-data contract.

Open official documentation

Project-specific questions

What can yfinance Agent Skill do in a real workflow?

Download adjusted price history Read selected company metadata Inspect dividends and splits

What access and compatibility does yfinance Agent Skill require?

Open source. Open-source community.

What is the main implementation risk with yfinance Agent Skill?

yfinance is an unofficial wrapper and can change unexpectedly; do not treat it as a production market-data contract.