openmarkets 0.1.0.dev52__tar.gz → 0.1.0.dev102__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/.editorconfig +1 -1
  2. openmarkets-0.1.0.dev102/.gemini/config.yaml +10 -0
  3. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/.gitignore +3 -0
  4. openmarkets-0.1.0.dev102/.pre-commit-config.yaml +42 -0
  5. openmarkets-0.1.0.dev102/.vscode/mcp.json +13 -0
  6. openmarkets-0.1.0.dev102/.vscode/settings.json +7 -0
  7. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/PKG-INFO +7 -4
  8. openmarkets-0.1.0.dev102/docs/api.md +5 -0
  9. openmarkets-0.1.0.dev102/docs/index.md +5 -0
  10. openmarkets-0.1.0.dev102/mkdocs.yml +118 -0
  11. openmarkets-0.1.0.dev102/other/mcp-server-yfinance/README.md +215 -0
  12. openmarkets-0.1.0.dev102/other/mcp-server-yfinance/mcp_server_yfinance/__main__.py +3 -0
  13. openmarkets-0.1.0.dev102/other/mcp-server-yfinance/pyproject.toml +57 -0
  14. openmarkets-0.1.0.dev102/other/mkt/README.md +215 -0
  15. openmarkets-0.1.0.dev102/other/mkt/mkt/__main__.py +3 -0
  16. openmarkets-0.1.0.dev102/other/mkt/pyproject.toml +57 -0
  17. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/pyproject.toml +33 -15
  18. openmarkets-0.1.0.dev102/pyrightconfig.json +15 -0
  19. openmarkets-0.1.0.dev102/src/openmarkets/__main__.py +26 -0
  20. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/src/openmarkets/_version.py +2 -2
  21. openmarkets-0.1.0.dev102/src/openmarkets/core/__init__.py +5 -0
  22. openmarkets-0.1.0.dev102/src/openmarkets/core/exceptions.py +16 -0
  23. openmarkets-0.1.0.dev102/src/openmarkets/core/models.py +17 -0
  24. openmarkets-0.1.0.dev102/src/openmarkets/core/registry.py +72 -0
  25. openmarkets-0.1.0.dev102/src/openmarkets/core/serializers.py +34 -0
  26. openmarkets-0.1.0.dev102/src/openmarkets/core/server.py +39 -0
  27. openmarkets-0.1.0.dev102/src/openmarkets/core/utils.py +38 -0
  28. openmarkets-0.1.0.dev102/src/openmarkets/services/__init__.py +1 -0
  29. openmarkets-0.1.0.dev102/src/openmarkets/tools/__init__.py +7 -0
  30. openmarkets-0.1.0.dev102/src/openmarkets/tools/analyst_data.py +56 -0
  31. openmarkets-0.1.0.dev102/src/openmarkets/tools/calendar.py +88 -0
  32. openmarkets-0.1.0.dev102/src/openmarkets/tools/corporate_actions.py +163 -0
  33. openmarkets-0.1.0.dev102/src/openmarkets/tools/crypto.py +216 -0
  34. openmarkets-0.1.0.dev102/src/openmarkets/tools/extended_market.py +326 -0
  35. openmarkets-0.1.0.dev102/src/openmarkets/tools/financial_statements.py +118 -0
  36. openmarkets-0.1.0.dev102/src/openmarkets/tools/funds.py +173 -0
  37. openmarkets-0.1.0.dev102/src/openmarkets/tools/historical_data.py +111 -0
  38. openmarkets-0.1.0.dev102/src/openmarkets/tools/market_data.py +168 -0
  39. openmarkets-0.1.0.dev102/src/openmarkets/tools/news.py +153 -0
  40. openmarkets-0.1.0.dev102/src/openmarkets/tools/options.py +161 -0
  41. openmarkets-0.1.0.dev102/src/openmarkets/tools/screener.py +392 -0
  42. openmarkets-0.1.0.dev102/src/openmarkets/tools/stock_info.py +138 -0
  43. openmarkets-0.1.0.dev102/src/openmarkets/tools/technical_analysis.py +126 -0
  44. openmarkets-0.1.0.dev102/tests/core/test_exceptions.py +44 -0
  45. openmarkets-0.1.0.dev102/tests/core/test_models.py +118 -0
  46. openmarkets-0.1.0.dev102/tests/core/test_registry.py +285 -0
  47. openmarkets-0.1.0.dev102/tests/core/test_serializers.py +99 -0
  48. openmarkets-0.1.0.dev102/tests/core/test_server.py +129 -0
  49. openmarkets-0.1.0.dev102/tests/core/test_utils.py +55 -0
  50. openmarkets-0.1.0.dev102/tests/tools/test_analyst_data.py +85 -0
  51. openmarkets-0.1.0.dev102/tests/tools/test_calendar.py +104 -0
  52. openmarkets-0.1.0.dev102/tests/tools/test_corporate_actions.py +309 -0
  53. openmarkets-0.1.0.dev102/tests/tools/test_crypto.py +319 -0
  54. openmarkets-0.1.0.dev102/tests/tools/test_extended_market.py +285 -0
  55. openmarkets-0.1.0.dev102/tests/tools/test_financial_statements.py +448 -0
  56. openmarkets-0.1.0.dev102/tests/tools/test_funds.py +291 -0
  57. openmarkets-0.1.0.dev102/tests/tools/test_funds_2.py +148 -0
  58. openmarkets-0.1.0.dev102/tests/tools/test_historical_data.py +283 -0
  59. openmarkets-0.1.0.dev102/tests/tools/test_market_data.py +96 -0
  60. openmarkets-0.1.0.dev102/tests/tools/test_options.py +115 -0
  61. openmarkets-0.1.0.dev102/tests/tools/test_stock_info.py +186 -0
  62. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/__init__.pyi +17 -17
  63. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/base.pyi +17 -30
  64. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/cache.pyi +45 -1
  65. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/data.pyi +4 -3
  66. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/domain/__init__.pyi +1 -1
  67. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/domain/domain.pyi +0 -1
  68. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/domain/market.pyi +1 -3
  69. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/domain/sector.pyi +9 -3
  70. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/exceptions.pyi +1 -1
  71. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/live.pyi +3 -9
  72. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/lookup.pyi +1 -6
  73. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/multi.pyi +4 -3
  74. openmarkets-0.1.0.dev102/typings/yfinance/scrapers/__init__.pyi +0 -0
  75. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/scrapers/fundamentals.pyi +3 -3
  76. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/scrapers/history.pyi +19 -10
  77. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/scrapers/quote.pyi +1 -4
  78. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/screener/__init__.pyi +1 -1
  79. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/screener/query.pyi +17 -9
  80. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/screener/screener.pyi +3 -2
  81. openmarkets-0.1.0.dev102/typings/yfinance/shared.pyi +0 -0
  82. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/tickers.pyi +6 -7
  83. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/utils.pyi +9 -24
  84. openmarkets-0.1.0.dev52/.pre-commit-config.yaml +0 -22
  85. openmarkets-0.1.0.dev52/src/openmarkets/server.py +0 -45
  86. openmarkets-0.1.0.dev52/src/openmarkets/tools/__init__.py +0 -33
  87. openmarkets-0.1.0.dev52/src/openmarkets/tools/analyst_data.py +0 -81
  88. openmarkets-0.1.0.dev52/src/openmarkets/tools/calendar.py +0 -78
  89. openmarkets-0.1.0.dev52/src/openmarkets/tools/corporate_actions.py +0 -147
  90. openmarkets-0.1.0.dev52/src/openmarkets/tools/crypto.py +0 -203
  91. openmarkets-0.1.0.dev52/src/openmarkets/tools/extended_market.py +0 -298
  92. openmarkets-0.1.0.dev52/src/openmarkets/tools/financial_statements.py +0 -140
  93. openmarkets-0.1.0.dev52/src/openmarkets/tools/funds.py +0 -167
  94. openmarkets-0.1.0.dev52/src/openmarkets/tools/historical_data.py +0 -121
  95. openmarkets-0.1.0.dev52/src/openmarkets/tools/market_data.py +0 -201
  96. openmarkets-0.1.0.dev52/src/openmarkets/tools/news.py +0 -148
  97. openmarkets-0.1.0.dev52/src/openmarkets/tools/options.py +0 -176
  98. openmarkets-0.1.0.dev52/src/openmarkets/tools/screener.py +0 -386
  99. openmarkets-0.1.0.dev52/src/openmarkets/tools/stock_info.py +0 -143
  100. openmarkets-0.1.0.dev52/src/openmarkets/tools/technical_analysis.py +0 -153
  101. /openmarkets-0.1.0.dev52/src/openmarkets/py.typed → /openmarkets-0.1.0.dev102/.git-blame-ignore-revs +0 -0
  102. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/.gitattributes +0 -0
  103. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/.github/CODEOWNERS +0 -0
  104. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/.python-version +0 -0
  105. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/CITATION.cff +0 -0
  106. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/LICENSE +0 -0
  107. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/README.md +0 -0
  108. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/src/openmarkets/__init__.py +0 -0
  109. /openmarkets-0.1.0.dev52/typings/yfinance/scrapers/__init__.pyi → /openmarkets-0.1.0.dev102/src/openmarkets/py.typed +0 -0
  110. /openmarkets-0.1.0.dev52/typings/yfinance/shared.pyi → /openmarkets-0.1.0.dev102/src/openmarkets/schemas/__init__.py +0 -0
  111. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/const.pyi +0 -0
  112. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/domain/industry.pyi +0 -0
  113. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/pricing_pb2.pyi +0 -0
  114. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/scrapers/analysis.pyi +0 -0
  115. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/scrapers/funds.pyi +0 -0
  116. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/scrapers/holders.pyi +0 -0
  117. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/search.pyi +0 -0
  118. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/ticker.pyi +0 -0
  119. {openmarkets-0.1.0.dev52 → openmarkets-0.1.0.dev102}/typings/yfinance/version.pyi +0 -0
@@ -11,7 +11,7 @@ indent_style = space
11
11
  indent_size = 4
12
12
  insert_final_newline = true
13
13
  trim_trailing_whitespace = true
14
- max_line_length = 88 # Black formatter default
14
+ max_line_length = 120
15
15
  multi_line_output = 3 # isort setting
16
16
 
17
17
  # Markdown files
@@ -0,0 +1,10 @@
1
+ # https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github#custom-configuration
2
+ have_fun: false
3
+ code_review:
4
+ disable: false
5
+ comment_severity_threshold: HIGH
6
+ max_review_comments: -1
7
+ pull_request_opened:
8
+ help: false
9
+ summary: false
10
+ code_review: false
@@ -304,3 +304,6 @@ uv.lock
304
304
 
305
305
  # version-file
306
306
  _version.py
307
+
308
+ # Sphinx documentation
309
+ site/
@@ -0,0 +1,42 @@
1
+ ci:
2
+ skip: [ty]
3
+
4
+ default_install_hook_types:
5
+ - pre-commit
6
+ - post-checkout
7
+ - post-merge
8
+ - post-rewrite
9
+
10
+ repos:
11
+ - repo: https://github.com/astral-sh/uv-pre-commit
12
+ rev: 0.7.13
13
+ hooks:
14
+ - id: uv-sync
15
+ args: ["--all-packages"]
16
+ - repo: https://github.com/astral-sh/ruff-pre-commit
17
+ rev: v0.12.0
18
+ hooks:
19
+ - id: ruff
20
+ args: [--fix, --exit-non-zero-on-fix]
21
+ exclude: "^typings/"
22
+ - id: ruff-format
23
+ - repo: https://github.com/commitizen-tools/commitizen
24
+ rev: v4.8.3
25
+ hooks:
26
+ - id: commitizen
27
+ - id: commitizen-branch
28
+ stages: [pre-push]
29
+ - repo: local
30
+ hooks:
31
+ - id: pyright
32
+ name: pyright
33
+ entry: uv run pyright
34
+ args: [src]
35
+ language: system
36
+ types: [python]
37
+ pass_filenames: false
38
+ - id: pytest
39
+ name: pytest
40
+ language: system
41
+ entry: uv run pytest
42
+ stages: ["manual"]
@@ -0,0 +1,13 @@
1
+ {
2
+ "servers": {
3
+ "openmarkets-dev": {
4
+ "command": "uv",
5
+ "args": [
6
+ "--directory",
7
+ ".",
8
+ "run",
9
+ "openmarkets"
10
+ ]
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "python.testing.pytestArgs": [
3
+ "."
4
+ ],
5
+ "python.testing.unittestEnabled": false,
6
+ "python.testing.pytestEnabled": true
7
+ }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openmarkets
3
- Version: 0.1.0.dev52
3
+ Version: 0.1.0.dev102
4
4
  Summary: A Model Context Protocol (MCP) server for agentic retrieval of financial market data. This server leverages YFinance to provide a simple and efficient way to access historical stock prices, dividends, stock splits, company information, and other financial metrics.
5
5
  Project-URL: Homepage, https://github.com/danchev/openmarkets
6
6
  Project-URL: Issues, https://github.com/danchev/openmarkets/issues
@@ -13,7 +13,10 @@ Classifier: Intended Audience :: Developers
13
13
  Classifier: Intended Audience :: Financial and Insurance Industry
14
14
  Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
15
15
  Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python
17
+ Classifier: Programming Language :: Python :: 3
16
18
  Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.10
17
20
  Classifier: Programming Language :: Python :: 3.11
18
21
  Classifier: Programming Language :: Python :: 3.12
19
22
  Classifier: Programming Language :: Python :: 3.13
@@ -25,9 +28,9 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
25
28
  Classifier: Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator
26
29
  Classifier: Topic :: Software Development :: Libraries
27
30
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
28
- Requires-Python: >=3.11
29
- Requires-Dist: mcp[cli]>=1.9.0
30
- Requires-Dist: yfinance>=0.2.61
31
+ Requires-Python: >=3.10
32
+ Requires-Dist: mcp[cli]>=1.9.4
33
+ Requires-Dist: yfinance>=0.2.63
31
34
  Description-Content-Type: text/markdown
32
35
 
33
36
  ![PyPI](https://img.shields.io/pypi/v/openmarkets)
@@ -0,0 +1,5 @@
1
+ ::: openmarkets.server
2
+ :members:
3
+ :undoc-members:
4
+ :show-inheritance:
5
+ :noindex:
@@ -0,0 +1,5 @@
1
+ # MCP Server
2
+
3
+ This is the MCP Server implementation in Python.
4
+
5
+ It only contains the [API Reference](api.md) for the time being.
@@ -0,0 +1,118 @@
1
+ site_name: MCP Server
2
+ site_description: MCP Server
3
+ strict: true
4
+
5
+ repo_name: danchev/openmarkets
6
+ repo_url: https://github.com/danchev/openmarkets
7
+ edit_uri: edit/master/docs/
8
+ site_url: https://danchev.github.io/openmarkets
9
+
10
+ site_author: "Danchev"
11
+
12
+ nav:
13
+ - Home: index.md
14
+ - API Reference: api.md
15
+
16
+ theme:
17
+ name: "material"
18
+ palette:
19
+ - media: "(prefers-color-scheme)"
20
+ scheme: default
21
+ primary: black
22
+ accent: black
23
+ toggle:
24
+ icon: material/lightbulb
25
+ name: "Switch to light mode"
26
+ - media: "(prefers-color-scheme: light)"
27
+ scheme: default
28
+ primary: black
29
+ accent: black
30
+ toggle:
31
+ icon: material/lightbulb-outline
32
+ name: "Switch to dark mode"
33
+ - media: "(prefers-color-scheme: dark)"
34
+ scheme: slate
35
+ primary: white
36
+ accent: white
37
+ toggle:
38
+ icon: material/lightbulb-auto-outline
39
+ name: "Switch to system preference"
40
+ features:
41
+ - search.suggest
42
+ - search.highlight
43
+ - content.tabs.link
44
+ - content.code.annotate
45
+ - content.code.copy
46
+ - content.code.select
47
+ - navigation.path
48
+ - navigation.indexes
49
+ - navigation.sections
50
+ - navigation.tracking
51
+ - toc.follow
52
+ # logo: "img/logo-white.svg"
53
+ # favicon: "favicon.ico"
54
+
55
+ # https://www.mkdocs.org/user-guide/configuration/#validation
56
+ validation:
57
+ omitted_files: warn
58
+ absolute_links: warn
59
+ unrecognized_links: warn
60
+ anchors: warn
61
+
62
+ markdown_extensions:
63
+ - tables
64
+ - admonition
65
+ - attr_list
66
+ - md_in_html
67
+ - pymdownx.details
68
+ - pymdownx.caret
69
+ - pymdownx.critic
70
+ - pymdownx.mark
71
+ - pymdownx.superfences
72
+ - pymdownx.snippets
73
+ - pymdownx.tilde
74
+ - pymdownx.inlinehilite
75
+ - pymdownx.highlight:
76
+ pygments_lang_class: true
77
+ - pymdownx.extra:
78
+ pymdownx.superfences:
79
+ custom_fences:
80
+ - name: mermaid
81
+ class: mermaid
82
+ format: !!python/name:pymdownx.superfences.fence_code_format
83
+ - pymdownx.emoji:
84
+ emoji_index: !!python/name:material.extensions.emoji.twemoji
85
+ emoji_generator: !!python/name:material.extensions.emoji.to_svg
86
+ options:
87
+ custom_icons:
88
+ - docs/.overrides/.icons
89
+ - pymdownx.tabbed:
90
+ alternate_style: true
91
+ - pymdownx.tasklist:
92
+ custom_checkbox: true
93
+ - sane_lists # this means you can start a list from any number
94
+
95
+ watch:
96
+ - src/openmarkets
97
+
98
+ plugins:
99
+ - search
100
+ - social
101
+ - glightbox
102
+ - mkdocstrings:
103
+ handlers:
104
+ python:
105
+ paths: [src/openmarkets]
106
+ options:
107
+ relative_crossrefs: true
108
+ members_order: source
109
+ separate_signature: true
110
+ show_signature_annotations: true
111
+ signature_crossrefs: true
112
+ group_by_category: false
113
+ # 3 because docs are in pages with an H2 just above them
114
+ heading_level: 3
115
+ import:
116
+ - url: https://docs.python.org/3/objects.inv
117
+ - url: https://docs.pydantic.dev/latest/objects.inv
118
+ - url: https://typing-extensions.readthedocs.io/en/latest/objects.inv
@@ -0,0 +1,215 @@
1
+ ![PyPI](https://img.shields.io/pypi/v/openmarkets)
2
+ [![PyPI - Downloads](https://static.pepy.tech/badge/openmarkets)](https://pepy.tech/project/openmarkets)
3
+ ![PyPI - Monthly Downloads](https://static.pepy.tech/badge/openmarkets/month)
4
+
5
+ # Open Markets
6
+
7
+ A Model Context Protocol (MCP) server for agentic retrieval of financial data from Yahoo Finance. This server leverages YFinance to provide a simple and efficient way to access historical stock prices, dividends, stock splits, company information, and other financial metrics.
8
+
9
+ This MCP server is designed to be used with various LLM applications that support the Model Context Protocol, such as Claude Desktop, n8n, and Cursor. It allows users to retrieve financial data in a structured way, making it easy to integrate into AI applications.
10
+
11
+ ## Features
12
+
13
+ - Get basic stock information (price, market cap, sector, etc.)
14
+ - Fetch historical price data with customizable periods
15
+ - Retrieve analyst recommendations
16
+ - Download data for multiple stocks simultaneously
17
+ - Access dividend history
18
+
19
+ ## Usage
20
+
21
+ This MCP server can be used with various LLM applications that support the Model Context Protocol:
22
+
23
+ - **Claude Desktop**: Anthropic's desktop application for Claude
24
+ - **Cursor**: AI-powered code editor with MCP support
25
+ - **Custom MCP clients**: Any application implementing the MCP client specification
26
+
27
+ ## Usage with Claude Desktop
28
+
29
+ 1. Install Claude Desktop from https://claude.ai/download
30
+ 2. Open your Claude Desktop configuration:
31
+
32
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
33
+ - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
34
+
35
+ 3. Add the following configuration:
36
+
37
+ ```json
38
+ {
39
+ "mcpServers": {
40
+ "yfinance": {
41
+ "command": "uvx",
42
+ "args": [
43
+ "openmarkets@latest"
44
+ ]
45
+ }
46
+ }
47
+ }
48
+ ```
49
+
50
+ 4. Restart Claude Desktop
51
+
52
+ ## Usage with VS Code
53
+
54
+ For quick installation, use one of the one-click installation buttons below:
55
+
56
+ [![Install with UVX in VS Code](https://img.shields.io/badge/VS_Code-UV-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=yfinance&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22openmarkets%22%5D%7D) [![Install with UVX in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-UV-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=yfinance&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22openmarkets%22%5D%7D&quality=insiders)
57
+
58
+ For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing `Ctrl + Shift + P` and typing `Preferences: Open Settings (JSON)`.
59
+
60
+ Optionally, you can add it to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others.
61
+
62
+ > Note that the `mcp` key is not needed in the `.vscode/mcp.json` file.
63
+
64
+ #### UVX
65
+
66
+ ```json
67
+ {
68
+ "mcp": {
69
+ "servers": {
70
+ "yfinance": {
71
+ "command": "uvx",
72
+ "args": [
73
+ "openmarkets@latest"
74
+ ]
75
+ }
76
+ }
77
+ }
78
+ }
79
+ ```
80
+
81
+ ### Available Tools
82
+ This MCP server provides a variety of tools for retrieving financial data. Below is a list of available tools and their main arguments:
83
+
84
+ ---
85
+ #### Stock Information
86
+ - **get_stock_info(ticker: str)**
87
+ Get basic information about a stock.
88
+
89
+ #### Historical Data
90
+ - **get_historical_data(ticker: str, period: str = "1mo", interval: str = "1d")**
91
+ Get historical price data for a stock.
92
+ - **get_multiple_tickers(tickers: list[str], period: str = "1d")**
93
+ Get data for multiple stocks at once.
94
+ - **download_bulk_data(tickers: list[str], period: str = "1mo", interval: str = "1d", ...)**
95
+ Download bulk historical data for multiple tickers.
96
+ - **get_ticker_history_metadata(ticker: str)**
97
+ Get available periods, intervals, and metadata for a ticker.
98
+
99
+ #### Analyst Data
100
+ - **get_recommendations(ticker: str)**
101
+ Get analyst recommendations for a stock.
102
+ - **get_analyst_price_targets(ticker: str)**
103
+ Get analyst price targets.
104
+ - **get_upgrades_downgrades(ticker: str)**
105
+ Get recent upgrades and downgrades.
106
+ - **get_recommendations_summary(ticker: str)**
107
+ Get recommendations summary.
108
+
109
+ #### Corporate Actions
110
+ - **get_dividends(symbol: str, period: str = "5y")**
111
+ Get dividend history for a stock.
112
+ - **get_splits_history(symbol: str, period: str = "5y")**
113
+ Get stock split history.
114
+
115
+ #### Market Data
116
+ - **get_market_status()**
117
+ Get current US market status.
118
+ - **get_trending_tickers(region: str = "US", count: int = 10)**
119
+ Get trending/popular tickers.
120
+ - **get_sector_performance()**
121
+ Get sector performance using ETFs.
122
+ - **get_index_data(indices: list[str] = None)**
123
+ Get data for major market indices.
124
+
125
+ #### Calendar & Market Hours
126
+ - **get_market_calendar_info(ticker: str)**
127
+ Get market calendar and session info.
128
+ - **get_market_hours(ticker: str)**
129
+ Get market hours and session information.
130
+ - **get_exchange_info(ticker: str)**
131
+ Get detailed exchange and trading information.
132
+
133
+ #### Screener & Search
134
+ - **screen_stocks_by_criteria(...)**
135
+ Screen stocks by market cap, P/E, dividend yield, sector, etc.
136
+ - **get_similar_stocks(ticker: str, count: int = 5)**
137
+ Find similar stocks by sector and market cap.
138
+ - **get_top_performers(period: str = "1mo", sector: str = None, count: int = 10)**
139
+ Get top performing stocks.
140
+
141
+ #### Technical Analysis
142
+ - **get_technical_indicators(ticker: str, period: str = "6mo")**
143
+ Get technical indicators (SMA, price position, etc.).
144
+ - **get_volatility_metrics(ticker: str, period: str = "1y")**
145
+ Get volatility and risk metrics.
146
+ - **get_support_resistance_levels(ticker: str, period: str = "6mo")**
147
+ Get support and resistance levels.
148
+
149
+ #### Options
150
+ - **get_options_expiration_dates(ticker: str)**
151
+ Get available options expiration dates.
152
+ - **get_option_chain(ticker: str, expiration_date: str = None)**
153
+ Get option chain for a ticker.
154
+ - **get_options_volume_analysis(ticker: str, expiration_date: str = None)**
155
+ Analyze options volume and open interest.
156
+ - **get_options_by_moneyness(ticker: str, expiration_date: str = None, moneyness_range: float = 0.1)**
157
+ Filter options by proximity to current price.
158
+
159
+ #### Financial Statements
160
+ - **get_financials_summary(ticker: str)**
161
+ Get key financial metrics summary.
162
+
163
+ #### Funds & ETFs
164
+ - **get_fund_profile(ticker: str)**
165
+ Get fund/ETF profile.
166
+ - **get_fund_holdings(ticker: str, count: int = 20)**
167
+ Get top holdings of a fund/ETF.
168
+ - **get_fund_sector_allocation(ticker: str)**
169
+ Get sector allocation of a fund/ETF.
170
+ - **get_fund_performance(ticker: str)**
171
+ Get fund/ETF performance metrics.
172
+ - **compare_funds(tickers: list[str])**
173
+ Compare multiple funds/ETFs.
174
+
175
+ #### Crypto
176
+ - **get_crypto_info(crypto_symbol: str)**
177
+ Get cryptocurrency info.
178
+ - **get_crypto_historical_data(crypto_symbol: str, period: str = "1mo", interval: str = "1d")**
179
+ Get historical data for a cryptocurrency.
180
+ - **get_top_cryptocurrencies(count: int = 10)**
181
+ Get data for top cryptocurrencies.
182
+ - **get_crypto_fear_greed_proxy(crypto_symbols: list[str] = None)**
183
+ Get a proxy for crypto fear/greed index.
184
+
185
+ #### Currency & Validation
186
+ - **get_currency_data(base_currency: str = "USD", target_currencies: list[str] = None)**
187
+ Get currency exchange rates.
188
+ - **validate_tickers(tickers: list[str])**
189
+ Validate if tickers are valid and available.
190
+
191
+ ---
192
+
193
+ This list reflects the tools registered in the codebase and their main arguments. For more details, see the respective files in tools.
194
+
195
+ ## Development
196
+
197
+ To test the MCP server locally, install the `uvx` and `npx` and run the following command:
198
+
199
+ ```bash
200
+ npx @modelcontextprotocol/inspector uvx openmarkets@latest
201
+ ```
202
+
203
+ This command will start the MCP server and open the MCP Inspector in your default web browser. You can then interact with the server and test its functionality.
204
+
205
+ ## License
206
+
207
+ AGPLv3+ License - see [LICENSE](LICENSE) for details.
208
+
209
+ ## Contributing
210
+
211
+ 1. Fork the repository
212
+ 2. Create a feature branch
213
+ 3. Commit your changes
214
+ 4. Push to the branch
215
+ 5. Create a pull request
@@ -0,0 +1,3 @@
1
+ import runpy
2
+
3
+ runpy.run_module("openmarkets.__main__", run_name="__main__", alter_sys=True)
@@ -0,0 +1,57 @@
1
+ [project]
2
+ name = "mcp-server-yfinance"
3
+ dynamic = ["version"]
4
+ description = "A Model Context Protocol (MCP) server for agentic retrieval of financial market data. This server leverages YFinance to provide a simple and efficient way to access historical stock prices, dividends, stock splits, company information, and other financial metrics."
5
+ authors = [{ name = "Dobri Danchev", email = "python-dist@danchev.net" }]
6
+ classifiers = [
7
+ "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
8
+ "Development Status :: 3 - Alpha",
9
+ "Operating System :: OS Independent",
10
+ "Intended Audience :: Developers",
11
+ "Intended Audience :: Financial and Insurance Industry",
12
+ "Topic :: Office/Business :: Financial",
13
+ "Topic :: Office/Business :: Financial :: Investment",
14
+ "Topic :: Scientific/Engineering",
15
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
16
+ "Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator",
17
+ "Topic :: Software Development :: Libraries",
18
+ "Topic :: Software Development :: Libraries :: Python Modules",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Programming Language :: Python :: 3.14",
23
+ "Programming Language :: Python :: 3 :: Only",
24
+ ]
25
+ keywords = ["machinelearning", "finance", "investment", "mcp", "modelcontextprotocol", "yahoo finance", "financial data retrieval"]
26
+ readme = "README.md"
27
+ license = { text = "AGPL-3.0-or-later" }
28
+ requires-python = ">=3.11"
29
+ dependencies = [
30
+ "openmarkets>=0.1.0.dev53",
31
+ ]
32
+
33
+ [project.urls]
34
+ Homepage = "https://github.com/danchev/openmarkets"
35
+ Issues = "https://github.com/danchev/openmarkets/issues"
36
+
37
+ [project.scripts]
38
+ mcp-server-yfinance = "mcp_server_yfinance.__main__:main"
39
+
40
+ [build-system]
41
+ requires = ["hatchling", "hatch-vcs"]
42
+ build-backend = "hatchling.build"
43
+
44
+ [tool.hatch.build.targets.wheel]
45
+ packages = ["mcp_server_yfinance"]
46
+
47
+ [tool.hatch.build.hooks.vcs]
48
+ version-file = "mcp_server_yfinance/_version.py"
49
+
50
+ [tool.hatch.envs.default]
51
+ installer = "uv"
52
+
53
+ [tool.hatch.version]
54
+ source = "vcs"
55
+ raw-options.version_scheme = "release-branch-semver" # "calver-by-date"
56
+ raw-options.local_scheme = "no-local-version"
57
+ raw-options.fallback_version = "0.0.0"