openboost-cli 2.0.1__tar.gz → 2.1.0__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.
- {openboost_cli-2.0.1/src/openboost_cli.egg-info → openboost_cli-2.1.0}/PKG-INFO +24 -4
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/README.md +22 -2
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/pyproject.toml +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/__init__.py +10 -6
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/cli/main.py +160 -14
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/client.py +19 -1
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/mcp_client.py +19 -19
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/parse_result.py +17 -2
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/registry.py +29 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/account/__init__.py +1 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/account/account_catalog.json +17 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/account/account_info.json +8 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/account/account_links.json +8 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/account/account_order_create.json +20 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/account/account_order_status.json +16 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/account/account_orders.json +17 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_aba_research_trends.json +26 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_aba_research_weekly.json +132 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/amazon/amz_category_query.json +4 -4
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_category_query_v2.json +28 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_google_trends.json +26 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_hot_amz_hot_cat_tree.json +25 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_hot_amz_hot_list_v2.json +33 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_keyword_miner.json +152 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_keyword_order.json +46 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_keyword_research.json +148 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_keyword_research_trends.json +21 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_market_brand.json +33 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_market_goods.json +37 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_market_price.json +33 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_market_rating.json +33 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_market_ratings.json +33 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_market_research.json +260 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_market_seller.json +33 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_market_seller_location.json +29 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_market_seller_type.json +29 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_market_shelf_time.json +33 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_market_shelf_trend.json +33 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_market_statistics.json +36 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_product_competitor.json +68 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_product_selection.json +228 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_research_monthly.json +132 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/amazon/amz_review_query.json +4 -4
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_sales_prediction_bsr.json +26 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/amazon/amz_sales_query.json +4 -4
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_sku_query.json +20 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_traffic_extend.json +153 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_traffic_keyword.json +157 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_traffic_keyword_stat.json +25 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_traffic_listing_page.json +46 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_traffic_listing_stat.json +21 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/amazon/amz_traffic_source.json +41 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/patent/patent_abstract_image.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/patent/patent_abstract_translated.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/patent/patent_bibliography.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/patent/patent_claim_data.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/patent/patent_claim_translated.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/patent/patent_description.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/patent/patent_description_translated.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/patent/patent_family.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/patent/patent_fulltext_image.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/patent/patent_image_search_multiple.json +9 -6
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/patent/patent_image_search_single.json +9 -6
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/patent/patent_legal_status.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/patent/patent_pdf.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/patent/patent_query_count.json +8 -5
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/patent/patent_query_search.json +8 -5
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/patent/patent_query_search_with_agg.json +8 -5
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/patent/patent_semantic_search.json +8 -5
- openboost_cli-2.1.0/src/openboost_cli/schemas/social/__init__.py +1 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/social/instagram_fetch_hashtag_posts.json +21 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/social/instagram_fetch_post_comments.json +20 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/social/instagram_fetch_post_info.json +20 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/social/instagram_fetch_reel_info.json +16 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/social/instagram_fetch_user_info.json +20 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/social/instagram_fetch_user_reels.json +21 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/social/reddit_fetch_post_comments.json +24 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/social/reddit_fetch_post_details.json +20 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/social/youtube_fetch_post_comments.json +25 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/social/youtube_fetch_post_info.json +20 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/social/youtube_fetch_user_info.json +20 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tk_expert_sale_show.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_commodity_detail.json +4 -4
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_commodity_expert_draw_expert_trend.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_commodity_get_commodity_cat_tree.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_commodity_info_list.json +10 -10
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_commodity_sales_trend.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_commodity_statistics_get_category_statistics.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_commodity_statistics_get_expert_statistics.json +3 -3
- openboost_cli-2.1.0/src/openboost_cli/schemas/tiktok/tt_commodity_statistics_get_price_statistics.json +28 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_commodity_statistics_get_total_statistics.json +9 -5
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_commodity_voice_analyze.json +3 -3
- openboost_cli-2.1.0/src/openboost_cli/schemas/tiktok/tt_commodity_voice_read.json +41 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_expert_basic_analyze.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_expert_category_analyze.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_expert_detail.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_expert_fans_analyze.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_expert_fans_portrait.json +3 -3
- openboost_cli-2.1.0/src/openboost_cli/schemas/tiktok/tt_expert_info_list.json +176 -0
- openboost_cli-2.1.0/src/openboost_cli/schemas/tiktok/tt_hashtag_list.json +48 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_shop_commodity_account_list.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_shop_detail.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_shop_info_list.json +3 -3
- openboost_cli-2.1.0/src/openboost_cli/schemas/tiktok/tt_shop_market_info.json +28 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_shop_sales_trend.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_video_content.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_video_detail.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_video_info_list.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_video_new_video_summary.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_video_script_diy_query.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_video_voice_read.json +4 -4
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/tt_video_voice_summary.json +3 -3
- {openboost_cli-2.0.1 → openboost_cli-2.1.0/src/openboost_cli.egg-info}/PKG-INFO +24 -4
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli.egg-info/SOURCES.txt +50 -2
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/tests/test_cli.py +54 -2
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/tests/test_config.py +12 -11
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/tests/test_mcp_client.py +51 -33
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/tests/test_schemas_and_parsing.py +18 -2
- openboost_cli-2.0.1/src/openboost_cli/schemas/amazon/amz_hot_amz_hot_cat_tree.json +0 -25
- openboost_cli-2.0.1/src/openboost_cli/schemas/amazon/amz_hot_amz_hot_list.json +0 -33
- openboost_cli-2.0.1/src/openboost_cli/schemas/amazon/amz_market_price.json +0 -28
- openboost_cli-2.0.1/src/openboost_cli/schemas/amazon/amz_product_selection.json +0 -140
- openboost_cli-2.0.1/src/openboost_cli/schemas/amazon/amz_sku_query.json +0 -20
- openboost_cli-2.0.1/src/openboost_cli/schemas/tiktok/tt_commodity_statistics_get_price_statistics.json +0 -28
- openboost_cli-2.0.1/src/openboost_cli/schemas/tiktok/tt_expert_info_list.json +0 -180
- openboost_cli-2.0.1/src/openboost_cli/schemas/tiktok/tt_sale_channel_sale_channel.json +0 -26
- openboost_cli-2.0.1/src/openboost_cli/schemas/tiktok/tt_shop_market_info.json +0 -28
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/LICENSE +0 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/setup.cfg +0 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/cli/__init__.py +0 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/cli/interactive.py +0 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/coerce_args.py +0 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/config.py +0 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/__init__.py +0 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/amazon/__init__.py +0 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/patent/__init__.py +0 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas/tiktok/__init__.py +0 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli/schemas_loader.py +0 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli.egg-info/dependency_links.txt +0 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli.egg-info/entry_points.txt +0 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli.egg-info/requires.txt +0 -0
- {openboost_cli-2.0.1 → openboost_cli-2.1.0}/src/openboost_cli.egg-info/top_level.txt +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: openboost-cli
|
|
3
|
-
Version: 2.0
|
|
4
|
-
Summary: Unified CLI and Python client for OpenBoost TikTok, Patent, and
|
|
3
|
+
Version: 2.1.0
|
|
4
|
+
Summary: Unified CLI and Python client for OpenBoost TikTok, Patent, Amazon, Social, and Account MCP tools.
|
|
5
5
|
Author: OpenBoost CLI
|
|
6
6
|
License-Expression: MIT
|
|
7
|
-
Keywords: mcp,cli,openboost,tiktok,patent,amazon
|
|
7
|
+
Keywords: mcp,cli,openboost,tiktok,patent,amazon,social
|
|
8
8
|
Classifier: Environment :: Console
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -22,7 +22,11 @@ Dynamic: license-file
|
|
|
22
22
|
|
|
23
23
|
# openboost-cli
|
|
24
24
|
|
|
25
|
-
OpenBoost MCP 的统一命令行工具和 Python 客户端,支持 TikTok、Patent
|
|
25
|
+
OpenBoost MCP 的统一命令行工具和 Python 客户端,支持 TikTok、Patent、Amazon、Social 四类业务工具,以及账号、套餐和订单工具。
|
|
26
|
+
|
|
27
|
+
- 业务工具:TikTok 31、Patent 17、Amazon 36、Social 11,共 95 个
|
|
28
|
+
- 账号工具:6 个
|
|
29
|
+
- 合计:101 个工具
|
|
26
30
|
|
|
27
31
|
- PyPI 包名:`openboost-cli`
|
|
28
32
|
- 命令行入口:`openboost`
|
|
@@ -73,9 +77,13 @@ OPENBOOST_SECRET_KEY
|
|
|
73
77
|
OPENBOOST_TIKTOK_SECRET_KEY
|
|
74
78
|
OPENBOOST_PATENT_SECRET_KEY
|
|
75
79
|
OPENBOOST_AMAZON_SECRET_KEY
|
|
80
|
+
OPENBOOST_SOCIAL_SECRET_KEY
|
|
81
|
+
OPENBOOST_ACCOUNT_SECRET_KEY
|
|
76
82
|
OPENBOOST_TIKTOK_BASE_URL
|
|
77
83
|
OPENBOOST_PATENT_BASE_URL
|
|
78
84
|
OPENBOOST_AMAZON_BASE_URL
|
|
85
|
+
OPENBOOST_SOCIAL_BASE_URL
|
|
86
|
+
OPENBOOST_ACCOUNT_BASE_URL
|
|
79
87
|
```
|
|
80
88
|
|
|
81
89
|
密钥也可仅对一次调用通过顶层 `--key` 参数提供。不要将密钥提交到代码仓库。
|
|
@@ -101,6 +109,8 @@ openboost docs tiktok tt_commodity_info_list
|
|
|
101
109
|
openboost tiktok commodity category-tree
|
|
102
110
|
openboost patent search count "TACD: virtual reality"
|
|
103
111
|
openboost amazon hot cat-tree --site 1 --rank-type "Best Seller"
|
|
112
|
+
openboost social youtube post-info "video-id"
|
|
113
|
+
openboost account info
|
|
104
114
|
```
|
|
105
115
|
|
|
106
116
|
使用通用调用命令:
|
|
@@ -143,6 +153,9 @@ patents = client.patent.patent_query_search(
|
|
|
143
153
|
query_text="TACD: virtual reality",
|
|
144
154
|
limit=10,
|
|
145
155
|
)
|
|
156
|
+
|
|
157
|
+
video = client.social.youtube_fetch_post_info(media_id="video-id")
|
|
158
|
+
account = client.account.account_info()
|
|
146
159
|
```
|
|
147
160
|
|
|
148
161
|
也可以按名称取得某个 MCP 客户端:
|
|
@@ -163,6 +176,13 @@ uv run pytest
|
|
|
163
176
|
uv build
|
|
164
177
|
```
|
|
165
178
|
|
|
179
|
+
维护者可使用具有完整权限的密钥从统一 MCP 同步公开工具元数据和参数 Schema。脚本不会保存或输出密钥:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
OPENBOOST_SECRET_KEY="your-secret-key" \
|
|
183
|
+
uv run python scripts/sync_mcp_schemas.py --apply
|
|
184
|
+
```
|
|
185
|
+
|
|
166
186
|
单元测试不会访问真实接口。真实接口 smoke test 必须同时显式设置开关和密钥:
|
|
167
187
|
|
|
168
188
|
```bash
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# openboost-cli
|
|
2
2
|
|
|
3
|
-
OpenBoost MCP 的统一命令行工具和 Python 客户端,支持 TikTok、Patent
|
|
3
|
+
OpenBoost MCP 的统一命令行工具和 Python 客户端,支持 TikTok、Patent、Amazon、Social 四类业务工具,以及账号、套餐和订单工具。
|
|
4
|
+
|
|
5
|
+
- 业务工具:TikTok 31、Patent 17、Amazon 36、Social 11,共 95 个
|
|
6
|
+
- 账号工具:6 个
|
|
7
|
+
- 合计:101 个工具
|
|
4
8
|
|
|
5
9
|
- PyPI 包名:`openboost-cli`
|
|
6
10
|
- 命令行入口:`openboost`
|
|
@@ -34,7 +38,7 @@ openboost config set --secret-key "your-secret-key"
|
|
|
34
38
|
|
|
35
39
|
```bash
|
|
36
40
|
openboost config set --mcp amazon --secret-key "your-secret-key"
|
|
37
|
-
openboost config set --mcp amazon --base-url "http://mcp.microdata-inc.com/mcp-servers/openboost-all-mcp/sse"
|
|
41
|
+
openboost config set --mcp amazon --base-url "http://mcp.microdata-inc.com/mcp-servers/openboost-all-mcp/sse"
|
|
38
42
|
```
|
|
39
43
|
|
|
40
44
|
默认配置文件位于:
|
|
@@ -51,9 +55,13 @@ OPENBOOST_SECRET_KEY
|
|
|
51
55
|
OPENBOOST_TIKTOK_SECRET_KEY
|
|
52
56
|
OPENBOOST_PATENT_SECRET_KEY
|
|
53
57
|
OPENBOOST_AMAZON_SECRET_KEY
|
|
58
|
+
OPENBOOST_SOCIAL_SECRET_KEY
|
|
59
|
+
OPENBOOST_ACCOUNT_SECRET_KEY
|
|
54
60
|
OPENBOOST_TIKTOK_BASE_URL
|
|
55
61
|
OPENBOOST_PATENT_BASE_URL
|
|
56
62
|
OPENBOOST_AMAZON_BASE_URL
|
|
63
|
+
OPENBOOST_SOCIAL_BASE_URL
|
|
64
|
+
OPENBOOST_ACCOUNT_BASE_URL
|
|
57
65
|
```
|
|
58
66
|
|
|
59
67
|
密钥也可仅对一次调用通过顶层 `--key` 参数提供。不要将密钥提交到代码仓库。
|
|
@@ -79,6 +87,8 @@ openboost docs tiktok tt_commodity_info_list
|
|
|
79
87
|
openboost tiktok commodity category-tree
|
|
80
88
|
openboost patent search count "TACD: virtual reality"
|
|
81
89
|
openboost amazon hot cat-tree --site 1 --rank-type "Best Seller"
|
|
90
|
+
openboost social youtube post-info "video-id"
|
|
91
|
+
openboost account info
|
|
82
92
|
```
|
|
83
93
|
|
|
84
94
|
使用通用调用命令:
|
|
@@ -121,6 +131,9 @@ patents = client.patent.patent_query_search(
|
|
|
121
131
|
query_text="TACD: virtual reality",
|
|
122
132
|
limit=10,
|
|
123
133
|
)
|
|
134
|
+
|
|
135
|
+
video = client.social.youtube_fetch_post_info(media_id="video-id")
|
|
136
|
+
account = client.account.account_info()
|
|
124
137
|
```
|
|
125
138
|
|
|
126
139
|
也可以按名称取得某个 MCP 客户端:
|
|
@@ -141,6 +154,13 @@ uv run pytest
|
|
|
141
154
|
uv build
|
|
142
155
|
```
|
|
143
156
|
|
|
157
|
+
维护者可使用具有完整权限的密钥从统一 MCP 同步公开工具元数据和参数 Schema。脚本不会保存或输出密钥:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
OPENBOOST_SECRET_KEY="your-secret-key" \
|
|
161
|
+
uv run python scripts/sync_mcp_schemas.py --apply
|
|
162
|
+
```
|
|
163
|
+
|
|
144
164
|
单元测试不会访问真实接口。真实接口 smoke test 必须同时显式设置开关和密钥:
|
|
145
165
|
|
|
146
166
|
```bash
|
|
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "openboost-cli"
|
|
7
|
-
version = "2.0
|
|
8
|
-
description = "Unified CLI and Python client for OpenBoost TikTok, Patent, and
|
|
7
|
+
version = "2.1.0"
|
|
8
|
+
description = "Unified CLI and Python client for OpenBoost TikTok, Patent, Amazon, Social, and Account MCP tools."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
11
11
|
license = "MIT"
|
|
@@ -13,7 +13,7 @@ license-files = ["LICENSE"]
|
|
|
13
13
|
authors = [
|
|
14
14
|
{ name = "OpenBoost CLI" },
|
|
15
15
|
]
|
|
16
|
-
keywords = ["mcp", "cli", "openboost", "tiktok", "patent", "amazon"]
|
|
16
|
+
keywords = ["mcp", "cli", "openboost", "tiktok", "patent", "amazon", "social"]
|
|
17
17
|
classifiers = [
|
|
18
18
|
"Environment :: Console",
|
|
19
19
|
"Programming Language :: Python :: 3",
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
"""Unified OpenBoost MCP CLI and Python client."""
|
|
2
2
|
|
|
3
|
-
__version__ = "2.0
|
|
3
|
+
__version__ = "2.1.0"
|
|
4
4
|
|
|
5
|
-
DEFAULT_BASE_URLS = {
|
|
6
|
-
"tiktok": "http://mcp.microdata-inc.com/mcp-servers/openboost-all-mcp/sse",
|
|
7
|
-
"patent": "http://mcp.microdata-inc.com/mcp-servers/openboost-all-mcp/sse",
|
|
8
|
-
"amazon": "http://mcp.microdata-inc.com/mcp-servers/openboost-all-mcp/sse",
|
|
9
|
-
|
|
5
|
+
DEFAULT_BASE_URLS = {
|
|
6
|
+
"tiktok": "http://mcp.microdata-inc.com/mcp-servers/openboost-all-mcp/sse",
|
|
7
|
+
"patent": "http://mcp.microdata-inc.com/mcp-servers/openboost-all-mcp/sse",
|
|
8
|
+
"amazon": "http://mcp.microdata-inc.com/mcp-servers/openboost-all-mcp/sse",
|
|
9
|
+
"social": "http://mcp.microdata-inc.com/mcp-servers/openboost-all-mcp/sse",
|
|
10
|
+
"account": "http://mcp.microdata-inc.com/mcp-servers/openboost-all-mcp/sse",
|
|
11
|
+
}
|
|
10
12
|
|
|
11
13
|
MCP_LABELS = {
|
|
12
14
|
"tiktok": "TikTok",
|
|
13
15
|
"patent": "Patent",
|
|
14
16
|
"amazon": "Amazon",
|
|
17
|
+
"social": "Social",
|
|
18
|
+
"account": "Account",
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
MCP_NAMES = tuple(DEFAULT_BASE_URLS.keys())
|
|
@@ -34,7 +34,7 @@ console = Console()
|
|
|
34
34
|
|
|
35
35
|
app = typer.Typer(
|
|
36
36
|
name="openboost",
|
|
37
|
-
help="OpenBoost CLI — 统一调用 TikTok / Patent / Amazon MCP",
|
|
37
|
+
help="OpenBoost CLI — 统一调用 TikTok / Patent / Amazon / Social MCP 与账号工具",
|
|
38
38
|
no_args_is_help=False,
|
|
39
39
|
add_completion=False,
|
|
40
40
|
)
|
|
@@ -52,11 +52,18 @@ patent_image_app = typer.Typer(help="专利图像检索")
|
|
|
52
52
|
amazon_app = typer.Typer(help="Amazon MCP")
|
|
53
53
|
amazon_product_app = typer.Typer(help="Amazon 商品与市场")
|
|
54
54
|
amazon_hot_app = typer.Typer(help="Amazon 榜单")
|
|
55
|
+
social_app = typer.Typer(help="Social MCP")
|
|
56
|
+
instagram_app = typer.Typer(help="Instagram 实时采集")
|
|
57
|
+
reddit_app = typer.Typer(help="Reddit 实时采集")
|
|
58
|
+
youtube_app = typer.Typer(help="YouTube 实时采集")
|
|
59
|
+
account_app = typer.Typer(help="账号、套餐与订单工具")
|
|
55
60
|
|
|
56
61
|
app.add_typer(config_app, name="config")
|
|
57
62
|
app.add_typer(tiktok_app, name="tiktok")
|
|
58
63
|
app.add_typer(patent_app, name="patent")
|
|
59
64
|
app.add_typer(amazon_app, name="amazon")
|
|
65
|
+
app.add_typer(social_app, name="social")
|
|
66
|
+
app.add_typer(account_app, name="account")
|
|
60
67
|
tiktok_app.add_typer(tiktok_statistics_app, name="statistics")
|
|
61
68
|
tiktok_app.add_typer(tiktok_commodity_app, name="commodity")
|
|
62
69
|
tiktok_app.add_typer(tiktok_expert_app, name="expert")
|
|
@@ -67,12 +74,15 @@ patent_app.add_typer(patent_detail_app, name="detail")
|
|
|
67
74
|
patent_app.add_typer(patent_image_app, name="image-search")
|
|
68
75
|
amazon_app.add_typer(amazon_product_app, name="product")
|
|
69
76
|
amazon_app.add_typer(amazon_hot_app, name="hot")
|
|
77
|
+
social_app.add_typer(instagram_app, name="instagram")
|
|
78
|
+
social_app.add_typer(reddit_app, name="reddit")
|
|
79
|
+
social_app.add_typer(youtube_app, name="youtube")
|
|
70
80
|
|
|
71
81
|
_state: dict[str, str | None] = {"secret_key": None, "base_url": None}
|
|
72
82
|
|
|
73
83
|
KeyOpt = Annotated[Optional[str], typer.Option("--key", "-k", help="secret-key")]
|
|
74
|
-
BaseUrlOpt = Annotated[Optional[str], typer.Option("--base-url", "-u", help="MCP SSE URL")]
|
|
75
|
-
McpArg = Annotated[str, typer.Argument(help="
|
|
84
|
+
BaseUrlOpt = Annotated[Optional[str], typer.Option("--base-url", "-u", help="MCP SSE URL")]
|
|
85
|
+
McpArg = Annotated[str, typer.Argument(help="工具分组: tiktok / patent / amazon / social / account")]
|
|
76
86
|
CountryOpt = Annotated[str, typer.Option("--country-region", "--country", help="国家/地区,如 美国")]
|
|
77
87
|
CurrentOpt = Annotated[Optional[int], typer.Option("--current", help="当前页码")]
|
|
78
88
|
SizeOpt = Annotated[Optional[int], typer.Option("--size", help="每页条数")]
|
|
@@ -80,6 +90,7 @@ DataPeriodOpt = Annotated[Optional[str], typer.Option("--data-period", help="数
|
|
|
80
90
|
DateOpt = Annotated[Optional[str], typer.Option("--date", help="数据日期")]
|
|
81
91
|
OrderTypeOpt = Annotated[Optional[str], typer.Option("--order-type", help="排序类型")]
|
|
82
92
|
ExtraArg = Annotated[Optional[list[str]], typer.Argument(help="额外参数 key=value ...")]
|
|
93
|
+
PriorityOpt = Annotated[Optional[int], typer.Option("--priority", help="采集优先级")]
|
|
83
94
|
|
|
84
95
|
|
|
85
96
|
@app.callback(invoke_without_command=True)
|
|
@@ -92,9 +103,21 @@ def main_callback(ctx: typer.Context, key: KeyOpt = None, base_url: BaseUrlOpt =
|
|
|
92
103
|
|
|
93
104
|
def _print_json(data: Any) -> None:
|
|
94
105
|
if isinstance(data, (dict, list)):
|
|
95
|
-
|
|
106
|
+
if sys.stdout.isatty():
|
|
107
|
+
console.print_json(json.dumps(data, ensure_ascii=False))
|
|
108
|
+
else:
|
|
109
|
+
sys.stdout.write(json.dumps(data, ensure_ascii=True, separators=(",", ":")) + "\n")
|
|
96
110
|
else:
|
|
97
|
-
|
|
111
|
+
_print_text(str(data))
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def _print_text(text: str) -> None:
|
|
115
|
+
if sys.stdout.isatty():
|
|
116
|
+
console.print(text)
|
|
117
|
+
else:
|
|
118
|
+
sys.stdout.write(text)
|
|
119
|
+
if not text.endswith("\n"):
|
|
120
|
+
sys.stdout.write("\n")
|
|
98
121
|
|
|
99
122
|
|
|
100
123
|
def _props(mcp: str, tool_name: str) -> dict[str, Any]:
|
|
@@ -139,7 +162,7 @@ def _run_tool(mcp: str, tool_name: str, arguments: dict[str, Any], *, verbatim:
|
|
|
139
162
|
|
|
140
163
|
text = extract_result_text(result)
|
|
141
164
|
if verbatim:
|
|
142
|
-
|
|
165
|
+
_print_text(text)
|
|
143
166
|
raise typer.Exit(3 if result.isError else 0)
|
|
144
167
|
if result.isError:
|
|
145
168
|
console.print(text or "(tool error)", style="red")
|
|
@@ -151,7 +174,7 @@ def _run_tool(mcp: str, tool_name: str, arguments: dict[str, Any], *, verbatim:
|
|
|
151
174
|
try:
|
|
152
175
|
_print_json(decode_embedded_payload(text))
|
|
153
176
|
except ValueError:
|
|
154
|
-
|
|
177
|
+
_print_text(text)
|
|
155
178
|
|
|
156
179
|
|
|
157
180
|
@app.command("version")
|
|
@@ -169,7 +192,7 @@ def tui_cmd() -> None:
|
|
|
169
192
|
@config_app.command("set")
|
|
170
193
|
def config_set_cmd(
|
|
171
194
|
secret_key: Annotated[Optional[str], typer.Option("--secret-key", "-k", help="secret-key")] = None,
|
|
172
|
-
mcp: Annotated[Optional[str], typer.Option("--mcp", help="
|
|
195
|
+
mcp: Annotated[Optional[str], typer.Option("--mcp", help="仅配置某个分组: tiktok / patent / amazon / social / account")] = None,
|
|
173
196
|
base_url: BaseUrlOpt = None,
|
|
174
197
|
) -> None:
|
|
175
198
|
"""保存通用或单 MCP 配置"""
|
|
@@ -321,11 +344,6 @@ def tiktok_commodity_voice(commodity_id: Annotated[str, typer.Argument(help="商
|
|
|
321
344
|
_run_tool("tiktok", "tt_commodity_voice_analyze", {"countryRegion": country_region, "commodityId": commodity_id, "size": size})
|
|
322
345
|
|
|
323
346
|
|
|
324
|
-
@tiktok_commodity_app.command("channel")
|
|
325
|
-
def tiktok_commodity_channel(product_id: Annotated[str, typer.Argument(help="商品 ID")], country_region: CountryOpt = "美国", sale_type: Annotated[int, typer.Option("--sale-type")] = 1) -> None:
|
|
326
|
-
_run_tool("tiktok", "tt_sale_channel_sale_channel", {"countryRegion": country_region, "productId": product_id, "saleType": sale_type})
|
|
327
|
-
|
|
328
|
-
|
|
329
347
|
@tiktok_commodity_app.command("expert-trend")
|
|
330
348
|
def tiktok_commodity_expert_trend(commodity_id: Annotated[str, typer.Argument(help="商品 ID")], country_region: CountryOpt = "美国") -> None:
|
|
331
349
|
_run_tool("tiktok", "tt_commodity_expert_draw_expert_trend", {"countryRegion": country_region, "commodityId": commodity_id})
|
|
@@ -551,7 +569,7 @@ def amazon_product_price(node_id: Annotated[str, typer.Argument(help="类目节
|
|
|
551
569
|
|
|
552
570
|
@amazon_hot_app.command("list")
|
|
553
571
|
def amazon_hot_list(web_site_id: Annotated[str, typer.Option("--web-site-id", "--site")], rank_type: Annotated[str, typer.Option("--rank-type")], cat_id: Annotated[Optional[str], typer.Option("--cat-id")] = None, current_page: Annotated[int, typer.Option("--current-page")] = 1, page_size: Annotated[int, typer.Option("--page-size")] = 10) -> None:
|
|
554
|
-
_run_tool("amazon", "
|
|
572
|
+
_run_tool("amazon", "amz_hot_amz_hot_list_v2", {"webSiteId": web_site_id, "rankType": rank_type, "catId": cat_id, "currentPage": current_page, "pageSize": page_size})
|
|
555
573
|
|
|
556
574
|
|
|
557
575
|
@amazon_hot_app.command("cat-tree")
|
|
@@ -559,6 +577,134 @@ def amazon_hot_cat_tree(web_site_id: Annotated[str, typer.Option("--web-site-id"
|
|
|
559
577
|
_run_tool("amazon", "amz_hot_amz_hot_cat_tree", {"webSiteId": web_site_id, "rankType": rank_type, "keyword": keyword})
|
|
560
578
|
|
|
561
579
|
|
|
580
|
+
# Social shortcuts
|
|
581
|
+
@instagram_app.command("hashtag-posts")
|
|
582
|
+
def instagram_hashtag_posts(
|
|
583
|
+
hashtag: Annotated[str, typer.Argument(help="话题标签,不含 #")],
|
|
584
|
+
max_pages: Annotated[int, typer.Option("--max-pages")],
|
|
585
|
+
) -> None:
|
|
586
|
+
_run_tool("social", "instagram_fetch_hashtag_posts", {"hashtag": hashtag, "max_pages": max_pages})
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
@instagram_app.command("post-comments")
|
|
590
|
+
def instagram_post_comments(
|
|
591
|
+
post_id: Annotated[str, typer.Argument(help="帖子 shortcode")],
|
|
592
|
+
priority: PriorityOpt = None,
|
|
593
|
+
) -> None:
|
|
594
|
+
_run_tool("social", "instagram_fetch_post_comments", {"post_id": post_id, "priority": priority})
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
@instagram_app.command("post-info")
|
|
598
|
+
def instagram_post_info(
|
|
599
|
+
post_id: Annotated[str, typer.Argument(help="帖子 shortcode")],
|
|
600
|
+
priority: PriorityOpt = None,
|
|
601
|
+
) -> None:
|
|
602
|
+
_run_tool("social", "instagram_fetch_post_info", {"post_id": post_id, "priority": priority})
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
@instagram_app.command("reel-info")
|
|
606
|
+
def instagram_reel_info(post_id: Annotated[str, typer.Argument(help="Reel shortcode")]) -> None:
|
|
607
|
+
_run_tool("social", "instagram_fetch_reel_info", {"post_id": post_id})
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
@instagram_app.command("user-info")
|
|
611
|
+
def instagram_user_info(
|
|
612
|
+
user_id: Annotated[str, typer.Argument(help="Instagram 用户数字 ID")],
|
|
613
|
+
priority: PriorityOpt = None,
|
|
614
|
+
) -> None:
|
|
615
|
+
_run_tool("social", "instagram_fetch_user_info", {"user_id": user_id, "priority": priority})
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
@instagram_app.command("user-reels")
|
|
619
|
+
def instagram_user_reels(
|
|
620
|
+
user_id: Annotated[str, typer.Argument(help="Instagram 用户数字 ID")],
|
|
621
|
+
max_pages: Annotated[int, typer.Option("--max-pages")],
|
|
622
|
+
) -> None:
|
|
623
|
+
_run_tool("social", "instagram_fetch_user_reels", {"user_id": user_id, "max_pages": max_pages})
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
@reddit_app.command("post-comments")
|
|
627
|
+
def reddit_post_comments(
|
|
628
|
+
media_url: Annotated[str, typer.Argument(help="Reddit 帖子 URL")],
|
|
629
|
+
sort: Annotated[Optional[str], typer.Option("--sort")] = None,
|
|
630
|
+
priority: PriorityOpt = None,
|
|
631
|
+
) -> None:
|
|
632
|
+
_run_tool("social", "reddit_fetch_post_comments", {"media_url": media_url, "sort": sort, "priority": priority})
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
@reddit_app.command("post-details")
|
|
636
|
+
def reddit_post_details(
|
|
637
|
+
media_url: Annotated[str, typer.Argument(help="Reddit 帖子 URL")],
|
|
638
|
+
priority: PriorityOpt = None,
|
|
639
|
+
) -> None:
|
|
640
|
+
_run_tool("social", "reddit_fetch_post_details", {"media_url": media_url, "priority": priority})
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
@youtube_app.command("post-info")
|
|
644
|
+
def youtube_post_info(
|
|
645
|
+
media_id: Annotated[str, typer.Argument(help="YouTube 视频 ID")],
|
|
646
|
+
priority: PriorityOpt = None,
|
|
647
|
+
) -> None:
|
|
648
|
+
_run_tool("social", "youtube_fetch_post_info", {"media_id": media_id, "priority": priority})
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
@youtube_app.command("post-comments")
|
|
652
|
+
def youtube_post_comments(
|
|
653
|
+
media_id: Annotated[str, typer.Argument(help="YouTube 视频 ID")],
|
|
654
|
+
review_token: Annotated[str, typer.Option("--review-token", help="由 post-info 返回")],
|
|
655
|
+
priority: PriorityOpt = None,
|
|
656
|
+
) -> None:
|
|
657
|
+
_run_tool("social", "youtube_fetch_post_comments", {"media_id": media_id, "review_token": review_token, "priority": priority})
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
@youtube_app.command("user-info")
|
|
661
|
+
def youtube_user_info(
|
|
662
|
+
author_id: Annotated[str, typer.Argument(help="UC 开头的频道 ID")],
|
|
663
|
+
priority: PriorityOpt = None,
|
|
664
|
+
) -> None:
|
|
665
|
+
_run_tool("social", "youtube_fetch_user_info", {"author_id": author_id, "priority": priority})
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
# Account shortcuts
|
|
669
|
+
@account_app.command("catalog")
|
|
670
|
+
def account_catalog(
|
|
671
|
+
scope: Annotated[Optional[str], typer.Option("--scope", help="all / mcp / api")] = None,
|
|
672
|
+
platform: Annotated[Optional[str], typer.Option("--platform", help="amazon / tiktok / patent / social")] = None,
|
|
673
|
+
) -> None:
|
|
674
|
+
_run_tool("account", "account_catalog", {"scope": scope, "platform": platform})
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
@account_app.command("info")
|
|
678
|
+
def account_info() -> None:
|
|
679
|
+
_run_tool("account", "account_info", {})
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
@account_app.command("links")
|
|
683
|
+
def account_links() -> None:
|
|
684
|
+
_run_tool("account", "account_links", {})
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
@account_app.command("order-create")
|
|
688
|
+
def account_order_create(
|
|
689
|
+
plan_id: Annotated[str, typer.Argument(help="套餐 planId")],
|
|
690
|
+
payment_method: Annotated[Optional[str], typer.Option("--payment-method")] = None,
|
|
691
|
+
) -> None:
|
|
692
|
+
_run_tool("account", "account_order_create", {"planId": plan_id, "paymentMethod": payment_method})
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
@account_app.command("order-status")
|
|
696
|
+
def account_order_status(mch_order_no: Annotated[str, typer.Argument(help="商户订单号")]) -> None:
|
|
697
|
+
_run_tool("account", "account_order_status", {"mchOrderNo": mch_order_no})
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
@account_app.command("orders")
|
|
701
|
+
def account_orders(
|
|
702
|
+
page: Annotated[Optional[int], typer.Option("--page")] = None,
|
|
703
|
+
page_size: Annotated[Optional[int], typer.Option("--page-size")] = None,
|
|
704
|
+
) -> None:
|
|
705
|
+
_run_tool("account", "account_orders", {"page": page, "pageSize": page_size})
|
|
706
|
+
|
|
707
|
+
|
|
562
708
|
def main() -> None:
|
|
563
709
|
app()
|
|
564
710
|
|
|
@@ -6,7 +6,7 @@ from openboost_cli.mcp_client import McpClient
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class OpenBoost:
|
|
9
|
-
"""Unified Python client for OpenBoost MCP
|
|
9
|
+
"""Unified Python client for OpenBoost MCP tools.
|
|
10
10
|
|
|
11
11
|
Usage:
|
|
12
12
|
|
|
@@ -16,6 +16,8 @@ class OpenBoost:
|
|
|
16
16
|
client.tiktok.tt_video_content(countryRegion="美国", videoId="...")
|
|
17
17
|
client.patent.patent_query_search(query_text="TACD: virtual reality")
|
|
18
18
|
client.amazon.amz_product_selection(webSiteId="1")
|
|
19
|
+
client.social.youtube_fetch_post_info(media_id="...")
|
|
20
|
+
client.account.account_info()
|
|
19
21
|
"""
|
|
20
22
|
|
|
21
23
|
def __init__(
|
|
@@ -25,9 +27,13 @@ class OpenBoost:
|
|
|
25
27
|
tiktok_secret_key: str | None = None,
|
|
26
28
|
patent_secret_key: str | None = None,
|
|
27
29
|
amazon_secret_key: str | None = None,
|
|
30
|
+
social_secret_key: str | None = None,
|
|
31
|
+
account_secret_key: str | None = None,
|
|
28
32
|
tiktok_base_url: str | None = None,
|
|
29
33
|
patent_base_url: str | None = None,
|
|
30
34
|
amazon_base_url: str | None = None,
|
|
35
|
+
social_base_url: str | None = None,
|
|
36
|
+
account_base_url: str | None = None,
|
|
31
37
|
connect_timeout_sec: float = 30,
|
|
32
38
|
read_timeout_sec: float = 300,
|
|
33
39
|
) -> None:
|
|
@@ -53,6 +59,18 @@ class OpenBoost:
|
|
|
53
59
|
base_url=amazon_base_url,
|
|
54
60
|
**shared,
|
|
55
61
|
)
|
|
62
|
+
self.social = McpClient(
|
|
63
|
+
"social",
|
|
64
|
+
secret_key=social_secret_key or secret_key,
|
|
65
|
+
base_url=social_base_url,
|
|
66
|
+
**shared,
|
|
67
|
+
)
|
|
68
|
+
self.account = McpClient(
|
|
69
|
+
"account",
|
|
70
|
+
secret_key=account_secret_key or secret_key,
|
|
71
|
+
base_url=account_base_url,
|
|
72
|
+
**shared,
|
|
73
|
+
)
|
|
56
74
|
|
|
57
75
|
def client(self, mcp: str) -> McpClient:
|
|
58
76
|
return getattr(self, mcp)
|
|
@@ -4,9 +4,9 @@ import asyncio
|
|
|
4
4
|
from datetime import timedelta
|
|
5
5
|
from typing import Any
|
|
6
6
|
|
|
7
|
-
from mcp import ClientSession
|
|
8
|
-
from mcp import types as mtypes
|
|
9
|
-
from mcp.client.sse import sse_client
|
|
7
|
+
from mcp import ClientSession
|
|
8
|
+
from mcp import types as mtypes
|
|
9
|
+
from mcp.client.sse import sse_client
|
|
10
10
|
|
|
11
11
|
from openboost_cli.config import effective_secret_and_base, normalize_mcp_name
|
|
12
12
|
from openboost_cli.parse_result import decode_embedded_payload
|
|
@@ -29,22 +29,22 @@ async def invoke_tool_async(
|
|
|
29
29
|
*,
|
|
30
30
|
connect_timeout_sec: float = 30,
|
|
31
31
|
read_timeout_sec: float = 300,
|
|
32
|
-
) -> mtypes.CallToolResult:
|
|
33
|
-
headers = {"secret-key": secret_key}
|
|
34
|
-
|
|
35
|
-
async with sse_client(
|
|
36
|
-
base_url,
|
|
37
|
-
headers=headers,
|
|
38
|
-
timeout=connect_timeout_sec,
|
|
39
|
-
sse_read_timeout=read_timeout_sec,
|
|
40
|
-
) as (read, write):
|
|
41
|
-
async with ClientSession(read, write) as session:
|
|
42
|
-
await session.initialize()
|
|
43
|
-
return await session.call_tool(
|
|
44
|
-
tool_name,
|
|
45
|
-
arguments,
|
|
46
|
-
read_timeout_seconds=timedelta(seconds=read_timeout_sec),
|
|
47
|
-
)
|
|
32
|
+
) -> mtypes.CallToolResult:
|
|
33
|
+
headers = {"secret-key": secret_key}
|
|
34
|
+
|
|
35
|
+
async with sse_client(
|
|
36
|
+
base_url,
|
|
37
|
+
headers=headers,
|
|
38
|
+
timeout=connect_timeout_sec,
|
|
39
|
+
sse_read_timeout=read_timeout_sec,
|
|
40
|
+
) as (read, write):
|
|
41
|
+
async with ClientSession(read, write) as session:
|
|
42
|
+
await session.initialize()
|
|
43
|
+
return await session.call_tool(
|
|
44
|
+
tool_name,
|
|
45
|
+
arguments,
|
|
46
|
+
read_timeout_seconds=timedelta(seconds=read_timeout_sec),
|
|
47
|
+
)
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
class McpClient:
|
|
@@ -8,6 +8,21 @@ _JSON_FENCE_RE = re.compile(r"```(?:json)?\s*([\s\S]*?)```", re.IGNORECASE)
|
|
|
8
8
|
_MARKER = "响应数据(JSON)"
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
def _loads_json(text: str) -> Any:
|
|
12
|
+
value = json.loads(text)
|
|
13
|
+
for _ in range(4):
|
|
14
|
+
if not isinstance(value, str):
|
|
15
|
+
break
|
|
16
|
+
nested = value.strip()
|
|
17
|
+
if not nested.startswith(("{", "[")):
|
|
18
|
+
break
|
|
19
|
+
try:
|
|
20
|
+
value = json.loads(nested)
|
|
21
|
+
except json.JSONDecodeError:
|
|
22
|
+
break
|
|
23
|
+
return value
|
|
24
|
+
|
|
25
|
+
|
|
11
26
|
def _last_longest_json_value(text: str) -> tuple[Any | None, int]:
|
|
12
27
|
decoder = json.JSONDecoder()
|
|
13
28
|
best: Any | None = None
|
|
@@ -28,7 +43,7 @@ def _last_longest_json_value(text: str) -> tuple[Any | None, int]:
|
|
|
28
43
|
def decode_embedded_payload(text: str) -> Any:
|
|
29
44
|
stripped = text.strip()
|
|
30
45
|
try:
|
|
31
|
-
return
|
|
46
|
+
return _loads_json(stripped)
|
|
32
47
|
except json.JSONDecodeError:
|
|
33
48
|
pass
|
|
34
49
|
|
|
@@ -43,7 +58,7 @@ def decode_embedded_payload(text: str) -> Any:
|
|
|
43
58
|
for match in _JSON_FENCE_RE.finditer(text):
|
|
44
59
|
block = match.group(1).strip()
|
|
45
60
|
try:
|
|
46
|
-
return
|
|
61
|
+
return _loads_json(block)
|
|
47
62
|
except json.JSONDecodeError:
|
|
48
63
|
continue
|
|
49
64
|
|
|
@@ -34,6 +34,20 @@ DOMAIN_LABELS: dict[str, dict[str, str]] = {
|
|
|
34
34
|
"amazon": {
|
|
35
35
|
"product": "商品与市场",
|
|
36
36
|
"hot": "榜单",
|
|
37
|
+
"keyword": "关键词研究",
|
|
38
|
+
"market": "市场分析",
|
|
39
|
+
"traffic": "流量分析",
|
|
40
|
+
"aba": "ABA 数据",
|
|
41
|
+
"other": "其它",
|
|
42
|
+
},
|
|
43
|
+
"social": {
|
|
44
|
+
"instagram": "Instagram",
|
|
45
|
+
"reddit": "Reddit",
|
|
46
|
+
"youtube": "YouTube",
|
|
47
|
+
"other": "其它",
|
|
48
|
+
},
|
|
49
|
+
"account": {
|
|
50
|
+
"account": "账号与套餐",
|
|
37
51
|
"other": "其它",
|
|
38
52
|
},
|
|
39
53
|
}
|
|
@@ -61,7 +75,22 @@ def domain_for(mcp: str, tool_name: str) -> str:
|
|
|
61
75
|
if mcp == "amazon":
|
|
62
76
|
if tool_name.startswith("amz_hot_"):
|
|
63
77
|
return "hot"
|
|
78
|
+
if tool_name.startswith(("amz_keyword_", "amz_google_trends")):
|
|
79
|
+
return "keyword"
|
|
80
|
+
if tool_name.startswith("amz_market_"):
|
|
81
|
+
return "market"
|
|
82
|
+
if tool_name.startswith("amz_traffic_"):
|
|
83
|
+
return "traffic"
|
|
84
|
+
if tool_name.startswith(("amz_aba_", "amz_research_")):
|
|
85
|
+
return "aba"
|
|
64
86
|
return "product"
|
|
87
|
+
if mcp == "social":
|
|
88
|
+
for platform in ("instagram", "reddit", "youtube"):
|
|
89
|
+
if tool_name.startswith(f"{platform}_"):
|
|
90
|
+
return platform
|
|
91
|
+
return "other"
|
|
92
|
+
if mcp == "account":
|
|
93
|
+
return "account" if tool_name.startswith("account_") else "other"
|
|
65
94
|
return "other"
|
|
66
95
|
|
|
67
96
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Bundled OpenBoost tool schemas."""
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "account_catalog",
|
|
3
|
+
"description": "查询可购买套餐目录。可选 scope(all/mcp/api)、platform(amazon/tiktok/patent/social)。",
|
|
4
|
+
"arguments": {
|
|
5
|
+
"properties": {
|
|
6
|
+
"platform": {
|
|
7
|
+
"description": "amazon / tiktok / patent / social,缺省为全部平台",
|
|
8
|
+
"type": "string"
|
|
9
|
+
},
|
|
10
|
+
"scope": {
|
|
11
|
+
"description": "all / mcp / api,默认 all",
|
|
12
|
+
"type": "string"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"type": "object"
|
|
16
|
+
}
|
|
17
|
+
}
|