yfinance-mcp
AGENTS.md197 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 checking a change actually works.
Of the AGENTS.md files we read, the 11,736 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.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
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
- Very specific: line 17
All blocking yfinance operations MUST be wrapped with asyncio.to_thread().
- Very specific: line 31
Test files: tests/test_*.py.
- Very specific: line 32
Use pytest + pytest-asyncio for async behavior.
- Very specific: line 33
If .pre-commit-config.yaml exists and code/config changed, run prek run -a (fallback: pre-commit run -a).
- Very specific: line 36
Prefer short, imperative commit subjects (for example: Fix import order, Update README).
- Distinctive: line 37
Keep commits focused; include tests when behavior changes.
- Common: line 41
Never commit secrets or generated artifacts.
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 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.
Files
Repository Guidelines
Project Structure & Module Organization
src/yfmcp/server.py: FastMCP server, tool registration, and async wrappers aroundyfinancecalls.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, includingcreate_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 dedicatedyfinance-mcp-demorepository.
Architecture Overview
- MCP tools are exposed from
yfmcp.serverwithyfinance_-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
yfinanceoperations MUST be wrapped withasyncio.to_thread(). - Errors MUST be returned via
create_error_response()with structured JSON (error,error_code, optionaldetails). - 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 .anduv 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 length120, one import per line (ruff isort). - Test files:
tests/test_*.py; test functions:test_*. - Use
pytest+pytest-asynciofor async behavior. - If
.pre-commit-config.yamlexists and code/config changed, runprek 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.
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
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.

