webull-openapi-mcp 1.2.5__tar.gz → 1.2.7__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.
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/PKG-INFO +32 -3
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/README.md +30 -1
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/pyproject.toml +2 -2
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/server.json +2 -2
- webull_openapi_mcp-1.2.7/tests/test_community_tools.py +126 -0
- webull_openapi_mcp-1.2.7/tests/test_fundamental_screener_registration.py +366 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/test_fundamental_tools.py +91 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/test_guards.py +114 -1
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/test_instrument_tools.py +18 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/test_market_data_tools.py +43 -55
- webull_openapi_mcp-1.2.7/tests/test_news_tools.py +52 -0
- webull_openapi_mcp-1.2.7/tests/test_order_history_tool.py +96 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/test_property_server.py +185 -2
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/test_screener_tools.py +74 -47
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/__init__.py +1 -1
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/errors.py +51 -14
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/formatters.py +337 -62
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/guards.py +193 -27
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/region_config.py +18 -10
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/server.py +17 -2
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/__init__.py +4 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/market_data/__init__.py +2 -0
- webull_openapi_mcp-1.2.7/webull_openapi_mcp/tools/market_data/community.py +195 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/market_data/crypto.py +14 -2
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/market_data/event.py +11 -1
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/market_data/fundamental.py +217 -8
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/market_data/futures.py +11 -1
- webull_openapi_mcp-1.2.7/webull_openapi_mcp/tools/market_data/news.py +122 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/market_data/option.py +43 -6
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/market_data/screener.py +88 -45
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/market_data/stock.py +2 -2
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/trading/account.py +7 -4
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/trading/assets.py +12 -12
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/trading/instrument.py +125 -54
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/trading/option_order.py +64 -4
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/trading/order.py +46 -31
- webull_openapi_mcp-1.2.5/tests/test_fundamental_screener_registration.py +0 -213
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/.env.example +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/.github/workflows/pypi-ci.yml +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/.gitignore +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/DISCLAIMER.md +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/LICENSE +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/mcpb/.mcpbignore +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/mcpb/build.sh +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/mcpb/build_manifest.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/mcpb/src/server.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/__init__.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/test_account_tools.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/test_audit.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/test_cli.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/test_config.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/test_errors.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/test_formatters.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/test_property_audit.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/test_property_config.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/test_property_formatters.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/test_property_guards.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/test_property_sdk.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/test_sdk_client.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/tests/test_stock_order_tools.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/__main__.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/audit.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/cli.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/config.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/constants.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/sdk_client.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/market_data/financial.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/market_data/watchlist.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/trading/__init__.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/trading/crypto_order.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/trading/event_order.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/trading/futures_order.py +0 -0
- {webull_openapi_mcp-1.2.5 → webull_openapi_mcp-1.2.7}/webull_openapi_mcp/tools/trading/stock_order.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: webull-openapi-mcp
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.7
|
|
4
4
|
Summary: MCP Server for Webull OpenAPI - enables AI assistants to securely access Webull trading and market data
|
|
5
5
|
Project-URL: Homepage, https://github.com/webull-inc/webull-openapi-mcp
|
|
6
6
|
Project-URL: Repository, https://github.com/webull-inc/webull-openapi-mcp
|
|
@@ -20,7 +20,7 @@ Requires-Python: <3.13,>=3.10
|
|
|
20
20
|
Requires-Dist: click
|
|
21
21
|
Requires-Dist: fastmcp==3.0.2
|
|
22
22
|
Requires-Dist: python-dotenv
|
|
23
|
-
Requires-Dist: webull-openapi-python-sdk==3.0.
|
|
23
|
+
Requires-Dist: webull-openapi-python-sdk==3.0.4
|
|
24
24
|
Provides-Extra: dev
|
|
25
25
|
Requires-Dist: hypothesis; extra == 'dev'
|
|
26
26
|
Requires-Dist: pytest; extra == 'dev'
|
|
@@ -54,6 +54,7 @@ See [DISCLAIMER.md](DISCLAIMER.md) for the full disclaimer.
|
|
|
54
54
|
- **NOII Data** — Net Order Imbalance Indicator bars and snapshots for US stock opening/closing auctions
|
|
55
55
|
- **Screener** — Top gainers/losers, most active, market sectors, high dividend, and 52-week high/low rankings
|
|
56
56
|
- **Watchlist** — Create, manage, and query user watchlists and instruments
|
|
57
|
+
- **Community** (US only) — Create posts and comments, list hot stocks, browse posts by symbol, view post details, and list your own posts
|
|
57
58
|
- **Fundamental Data** — Company profiles, analyst ratings, and target prices
|
|
58
59
|
- **Stock & Fund Fundamentals** — Capital flow, SEC filings, earnings/dividend calendar, forecast EPS, industry comparison, and full fund data (rating, performance, allocation, holdings, brief, dividends, splits, net value, files)
|
|
59
60
|
- **Financial Statements** — Financial alert, indicators, income statement, balance sheet, and cash flow
|
|
@@ -93,6 +94,12 @@ Here are some prompts you can use with your AI assistant:
|
|
|
93
94
|
- Add AAPL and MSFT to my watchlist
|
|
94
95
|
- What stocks are in my watchlist?
|
|
95
96
|
|
|
97
|
+
**Community**
|
|
98
|
+
- What are the community hot stocks right now?
|
|
99
|
+
- Show me recent community posts about NVDA
|
|
100
|
+
- Post "Great earnings report!" tagged with AAPL
|
|
101
|
+
- List my community posts
|
|
102
|
+
|
|
96
103
|
**Fundamental & Analyst**
|
|
97
104
|
- Tell me about NVDA's company profile
|
|
98
105
|
- What do analysts rate AAPL?
|
|
@@ -333,8 +340,11 @@ See [.env.example](.env.example) for full configuration template.
|
|
|
333
340
|
| **Crypto** | `get_crypto_snapshot`, `get_crypto_bars` | US |
|
|
334
341
|
| **Option** | `get_option_tick`, `get_option_snapshot`, `get_option_bars` | US, HK, JP |
|
|
335
342
|
| **Event** | `get_event_tick`, `get_event_snapshot`, `get_event_depth`, `get_event_bars` | US |
|
|
343
|
+
| **Market Insights** | `get_market_sentiment`, `get_stock_unusual_activities`, `get_institution_identifier`, `get_institution_holdings`, `get_institution_holding_changes`, `get_insider_transactions`, `get_insider_holdings`, `get_macroeconomic_calendar` | US |
|
|
344
|
+
| **News** | `search_news`, `get_news_detail`, `get_stock_news` | US |
|
|
336
345
|
| **Screener** | `get_gainers_losers`, `get_most_active`, `get_market_sectors`, `get_market_sectors_detail`, `get_high_dividend`, `get_52_week_high_low` | All |
|
|
337
346
|
| **Watchlist** | `get_watchlists`, `create_watchlist`, `update_watchlist`, `delete_watchlist`, `get_watchlist_instruments`, `add_watchlist_instruments`, `remove_watchlist_instruments`, `update_watchlist_instruments` | All |
|
|
347
|
+
| **Community** | `create_community_post`, `create_community_comment`, `get_community_hot_stocks`, `get_community_posts`, `get_community_post_detail`, `get_my_community_posts` | US |
|
|
338
348
|
|
|
339
349
|
### Fundamental & Instrument
|
|
340
350
|
|
|
@@ -424,6 +434,24 @@ All commands accept `--env-file PATH` to specify a custom `.env` file location (
|
|
|
424
434
|
|
|
425
435
|
---
|
|
426
436
|
|
|
437
|
+
## Migration Notes (1.2.7)
|
|
438
|
+
|
|
439
|
+
This release moves the tool calls to the latest API paths and removes the old paging parameters without a compatibility layer. Clients that still send a removed parameter get a validation error (unexpected argument).
|
|
440
|
+
|
|
441
|
+
| Tool | Removed parameters | Use instead |
|
|
442
|
+
|------|--------------------|-------------|
|
|
443
|
+
| `get_instruments`, `get_crypto_instruments`, `get_event_instruments` | `page_size`, `last_instrument_id` | `pagination_key` |
|
|
444
|
+
| `get_event_series` | `page_size`, `last_series_id` | `pagination_key` |
|
|
445
|
+
| `get_market_sectors`, `get_market_sectors_detail`, `get_fund_dividends` | `page_size`, `page_index` | `pagination_key` |
|
|
446
|
+
| `get_gainers_losers`, `get_most_active`, `get_high_dividend`, `get_52_week_high_low` | `page_size`, `page_index` | None. These endpoints return a single result set without paging |
|
|
447
|
+
|
|
448
|
+
Paged tools print `Next pagination_key: ...` when more data is available. Pass that value as `pagination_key` to get the next page; the last page has no key.
|
|
449
|
+
|
|
450
|
+
Other changes:
|
|
451
|
+
|
|
452
|
+
- `get_option_bars`, `get_futures_bars`, `get_crypto_bars` and `get_event_bars` accept optional `start_time` and `end_time` (milliseconds).
|
|
453
|
+
- `get_stock_bars_single` now calls the batch bars endpoint, and the output groups rows under a `--- SYMBOL ---` header.
|
|
454
|
+
|
|
427
455
|
## Security
|
|
428
456
|
|
|
429
457
|
- **Never share your AK/SK with AI models** — Do not paste your App Key or App Secret into chat prompts, AI assistants, or any LLM conversation. These credentials should only be configured via environment variables or `.env` files, never exposed in plain text to the model.
|
|
@@ -432,7 +460,7 @@ All commands accept `--env-file PATH` to specify a custom `.env` file location (
|
|
|
432
460
|
- **Review before trading** — Always review order details proposed by the AI before confirming. Use `preview_stock_order` / `preview_option_order` before placing orders.
|
|
433
461
|
- **Use toolset filtering** — Set `WEBULL_TOOLSETS=account,market-data` to disable trading tools entirely if you only need read-only access. Valid toolsets: `account`, `market-data`, `trading`, `instrument`.
|
|
434
462
|
- **Default sandbox** — The server defaults to UAT (sandbox) environment. You must explicitly set `WEBULL_ENVIRONMENT=prod` for live trading.
|
|
435
|
-
- **Dependency security** — `fastmcp` is pinned to version `3.0.2` and `webull-openapi-python-sdk` is pinned to `3.0.
|
|
463
|
+
- **Dependency security** — `fastmcp` is pinned to version `3.0.2` and `webull-openapi-python-sdk` is pinned to `3.0.4`. Users are responsible for monitoring and updating third-party dependencies for security patches. Review release notes before upgrading.
|
|
436
464
|
|
|
437
465
|
---
|
|
438
466
|
|
|
@@ -528,6 +556,7 @@ webull-openapi-mcp/
|
|
|
528
556
|
│ │ ├── event.py # Event contract market data
|
|
529
557
|
│ │ ├── screener.py # Gainers/losers, most active, market sectors, high dividend, 52-week high/low
|
|
530
558
|
│ │ ├── watchlist.py# Watchlist CRUD and instrument management
|
|
559
|
+
│ │ ├── community.py # Community posts, comments, hot stocks
|
|
531
560
|
│ │ ├── fundamental.py # Company profile, analyst data; stock & fund fundamentals (US/HK/JP)
|
|
532
561
|
│ │ └── financial.py # Financial statements: alert, indicators, income, balance sheet, cash flow (US/HK/JP)
|
|
533
562
|
│ └── trading/
|
|
@@ -24,6 +24,7 @@ See [DISCLAIMER.md](DISCLAIMER.md) for the full disclaimer.
|
|
|
24
24
|
- **NOII Data** — Net Order Imbalance Indicator bars and snapshots for US stock opening/closing auctions
|
|
25
25
|
- **Screener** — Top gainers/losers, most active, market sectors, high dividend, and 52-week high/low rankings
|
|
26
26
|
- **Watchlist** — Create, manage, and query user watchlists and instruments
|
|
27
|
+
- **Community** (US only) — Create posts and comments, list hot stocks, browse posts by symbol, view post details, and list your own posts
|
|
27
28
|
- **Fundamental Data** — Company profiles, analyst ratings, and target prices
|
|
28
29
|
- **Stock & Fund Fundamentals** — Capital flow, SEC filings, earnings/dividend calendar, forecast EPS, industry comparison, and full fund data (rating, performance, allocation, holdings, brief, dividends, splits, net value, files)
|
|
29
30
|
- **Financial Statements** — Financial alert, indicators, income statement, balance sheet, and cash flow
|
|
@@ -63,6 +64,12 @@ Here are some prompts you can use with your AI assistant:
|
|
|
63
64
|
- Add AAPL and MSFT to my watchlist
|
|
64
65
|
- What stocks are in my watchlist?
|
|
65
66
|
|
|
67
|
+
**Community**
|
|
68
|
+
- What are the community hot stocks right now?
|
|
69
|
+
- Show me recent community posts about NVDA
|
|
70
|
+
- Post "Great earnings report!" tagged with AAPL
|
|
71
|
+
- List my community posts
|
|
72
|
+
|
|
66
73
|
**Fundamental & Analyst**
|
|
67
74
|
- Tell me about NVDA's company profile
|
|
68
75
|
- What do analysts rate AAPL?
|
|
@@ -303,8 +310,11 @@ See [.env.example](.env.example) for full configuration template.
|
|
|
303
310
|
| **Crypto** | `get_crypto_snapshot`, `get_crypto_bars` | US |
|
|
304
311
|
| **Option** | `get_option_tick`, `get_option_snapshot`, `get_option_bars` | US, HK, JP |
|
|
305
312
|
| **Event** | `get_event_tick`, `get_event_snapshot`, `get_event_depth`, `get_event_bars` | US |
|
|
313
|
+
| **Market Insights** | `get_market_sentiment`, `get_stock_unusual_activities`, `get_institution_identifier`, `get_institution_holdings`, `get_institution_holding_changes`, `get_insider_transactions`, `get_insider_holdings`, `get_macroeconomic_calendar` | US |
|
|
314
|
+
| **News** | `search_news`, `get_news_detail`, `get_stock_news` | US |
|
|
306
315
|
| **Screener** | `get_gainers_losers`, `get_most_active`, `get_market_sectors`, `get_market_sectors_detail`, `get_high_dividend`, `get_52_week_high_low` | All |
|
|
307
316
|
| **Watchlist** | `get_watchlists`, `create_watchlist`, `update_watchlist`, `delete_watchlist`, `get_watchlist_instruments`, `add_watchlist_instruments`, `remove_watchlist_instruments`, `update_watchlist_instruments` | All |
|
|
317
|
+
| **Community** | `create_community_post`, `create_community_comment`, `get_community_hot_stocks`, `get_community_posts`, `get_community_post_detail`, `get_my_community_posts` | US |
|
|
308
318
|
|
|
309
319
|
### Fundamental & Instrument
|
|
310
320
|
|
|
@@ -394,6 +404,24 @@ All commands accept `--env-file PATH` to specify a custom `.env` file location (
|
|
|
394
404
|
|
|
395
405
|
---
|
|
396
406
|
|
|
407
|
+
## Migration Notes (1.2.7)
|
|
408
|
+
|
|
409
|
+
This release moves the tool calls to the latest API paths and removes the old paging parameters without a compatibility layer. Clients that still send a removed parameter get a validation error (unexpected argument).
|
|
410
|
+
|
|
411
|
+
| Tool | Removed parameters | Use instead |
|
|
412
|
+
|------|--------------------|-------------|
|
|
413
|
+
| `get_instruments`, `get_crypto_instruments`, `get_event_instruments` | `page_size`, `last_instrument_id` | `pagination_key` |
|
|
414
|
+
| `get_event_series` | `page_size`, `last_series_id` | `pagination_key` |
|
|
415
|
+
| `get_market_sectors`, `get_market_sectors_detail`, `get_fund_dividends` | `page_size`, `page_index` | `pagination_key` |
|
|
416
|
+
| `get_gainers_losers`, `get_most_active`, `get_high_dividend`, `get_52_week_high_low` | `page_size`, `page_index` | None. These endpoints return a single result set without paging |
|
|
417
|
+
|
|
418
|
+
Paged tools print `Next pagination_key: ...` when more data is available. Pass that value as `pagination_key` to get the next page; the last page has no key.
|
|
419
|
+
|
|
420
|
+
Other changes:
|
|
421
|
+
|
|
422
|
+
- `get_option_bars`, `get_futures_bars`, `get_crypto_bars` and `get_event_bars` accept optional `start_time` and `end_time` (milliseconds).
|
|
423
|
+
- `get_stock_bars_single` now calls the batch bars endpoint, and the output groups rows under a `--- SYMBOL ---` header.
|
|
424
|
+
|
|
397
425
|
## Security
|
|
398
426
|
|
|
399
427
|
- **Never share your AK/SK with AI models** — Do not paste your App Key or App Secret into chat prompts, AI assistants, or any LLM conversation. These credentials should only be configured via environment variables or `.env` files, never exposed in plain text to the model.
|
|
@@ -402,7 +430,7 @@ All commands accept `--env-file PATH` to specify a custom `.env` file location (
|
|
|
402
430
|
- **Review before trading** — Always review order details proposed by the AI before confirming. Use `preview_stock_order` / `preview_option_order` before placing orders.
|
|
403
431
|
- **Use toolset filtering** — Set `WEBULL_TOOLSETS=account,market-data` to disable trading tools entirely if you only need read-only access. Valid toolsets: `account`, `market-data`, `trading`, `instrument`.
|
|
404
432
|
- **Default sandbox** — The server defaults to UAT (sandbox) environment. You must explicitly set `WEBULL_ENVIRONMENT=prod` for live trading.
|
|
405
|
-
- **Dependency security** — `fastmcp` is pinned to version `3.0.2` and `webull-openapi-python-sdk` is pinned to `3.0.
|
|
433
|
+
- **Dependency security** — `fastmcp` is pinned to version `3.0.2` and `webull-openapi-python-sdk` is pinned to `3.0.4`. Users are responsible for monitoring and updating third-party dependencies for security patches. Review release notes before upgrading.
|
|
406
434
|
|
|
407
435
|
---
|
|
408
436
|
|
|
@@ -498,6 +526,7 @@ webull-openapi-mcp/
|
|
|
498
526
|
│ │ ├── event.py # Event contract market data
|
|
499
527
|
│ │ ├── screener.py # Gainers/losers, most active, market sectors, high dividend, 52-week high/low
|
|
500
528
|
│ │ ├── watchlist.py# Watchlist CRUD and instrument management
|
|
529
|
+
│ │ ├── community.py # Community posts, comments, hot stocks
|
|
501
530
|
│ │ ├── fundamental.py # Company profile, analyst data; stock & fund fundamentals (US/HK/JP)
|
|
502
531
|
│ │ └── financial.py # Financial statements: alert, indicators, income, balance sheet, cash flow (US/HK/JP)
|
|
503
532
|
│ └── trading/
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "webull-openapi-mcp"
|
|
7
|
-
version = "1.2.
|
|
7
|
+
version = "1.2.7"
|
|
8
8
|
description = "MCP Server for Webull OpenAPI - enables AI assistants to securely access Webull trading and market data"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "Apache-2.0"
|
|
@@ -24,7 +24,7 @@ dependencies = [
|
|
|
24
24
|
"fastmcp==3.0.2",
|
|
25
25
|
"click",
|
|
26
26
|
"python-dotenv",
|
|
27
|
-
"webull-openapi-python-sdk==3.0.
|
|
27
|
+
"webull-openapi-python-sdk==3.0.4",
|
|
28
28
|
]
|
|
29
29
|
|
|
30
30
|
[project.urls]
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "io.github.webull-inc/webull-openapi-mcp",
|
|
4
4
|
"title": "Webull OpenAPI",
|
|
5
5
|
"description": "MCP server for Webull OpenAPI: trading and market data access for AI assistants",
|
|
6
|
-
"version": "1.2.
|
|
6
|
+
"version": "1.2.7",
|
|
7
7
|
"repository": {
|
|
8
8
|
"url": "https://github.com/webull-inc/webull-openapi-mcp",
|
|
9
9
|
"source": "github"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"registryType": "pypi",
|
|
14
14
|
"registryBaseUrl": "https://pypi.org",
|
|
15
15
|
"identifier": "webull-openapi-mcp",
|
|
16
|
-
"version": "1.2.
|
|
16
|
+
"version": "1.2.7",
|
|
17
17
|
"runtimeHint": "uvx",
|
|
18
18
|
"transport": {
|
|
19
19
|
"type": "stdio"
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"""Unit tests for community formatters (posts, comments, hot stocks)."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import pytest
|
|
6
|
+
|
|
7
|
+
from webull_openapi_mcp.formatters import (
|
|
8
|
+
format_community_create_result,
|
|
9
|
+
format_community_hot_stocks,
|
|
10
|
+
format_community_post_detail,
|
|
11
|
+
format_community_post_list,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
_NO_DATA = "No data available."
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# ---------------------------------------------------------------------------
|
|
19
|
+
# Empty / None data handling
|
|
20
|
+
# ---------------------------------------------------------------------------
|
|
21
|
+
|
|
22
|
+
@pytest.mark.parametrize("fn", [
|
|
23
|
+
format_community_hot_stocks,
|
|
24
|
+
format_community_post_list,
|
|
25
|
+
format_community_post_detail,
|
|
26
|
+
])
|
|
27
|
+
def test_returns_no_data_for_none(fn):
|
|
28
|
+
assert fn(None) == _NO_DATA
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@pytest.mark.parametrize("fn", [
|
|
32
|
+
format_community_hot_stocks,
|
|
33
|
+
format_community_post_list,
|
|
34
|
+
])
|
|
35
|
+
def test_returns_no_data_for_empty_list(fn):
|
|
36
|
+
assert fn([]) == _NO_DATA
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
# ---------------------------------------------------------------------------
|
|
40
|
+
# Create result (post / comment)
|
|
41
|
+
# ---------------------------------------------------------------------------
|
|
42
|
+
|
|
43
|
+
class TestFormatCreateResult:
|
|
44
|
+
def test_formats_post_id(self):
|
|
45
|
+
out = format_community_create_result({"post_id": "995005758239301632"})
|
|
46
|
+
assert "Post ID: 995005758239301632" in out
|
|
47
|
+
|
|
48
|
+
def test_formats_comment_id(self):
|
|
49
|
+
out = format_community_create_result({"comment_id": "123456"})
|
|
50
|
+
assert "Comment ID: 123456" in out
|
|
51
|
+
|
|
52
|
+
def test_handles_unexpected_shape(self):
|
|
53
|
+
# Non-dict / empty still produces a safe message rather than crashing.
|
|
54
|
+
assert format_community_create_result(None) == "Operation completed."
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# ---------------------------------------------------------------------------
|
|
58
|
+
# Hot stocks
|
|
59
|
+
# ---------------------------------------------------------------------------
|
|
60
|
+
|
|
61
|
+
class TestFormatHotStocks:
|
|
62
|
+
def test_formats_ranking(self):
|
|
63
|
+
data = {"data": [
|
|
64
|
+
{"rank": 1, "symbol": "NVDA", "category": "US_STOCK"},
|
|
65
|
+
{"rank": 2, "symbol": "AAPL", "category": "US_STOCK"},
|
|
66
|
+
]}
|
|
67
|
+
out = format_community_hot_stocks(data)
|
|
68
|
+
assert "Community Hot Stocks" in out
|
|
69
|
+
assert "#1 NVDA (US_STOCK)" in out
|
|
70
|
+
assert "#2 AAPL (US_STOCK)" in out
|
|
71
|
+
|
|
72
|
+
def test_accepts_bare_list(self):
|
|
73
|
+
out = format_community_hot_stocks([{"rank": 1, "symbol": "TSLA", "category": "US_STOCK"}])
|
|
74
|
+
assert "TSLA" in out
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
# ---------------------------------------------------------------------------
|
|
78
|
+
# Post list (by symbol / my posts)
|
|
79
|
+
# ---------------------------------------------------------------------------
|
|
80
|
+
|
|
81
|
+
class TestFormatPostList:
|
|
82
|
+
def test_formats_posts_and_pagination(self):
|
|
83
|
+
data = {
|
|
84
|
+
"data": [
|
|
85
|
+
{"post_id": "1", "text": "hello", "publish_time": "2026-10-20",
|
|
86
|
+
"thumbs": 3, "comments": 1},
|
|
87
|
+
],
|
|
88
|
+
"pagination_key": "cursor-abc",
|
|
89
|
+
}
|
|
90
|
+
out = format_community_post_list(data, title="Posts by Symbol")
|
|
91
|
+
assert "Community Posts by Symbol" in out
|
|
92
|
+
assert "Post ID: 1" in out
|
|
93
|
+
assert "pagination_key=cursor-abc" in out
|
|
94
|
+
|
|
95
|
+
def test_no_pagination_hint_when_absent(self):
|
|
96
|
+
data = {"data": [{"post_id": "1", "text": "hi", "publish_time": "t",
|
|
97
|
+
"thumbs": 0, "comments": 0}]}
|
|
98
|
+
out = format_community_post_list(data, title="My Posts")
|
|
99
|
+
assert "pagination_key" not in out
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
# ---------------------------------------------------------------------------
|
|
103
|
+
# Post detail
|
|
104
|
+
# ---------------------------------------------------------------------------
|
|
105
|
+
|
|
106
|
+
class TestFormatPostDetail:
|
|
107
|
+
def test_formats_detail_with_tickers(self):
|
|
108
|
+
data = {
|
|
109
|
+
"post_id": "995",
|
|
110
|
+
"text": "great earnings",
|
|
111
|
+
"publish_time": "2026-10-20",
|
|
112
|
+
"thumbs": 10,
|
|
113
|
+
"comments": 4,
|
|
114
|
+
"tickers": [{"symbol": "NVDA", "category": "US_STOCK"}],
|
|
115
|
+
}
|
|
116
|
+
out = format_community_post_detail(data)
|
|
117
|
+
assert "Community Post Detail" in out
|
|
118
|
+
assert "Post ID: 995" in out
|
|
119
|
+
assert "NVDA (US_STOCK)" in out
|
|
120
|
+
|
|
121
|
+
def test_formats_detail_without_tickers(self):
|
|
122
|
+
data = {"post_id": "1", "text": "x", "publish_time": "t",
|
|
123
|
+
"thumbs": 0, "comments": 0}
|
|
124
|
+
out = format_community_post_detail(data)
|
|
125
|
+
assert "Post ID: 1" in out
|
|
126
|
+
assert "Tickers:" not in out
|