yfin-mcp 0.2.5__tar.gz → 0.2.8__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 (34) hide show
  1. yfin_mcp-0.2.8/.gitignore +10 -0
  2. yfin_mcp-0.2.8/.pre-commit-config.yaml +14 -0
  3. yfin_mcp-0.2.8/.python-version +1 -0
  4. yfin_mcp-0.2.8/.vscode/mcp.json +12 -0
  5. yfin_mcp-0.2.8/.vscode/settings.json +5 -0
  6. yfin_mcp-0.2.8/Dockerfile +41 -0
  7. {yfin_mcp-0.2.5/src/yfin_mcp.egg-info → yfin_mcp-0.2.8}/PKG-INFO +14 -1
  8. {yfin_mcp-0.2.5 → yfin_mcp-0.2.8}/README.md +13 -0
  9. yfin_mcp-0.2.8/README.zh.md +214 -0
  10. yfin_mcp-0.2.8/TESTING.md +155 -0
  11. yfin_mcp-0.2.8/assets/demo.gif +0 -0
  12. yfin_mcp-0.2.8/publish_package.bat +88 -0
  13. yfin_mcp-0.2.8/publish_package.sh +62 -0
  14. {yfin_mcp-0.2.5 → yfin_mcp-0.2.8}/pyproject.toml +6 -2
  15. yfin_mcp-0.2.8/run_inspector.bat +13 -0
  16. yfin_mcp-0.2.8/run_inspector.sh +13 -0
  17. yfin_mcp-0.2.8/run_inspector_prod.bat +14 -0
  18. yfin_mcp-0.2.8/run_inspector_prod.sh +14 -0
  19. yfin_mcp-0.2.8/scripts/bump_version.py +50 -0
  20. yfin_mcp-0.2.8/smithery.yaml +16 -0
  21. {yfin_mcp-0.2.5 → yfin_mcp-0.2.8}/src/yfin_mcp/server.py +13 -3
  22. {yfin_mcp-0.2.5 → yfin_mcp-0.2.8/src/yfin_mcp.egg-info}/PKG-INFO +14 -1
  23. {yfin_mcp-0.2.5 → yfin_mcp-0.2.8}/src/yfin_mcp.egg-info/SOURCES.txt +18 -0
  24. yfin_mcp-0.2.8/uv.lock +989 -0
  25. {yfin_mcp-0.2.5 → yfin_mcp-0.2.8}/LICENSE +0 -0
  26. {yfin_mcp-0.2.5 → yfin_mcp-0.2.8}/setup.cfg +0 -0
  27. {yfin_mcp-0.2.5 → yfin_mcp-0.2.8}/src/yfin_mcp/__init__.py +0 -0
  28. {yfin_mcp-0.2.5 → yfin_mcp-0.2.8}/src/yfin_mcp/__main__.py +0 -0
  29. {yfin_mcp-0.2.5 → yfin_mcp-0.2.8}/src/yfin_mcp/cache_manager.py +0 -0
  30. {yfin_mcp-0.2.5 → yfin_mcp-0.2.8}/src/yfin_mcp/pagination_utils.py +0 -0
  31. {yfin_mcp-0.2.5 → yfin_mcp-0.2.8}/src/yfin_mcp.egg-info/dependency_links.txt +0 -0
  32. {yfin_mcp-0.2.5 → yfin_mcp-0.2.8}/src/yfin_mcp.egg-info/entry_points.txt +0 -0
  33. {yfin_mcp-0.2.5 → yfin_mcp-0.2.8}/src/yfin_mcp.egg-info/requires.txt +0 -0
  34. {yfin_mcp-0.2.5 → yfin_mcp-0.2.8}/src/yfin_mcp.egg-info/top_level.txt +0 -0
@@ -0,0 +1,10 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
@@ -0,0 +1,14 @@
1
+ repos:
2
+ - repo: https://github.com/psf/black
3
+ rev: 24.2.0
4
+ hooks:
5
+ - id: black
6
+ language_version: python3.11
7
+ args: [--line-length=100]
8
+
9
+ - repo: https://github.com/pycqa/isort
10
+ rev: 5.13.2
11
+ hooks:
12
+ - id: isort
13
+ name: isort (python)
14
+ args: [--profile=black, --line-length=100]
@@ -0,0 +1 @@
1
+ 3.11
@@ -0,0 +1,12 @@
1
+ {
2
+ "servers": {
3
+ "yfinance": {
4
+ "type": "stdio",
5
+ "command": "uvx",
6
+ "args": [
7
+ "yahoo-finance-mcp"
8
+ ]
9
+ }
10
+ },
11
+ "inputs": []
12
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "python-envs.defaultEnvManager": "ms-python.python:conda",
3
+ "python-envs.defaultPackageManager": "ms-python.python:conda",
4
+ "python-envs.pythonProjects": []
5
+ }
@@ -0,0 +1,41 @@
1
+ # Use a Python image with uv pre-installed
2
+ FROM ghcr.io/astral-sh/uv:python3.11-bookworm-slim AS uv
3
+
4
+ # Install the project into /app
5
+ WORKDIR /app
6
+
7
+ # Enable bytecode compilation
8
+ ENV UV_COMPILE_BYTECODE=1
9
+
10
+ # Copy from the cache instead of linking since it's a mounted volume
11
+ ENV UV_LINK_MODE=copy
12
+
13
+ # Copy project files
14
+ COPY pyproject.toml .
15
+
16
+ # Install the project's dependencies using uv
17
+ RUN --mount=type=cache,target=/root/.cache/uv \
18
+ uv pip install --system -e .
19
+
20
+ # Copy the rest of the application code
21
+ COPY . .
22
+
23
+ # Second stage: runtime image
24
+ FROM python:3.11-slim
25
+
26
+ WORKDIR /app
27
+
28
+ # Copy the virtual environment from the uv stage
29
+ COPY --from=uv /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
30
+ COPY --from=uv /usr/local/bin /usr/local/bin
31
+
32
+ # Copy application code
33
+ COPY . .
34
+
35
+ # Set environment variables
36
+ ENV PYTHONDONTWRITEBYTECODE=1 \
37
+ PYTHONUNBUFFERED=1 \
38
+ PYTHONPATH=/app
39
+
40
+ # Command to run the MCP server
41
+ CMD ["uv", "run", "yfin-mcp"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yfin-mcp
3
- Version: 0.2.5
3
+ Version: 0.2.8
4
4
  Summary: Enhanced Yahoo Finance MCP Server with intelligent pagination, caching, and LLM-optimized responses
5
5
  Author: AlexYoung (Original Author)
6
6
  Author-email: fritzprix <innocentevil0914@gmail.com>
@@ -317,6 +317,19 @@ chmod +x publish_package.sh
317
317
  > [!NOTE]
318
318
  > The scripts will build the package into the `dist/` directory and then use `twine` to upload it. Ensure you have your PyPI credentials configured in `~/.pypirc` (or `%HOME%\.pypirc` on Windows) or set the `TWINE_PASSWORD` environment variable.
319
319
 
320
+
321
+ ## Troubleshooting
322
+
323
+ ### [ERROR] os error 32: Process cannot access the file
324
+ If you see this error when running `publish_package.bat` or `uv build`, it means the MCP server is still running and locking the executable.
325
+ 1. **Close Claude Desktop** or any app using the yfinance MCP server.
326
+ 2. Stop any running **MCP Inspector** instances.
327
+ 3. If the error persists, manually kill the processes:
328
+ ```bash
329
+ taskkill /F /IM yfin-mcp.exe /T
330
+ taskkill /F /IM python.exe /T
331
+ ```
332
+
320
333
  ## License
321
334
 
322
335
  MIT License
@@ -285,6 +285,19 @@ chmod +x publish_package.sh
285
285
  > [!NOTE]
286
286
  > The scripts will build the package into the `dist/` directory and then use `twine` to upload it. Ensure you have your PyPI credentials configured in `~/.pypirc` (or `%HOME%\.pypirc` on Windows) or set the `TWINE_PASSWORD` environment variable.
287
287
 
288
+
289
+ ## Troubleshooting
290
+
291
+ ### [ERROR] os error 32: Process cannot access the file
292
+ If you see this error when running `publish_package.bat` or `uv build`, it means the MCP server is still running and locking the executable.
293
+ 1. **Close Claude Desktop** or any app using the yfinance MCP server.
294
+ 2. Stop any running **MCP Inspector** instances.
295
+ 3. If the error persists, manually kill the processes:
296
+ ```bash
297
+ taskkill /F /IM yfin-mcp.exe /T
298
+ taskkill /F /IM python.exe /T
299
+ ```
300
+
288
301
  ## License
289
302
 
290
303
  MIT License
@@ -0,0 +1,214 @@
1
+ # Yahoo Finance MCP 服务器
2
+
3
+ > **注意:** 这是一个社区分支。官方包由 [Alex2Yang97](https://github.com/Alex2Yang97/yahoo-finance-mcp) 维护,可在 [PyPI](https://pypi.org/project/yahoo-finance-mcp/) 上获取。
4
+
5
+ <div align="right">
6
+ <a href="README.md">English</a> | <a href="README.zh.md">中文</a>
7
+ </div>
8
+
9
+ 这是一个基于模型上下文协议(MCP)的服务器,提供来自 Yahoo Finance 的全面金融数据。它允许您获取股票的详细信息,包括历史价格、公司信息、财务报表、期权数据和市场新闻。
10
+
11
+ [![smithery badge](https://smithery.ai/badge/@Alex2Yang97/yahoo-finance-mcp)](https://smithery.ai/server/@Alex2Yang97/yahoo-finance-mcp)
12
+
13
+ ## 演示
14
+
15
+ ![MCP 演示](assets/demo.gif)
16
+
17
+ ## MCP 工具
18
+
19
+ 服务器通过模型上下文协议提供以下工具:
20
+
21
+ ### 股票信息
22
+
23
+ | 工具 | 描述 |
24
+ |------|-------------|
25
+ | `get_historical_stock_prices` | 获取股票的历史 OHLCV 数据,可自定义时间段和间隔 |
26
+ | `get_stock_info` | 获取全面的股票数据,包括价格、指标和公司详情 |
27
+ | `get_yahoo_finance_news` | 获取股票的最新新闻文章 |
28
+ | `get_stock_actions` | 获取股票分红和拆股历史 |
29
+
30
+ ### 财务报表
31
+
32
+ | 工具 | 描述 |
33
+ |------|-------------|
34
+ | `get_financial_statement` | 获取利润表、资产负债表或现金流量表(年度/季度) |
35
+ | `get_holder_info` | 获取主要股东、机构股东、共同基金或内幕交易信息 |
36
+
37
+ ### 期权数据
38
+
39
+ | 工具 | 描述 |
40
+ |------|-------------|
41
+ | `get_option_expiration_dates` | 获取可用的期权到期日期 |
42
+ | `get_option_chain` | 获取特定到期日期和类型(看涨/看跌)的期权链 |
43
+
44
+ ### 分析师信息
45
+
46
+ | 工具 | 描述 |
47
+ |------|-------------|
48
+ | `get_recommendations` | 获取分析师推荐或评级变更历史 |
49
+
50
+ ## 实际应用场景
51
+
52
+ 使用此 MCP 服务器,您可以利用 Claude 进行:
53
+
54
+ ### 股票分析
55
+
56
+ - **价格分析**:"显示苹果公司过去 6 个月的每日历史股价。"
57
+ - **财务健康**:"获取微软的季度资产负债表。"
58
+ - **业绩指标**:"从股票信息中获取特斯拉的关键财务指标。"
59
+ - **趋势分析**:"比较亚马逊和谷歌的季度利润表。"
60
+ - **现金流分析**:"显示英伟达的年度现金流量表。"
61
+
62
+ ### 市场研究
63
+
64
+ - **新闻分析**:"获取关于 Meta Platforms 的最新新闻文章。"
65
+ - **机构活动**:"显示苹果股票的机构股东。"
66
+ - **内幕交易**:"特斯拉最近的内幕交易有哪些?"
67
+ - **期权分析**:"获取 SPY 在 2024-06-21 到期的看涨期权链。"
68
+ - **分析师覆盖**:"亚马逊过去 3 个月的分析师推荐是什么?"
69
+
70
+ ### 投资研究
71
+
72
+ - "使用微软最新的季度财务报表创建其财务健康状况的全面分析。"
73
+ - "比较可口可乐和百事可乐的分红历史和股票拆分。"
74
+ - "分析特斯拉过去一年的机构所有权变化。"
75
+ - "生成一份关于苹果股票 30 天到期的期权市场活动报告。"
76
+ - "总结过去 6 个月科技行业的最新分析师评级变更。"
77
+
78
+ ## 系统要求
79
+
80
+ - Python 3.11 或更高版本
81
+ - `pyproject.toml` 中列出的依赖项,包括:
82
+ - mcp
83
+ - yfinance
84
+ - pandas
85
+ - pydantic
86
+ - 以及其他数据处理包
87
+
88
+ ## 安装
89
+
90
+ ### 方式 1:从 PyPI 安装(推荐)
91
+
92
+ 最简单的安装方式是直接从 PyPI 安装:
93
+
94
+ ```bash
95
+ pip install yahoo-finance-mcp
96
+ ```
97
+
98
+ ### 方式 2:从源代码安装
99
+
100
+ 1. 克隆此仓库:
101
+ ```bash
102
+ git clone https://github.com/Alex2Yang97/yahoo-finance-mcp.git
103
+ cd yahoo-finance-mcp
104
+ ```
105
+
106
+ 2. 创建并激活虚拟环境,安装依赖:
107
+ ```bash
108
+ uv venv
109
+ source .venv/bin/activate # Windows: .venv\Scripts\activate
110
+ uv pip install -e .
111
+ ```
112
+
113
+ ## 使用方法
114
+
115
+ ### 运行服务器
116
+
117
+ 安装包后,您可以运行服务器:
118
+
119
+ ```bash
120
+ # 如果从 PyPI 安装
121
+ python -m yahoo_finance_mcp.server
122
+
123
+ # 或者如果从源代码安装
124
+ uv run server.py
125
+ ```
126
+
127
+ ### 开发模式
128
+
129
+ 您可以通过运行以下命令使用 MCP Inspector 测试服务器:
130
+
131
+ ```bash
132
+ uv run server.py
133
+ ```
134
+
135
+ 这将启动服务器并允许您测试可用工具。
136
+
137
+ ### 与 Claude Desktop 集成
138
+
139
+ 要将此服务器与 Claude Desktop 集成:
140
+
141
+ 1. 在本地机器上安装 Claude Desktop。
142
+
143
+ 2. 确保已安装 `uv`。如果没有,请安装:
144
+ ```bash
145
+ # macOS/Linux
146
+ curl -LsSf https://astral.sh/uv/install.sh | sh
147
+
148
+ # Windows
149
+ powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
150
+ ```
151
+
152
+ 3. 打开 Claude Desktop 配置文件:
153
+ - MacOS:`~/Library/Application Support/Claude/claude_desktop_config.json`
154
+ - Windows:`%APPDATA%\Claude\claude_desktop_config.json`
155
+
156
+ 4. **方式 A:使用 PyPI 包(推荐)**
157
+
158
+ 添加以下配置:
159
+
160
+ ```json
161
+ {
162
+ "mcpServers": {
163
+ "yfinance": {
164
+ "command": "uvx",
165
+ "args": ["yahoo-finance-mcp"]
166
+ }
167
+ }
168
+ }
169
+ ```
170
+
171
+ 这将自动从 PyPI 下载并运行最新版本。
172
+
173
+ 5. **方式 B:使用本地源代码**
174
+
175
+ 如果您正在开发或想使用本地版本:
176
+
177
+ - macOS/Linux:
178
+ ```json
179
+ {
180
+ "mcpServers": {
181
+ "yfinance": {
182
+ "command": "uv",
183
+ "args": [
184
+ "--directory",
185
+ "/ABSOLUTE/PATH/TO/yahoo-finance-mcp",
186
+ "run",
187
+ "server.py"
188
+ ]
189
+ }
190
+ }
191
+ }
192
+ ```
193
+ - Windows:
194
+ ```json
195
+ {
196
+ "mcpServers": {
197
+ "yfinance": {
198
+ "command": "uv",
199
+ "args": [
200
+ "--directory",
201
+ "C:\\ABSOLUTE\\PATH\\TO\\yahoo-finance-mcp",
202
+ "run",
203
+ "server.py"
204
+ ]
205
+ }
206
+ }
207
+ }
208
+ ```
209
+
210
+ 6. 重启 Claude Desktop
211
+
212
+ ## 许可证
213
+
214
+ MIT
@@ -0,0 +1,155 @@
1
+ # Testing Guide
2
+
3
+ This guide explains how to test the Yahoo Finance MCP server using the MCP Inspector.
4
+
5
+ ## Quick Start
6
+
7
+ ### Windows
8
+ ```bash
9
+ run_inspector.bat
10
+ ```
11
+
12
+ ### macOS/Linux
13
+ ```bash
14
+ ./run_inspector.sh
15
+ ```
16
+
17
+ ### Production Testing (via uvx)
18
+
19
+ If you have published the package or want to test the `uvx` entry point:
20
+
21
+ #### Windows
22
+ ```bash
23
+ run_inspector_prod.bat
24
+ ```
25
+
26
+ #### macOS/Linux
27
+ ```bash
28
+ chmod +x run_inspector_prod.sh
29
+ ./run_inspector_prod.sh
30
+ ```
31
+
32
+ The MCP Inspector will start on **http://localhost:6274**
33
+
34
+ ---
35
+
36
+ ## What is MCP Inspector?
37
+
38
+ MCP Inspector is a web-based tool for testing Model Context Protocol servers. It provides:
39
+ - Interactive UI to call MCP tools
40
+ - Real-time response viewing
41
+ - Parameter input forms
42
+ - Error debugging
43
+
44
+ ---
45
+
46
+ ## Testing Workflow
47
+
48
+ ### 1. Start the Inspector
49
+
50
+ Run the appropriate script for your OS (see Quick Start above).
51
+
52
+ ### 2. Open in Browser
53
+
54
+ Navigate to **http://localhost:6274** in your web browser.
55
+
56
+ ### 3. Test Tools
57
+
58
+ The inspector will show all available tools. Try these tests:
59
+
60
+ #### Test 1: Basic Stock Info
61
+ - Tool: `get_stock_info`
62
+ - Parameters:
63
+ ```json
64
+ {
65
+ "ticker": "AAPL",
66
+ "fields": ["currentPrice", "marketCap", "trailingPE"]
67
+ }
68
+ ```
69
+ - Expected: Only 3 fields returned with cache status
70
+
71
+ #### Test 2: Pagination
72
+ - Tool: `get_historical_stock_prices`
73
+ - Parameters:
74
+ ```json
75
+ {
76
+ "ticker": "AAPL",
77
+ "period": "1mo",
78
+ "interval": "1d",
79
+ "page": 1
80
+ }
81
+ ```
82
+ - Expected: Paginated response with navigation guidance
83
+
84
+ #### Test 3: Cache Behavior
85
+ - Run the same query twice
86
+ - First call: "Fresh data (not cached)"
87
+ - Second call: "Data cached (age: X seconds)"
88
+
89
+ #### Test 4: JSON Export
90
+ - Tool: `get_historical_stock_prices`
91
+ - Parameters:
92
+ ```json
93
+ {
94
+ "ticker": "AAPL",
95
+ "period": "5d",
96
+ "interval": "1d",
97
+ "export_path": "./test_export.json"
98
+ }
99
+ ```
100
+ - Expected: Export success message and file created
101
+
102
+ ---
103
+
104
+ ## Troubleshooting
105
+
106
+ ### Inspector won't start
107
+ - Make sure Node.js is installed: `node --version`
108
+ - Install npx: `npm install -g npx`
109
+ - Check if port 6274 is available
110
+
111
+ ### Server errors
112
+ - Verify Python 3.11+ is installed
113
+ - Install dependencies: `uv sync` or `pip install -e .`
114
+ - Check yfinance is working: `python -c "import yfinance; print(yfinance.__version__)"`
115
+
116
+ ### Browser can't connect
117
+ - Ensure firewall allows localhost:6274
118
+ - Try 127.0.0.1:6274 instead of localhost
119
+ - Check server logs for errors
120
+
121
+ ---
122
+
123
+ ## Advanced Testing
124
+
125
+ ### Test All Tools
126
+
127
+ See [manual_testing_guide.md](C:\Users\SKTelecom\.gemini\antigravity\brain\d0950c1d-b04a-415d-ab2c-bcbdf1b6730e\manual_testing_guide.md) for comprehensive test cases.
128
+
129
+ ### Automated Tests
130
+
131
+ Run unit tests:
132
+ ```bash
133
+ python tests/test_pagination.py
134
+ ```
135
+
136
+ ### Performance Testing
137
+
138
+ Monitor cache hit rates and response times in the inspector output.
139
+
140
+ ---
141
+
142
+ ## Stopping the Inspector
143
+
144
+ Press **Ctrl+C** in the terminal to stop the server.
145
+
146
+ ---
147
+
148
+ ## Next Steps
149
+
150
+ After testing:
151
+ 1. Verify all tools work correctly
152
+ 2. Check pagination appears on large datasets
153
+ 3. Confirm cache behavior
154
+ 4. Test JSON export functionality
155
+ 5. Ready for production use!
Binary file
@@ -0,0 +1,88 @@
1
+ @echo off
2
+ REM Publication script for yfin-mcp (Windows)
3
+ REM This script builds and publishes the package to PyPI using uv
4
+
5
+ echo ========================================
6
+ echo Publishing yfin-mcp to PyPI
7
+ echo ========================================
8
+ echo.
9
+
10
+ REM Version bumping logic
11
+ set BUMP_TYPE=%1
12
+ if "%BUMP_TYPE%"=="major" goto :bump
13
+ if "%BUMP_TYPE%"=="minor" goto :bump
14
+ if "%BUMP_TYPE%"=="patch" goto :bump
15
+ goto :start_build
16
+
17
+ :bump
18
+ echo Step 0: Bumping version (%BUMP_TYPE%)...
19
+ uv run scripts/bump_version.py %BUMP_TYPE%
20
+ if %ERRORLEVEL% neq 0 (
21
+ echo [ERROR] Version bump failed.
22
+ pause
23
+ exit /b %ERRORLEVEL%
24
+ )
25
+ echo.
26
+
27
+ :start_build
28
+ echo Step 1: Cleaning dist directory...
29
+ if exist dist (
30
+ rmdir /s /q dist
31
+ )
32
+
33
+ echo Step 2: Building package...
34
+ uv build
35
+ if %ERRORLEVEL% neq 0 (
36
+ echo.
37
+ echo [ERROR] Build failed. Aborting.
38
+ pause
39
+ exit /b %ERRORLEVEL%
40
+ )
41
+
42
+ echo.
43
+ echo [SUCCESS] Build complete.
44
+ echo.
45
+
46
+ set /p CONFIRM="Do you want to publish to PyPI now? (y/n): "
47
+ if /i "%CONFIRM%" neq "y" (
48
+ echo.
49
+ echo [INFO] Publication cancelled by user.
50
+ exit /b 0
51
+ )
52
+
53
+ echo.
54
+ echo Step 3: Publishing to PyPI via twine...
55
+ echo.
56
+ echo [TIP] PyPI authentication now REQUIRES API tokens.
57
+ echo [TIP] Username: '__token__'
58
+ echo [TIP] Password: 'pypi-YourTokenHere'
59
+ echo.
60
+
61
+ echo [INFO] Installing/Updating twine...
62
+ uv pip install twine
63
+
64
+ echo [INFO] Running twine upload...
65
+ uv run twine upload dist/*
66
+
67
+ if %ERRORLEVEL% neq 0 (
68
+ echo.
69
+ echo [ERROR] Publication failed.
70
+ echo.
71
+ echo [GUIDE] If you're using a token:
72
+ echo - Username: __token__
73
+ echo - Password: pypi-YOUR_TOKEN_STRING
74
+ echo.
75
+ echo [INFO] Current HOME is: %HOME%
76
+ echo [INFO] Current USERPROFILE is: %USERPROFILE%
77
+ echo.
78
+ echo [TIP] Try setting the environment variables to automate:
79
+ echo set TWINE_USERNAME=__token__
80
+ echo set TWINE_PASSWORD=pypi-XXXXXX
81
+ echo ...and run this script again.
82
+ pause
83
+ exit /b %ERRORLEVEL%
84
+ )
85
+
86
+ echo.
87
+ echo [SUCCESS] Package published successfully!
88
+ pause
@@ -0,0 +1,62 @@
1
+ #!/bin/bash
2
+ # Publication script for yfin-mcp (Unix/Linux/macOS)
3
+ # This script builds and publishes the package to PyPI using uv
4
+
5
+ echo "========================================"
6
+ echo "Publishing yfin-mcp to PyPI"
7
+ echo "========================================"
8
+ echo ""
9
+
10
+ # Version bumping logic
11
+ BUMP_TYPE=$1
12
+ if [[ "$BUMP_TYPE" == "major" || "$BUMP_TYPE" == "minor" || "$BUMP_TYPE" == "patch" ]]; then
13
+ echo "Step 0: Bumping version ($BUMP_TYPE)..."
14
+ uv run scripts/bump_version.py $BUMP_TYPE
15
+ if [ $? -ne 0 ]; then
16
+ echo "[ERROR] Version bump failed."
17
+ exit 1
18
+ fi
19
+ echo ""
20
+ fi
21
+
22
+ echo "Step 1: Cleaning dist directory..."
23
+ rm -rf dist/
24
+
25
+ echo "Step 2: Building package..."
26
+ uv build
27
+ if [ $? -ne 0 ]; then
28
+ echo ""
29
+ echo "[ERROR] Build failed. Aborting."
30
+ exit 1
31
+ fi
32
+
33
+ echo ""
34
+ echo "[SUCCESS] Build complete."
35
+ echo ""
36
+
37
+ read -p "Do you want to publish to PyPI now? (y/n): " CONFIRM
38
+ if [[ "$CONFIRM" != "y" ]]; then
39
+ echo ""
40
+ echo "[INFO] Publication cancelled by user."
41
+ exit 0
42
+ fi
43
+
44
+ echo ""
45
+ echo "Step 3: Publishing to PyPI via twine..."
46
+ echo ""
47
+ echo "[TIP] PyPI authentication now REQUIRES API tokens."
48
+ echo "[TIP] Username: '__token__'"
49
+ echo "[TIP] Password: 'pypi-YourTokenHere'"
50
+ echo ""
51
+
52
+ uv pip install twine
53
+ uv run twine upload dist/*
54
+ if [ $? -ne 0 ]; then
55
+ echo ""
56
+ echo "[ERROR] Publication failed."
57
+ echo "[INFO] Make sure your .pypirc is correct or set TWINE_PASSWORD/TWINE_USERNAME variables."
58
+ exit 1
59
+ fi
60
+
61
+ echo ""
62
+ echo "[SUCCESS] Package published successfully!"
@@ -1,10 +1,14 @@
1
1
  [build-system]
2
- requires = ["setuptools>=61.0", "wheel"]
2
+ requires = ["setuptools>=61.0", "setuptools-scm>=8.0"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
+ [tool.setuptools.packages.find]
6
+ where = ["src"]
7
+ include = ["yfin_mcp*"]
8
+
5
9
  [project]
6
10
  name = "yfin-mcp"
7
- version = "0.2.5"
11
+ version = "0.2.8"
8
12
  description = "Enhanced Yahoo Finance MCP Server with intelligent pagination, caching, and LLM-optimized responses"
9
13
  readme = "README.md"
10
14
  requires-python = ">=3.11"
@@ -0,0 +1,13 @@
1
+ @echo off
2
+ REM MCP Inspector Launcher for Windows
3
+ REM This script starts the MCP Inspector to test the Yahoo Finance MCP server
4
+
5
+ echo ========================================
6
+ echo Starting MCP Inspector
7
+ echo ========================================
8
+ echo.
9
+ echo The inspector will start on http://localhost:6274
10
+ echo Press Ctrl+C to stop the server
11
+ echo.
12
+
13
+ npx @modelcontextprotocol/inspector uv --directory . run yfin-mcp