agentleFS
narumirunanarumiruna/yfinance-mcp/AGENTS.md

yfinance-mcp

AGENTS.md213 starsChanged 5 months agoMITView on GitHub

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

7 rules. About 1 is common, 1 is distinctive, and 5 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    All blocking yfinance operations MUST be wrapped with asyncio.to_thread().

    line 17
  2. Very specific:

    Test files: tests/test_*.py.

    line 31
  3. Very specific:

    Use pytest + pytest-asyncio for async behavior.

    line 32
  4. Very specific:

    If .pre-commit-config.yaml exists and code/config changed, run prek run -a (fallback: pre-commit run -a).

    line 33
  5. Very specific:

    Prefer short, imperative commit subjects (for example: Fix import order, Update README).

    line 36
  6. Distinctive:

    Keep commits focused; include tests when behavior changes.

    line 37
  7. Common:

    Never commit secrets or generated artifacts.

    line 41

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Repository Guidelines

Project Structure & Module Organization

  • src/yfmcp/server.py: FastMCP server, tool registration, and async wrappers around yfinance calls.
  • src/yfmcp/chart.py: chart generation (price_volume, vwap, volume_profile) and WebP image encoding.
  • src/yfmcp/types.py: shared Literal types (SearchType, TopType, Period, Interval, ChartType, ErrorCode).
  • src/yfmcp/utils.py: JSON helpers, including create_error_response().
  • tests/: async pytest suite for server tools, charts, and type behavior.
  • README.md: end-user setup and usage guide. Demo chatbot link points to the dedicated yfinance-mcp-demo repository.

Architecture Overview

  • MCP tools are exposed from yfmcp.server with yfinance_-prefixed names: yfinance_get_ticker_info, yfinance_get_analyst_price_targets, yfinance_get_analyst_estimates, yfinance_get_upgrades_downgrades, yfinance_get_fund_data, yfinance_get_ticker_news, yfinance_search, yfinance_get_top, yfinance_screen, yfinance_get_price_history, yfinance_get_financials, yfinance_get_holders, yfinance_get_option_chain, yfinance_get_option_dates.
  • All blocking yfinance operations MUST be wrapped with asyncio.to_thread().
  • Errors MUST be returned via create_error_response() with structured JSON (error, error_code, optional details).
  • Chart responses are returned as base64-encoded WebP ImageContent; tabular history uses Markdown tables.

Build, Test, and Development Commands

  • uv sync: install runtime dependencies.
  • uv sync --extra dev: install development dependencies.
  • uv run yfmcp: run the MCP server.
  • uv run ruff check . and uv run ruff format .: lint/format.
  • uv run ty check src tests: type check.
  • uv run pytest -v -s --cov=src tests: full test run with coverage.

Coding Style & Testing Guidelines

  • Python >=3.12, line length 120, one import per line (ruff isort).
  • Test files: tests/test_*.py; test functions: test_*.
  • Use pytest + pytest-asyncio for async behavior.
  • If .pre-commit-config.yaml exists and code/config changed, run prek run -a (fallback: pre-commit run -a).

Commit & Pull Request Guidelines

  • Prefer short, imperative commit subjects (for example: Fix import order, Update README).
  • Keep commits focused; include tests when behavior changes.
  • PRs should summarize intent and list the validation commands run.

Configuration & Secrets

  • Never commit secrets or generated artifacts.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.