cnhkmcp 1.2.5__py3-none-any.whl → 1.2.7__py3-none-any.whl
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.
- cnhkmcp/__init__.py +1 -1
- cnhkmcp/untracked/platform_functions.py +78 -3
- {cnhkmcp-1.2.5.dist-info → cnhkmcp-1.2.7.dist-info}/METADATA +1 -1
- cnhkmcp-1.2.7.dist-info/RECORD +10 -0
- cnhkmcp-1.2.5.dist-info/RECORD +0 -10
- {cnhkmcp-1.2.5.dist-info → cnhkmcp-1.2.7.dist-info}/WHEEL +0 -0
- {cnhkmcp-1.2.5.dist-info → cnhkmcp-1.2.7.dist-info}/entry_points.txt +0 -0
- {cnhkmcp-1.2.5.dist-info → cnhkmcp-1.2.7.dist-info}/licenses/LICENSE +0 -0
- {cnhkmcp-1.2.5.dist-info → cnhkmcp-1.2.7.dist-info}/top_level.txt +0 -0
cnhkmcp/__init__.py
CHANGED
|
@@ -810,7 +810,7 @@ class BrainApiClient:
|
|
|
810
810
|
self.log(f"Forum search failed: {str(e)}", "ERROR")
|
|
811
811
|
return {"error": str(e)}
|
|
812
812
|
|
|
813
|
-
async def
|
|
813
|
+
async def read_forum_post(self, email: str, password: str, article_id: str,
|
|
814
814
|
headless: bool = False) -> Dict[str, Any]:
|
|
815
815
|
"""Get forum post."""
|
|
816
816
|
try:
|
|
@@ -2030,7 +2030,7 @@ async def search_forum_posts(search_query: str, email: str = "", password: str =
|
|
|
2030
2030
|
return {"error": str(e)}
|
|
2031
2031
|
|
|
2032
2032
|
@mcp.tool()
|
|
2033
|
-
async def
|
|
2033
|
+
async def read_forum_post(article_id: str, email: str = "", password: str = "",
|
|
2034
2034
|
headless: bool = False) -> Dict[str, Any]:
|
|
2035
2035
|
"""
|
|
2036
2036
|
📄 Get a specific forum post by article ID.
|
|
@@ -2428,6 +2428,81 @@ async def _wait_for_multisimulation_completion(location: str, expected_children:
|
|
|
2428
2428
|
except Exception as e:
|
|
2429
2429
|
return {"error": f"Error waiting for multisimulation completion: {str(e)}"}
|
|
2430
2430
|
|
|
2431
|
+
@mcp.tool()
|
|
2432
|
+
async def get_daily_and_quarterly_payment(email: str = "", password: str = "") -> Dict[str, Any]:
|
|
2433
|
+
"""
|
|
2434
|
+
Get daily and quarterly payment information from WorldQuant BRAIN platform.
|
|
2435
|
+
|
|
2436
|
+
This function retrieves both base payments (daily alpha performance payments) and
|
|
2437
|
+
other payments (competition rewards, quarterly payments, referrals, etc.).
|
|
2438
|
+
|
|
2439
|
+
Args:
|
|
2440
|
+
email: Your BRAIN platform email address (optional if in config)
|
|
2441
|
+
password: Your BRAIN platform password (optional if in config)
|
|
2442
|
+
|
|
2443
|
+
Returns:
|
|
2444
|
+
Dictionary containing base payment and other payment data with summaries and detailed records
|
|
2445
|
+
"""
|
|
2446
|
+
try:
|
|
2447
|
+
# Authenticate if credentials provided
|
|
2448
|
+
if email and password:
|
|
2449
|
+
auth_result = await brain_client.authenticate(email, password)
|
|
2450
|
+
if auth_result.get('status') != 'authenticated':
|
|
2451
|
+
return {"error": f"Authentication failed: {auth_result.get('message', 'Unknown error')}"}
|
|
2452
|
+
else:
|
|
2453
|
+
# Try to use existing session or config
|
|
2454
|
+
config = await manage_config("get")
|
|
2455
|
+
if not config.get('is_authenticated'):
|
|
2456
|
+
return {"error": "Not authenticated. Please provide email and password or authenticate first."}
|
|
2457
|
+
|
|
2458
|
+
# Get base payment data
|
|
2459
|
+
base_payment_response = brain_client.session.get(
|
|
2460
|
+
'https://api.worldquantbrain.com/users/self/activities/base-payment'
|
|
2461
|
+
)
|
|
2462
|
+
|
|
2463
|
+
if base_payment_response.status_code != 200:
|
|
2464
|
+
return {"error": f"Failed to get base payment data: {base_payment_response.status_code}"}
|
|
2465
|
+
|
|
2466
|
+
base_payment_data = base_payment_response.json()
|
|
2467
|
+
|
|
2468
|
+
# Get other payment data
|
|
2469
|
+
other_payment_response = brain_client.session.get(
|
|
2470
|
+
'https://api.worldquantbrain.com/users/self/activities/other-payment'
|
|
2471
|
+
)
|
|
2472
|
+
|
|
2473
|
+
if other_payment_response.status_code != 200:
|
|
2474
|
+
return {"error": f"Failed to get other payment data: {other_payment_response.status_code}"}
|
|
2475
|
+
|
|
2476
|
+
other_payment_data = other_payment_response.json()
|
|
2477
|
+
|
|
2478
|
+
# Return comprehensive payment information
|
|
2479
|
+
return {
|
|
2480
|
+
"success": True,
|
|
2481
|
+
"base_payment": {
|
|
2482
|
+
"summary": {
|
|
2483
|
+
"yesterday": base_payment_data.get("yesterday"),
|
|
2484
|
+
"current_quarter": base_payment_data.get("current"),
|
|
2485
|
+
"previous_quarter": base_payment_data.get("previous"),
|
|
2486
|
+
"year_to_date": base_payment_data.get("ytd"),
|
|
2487
|
+
"total_all_time": base_payment_data.get("total"),
|
|
2488
|
+
"currency": base_payment_data.get("currency")
|
|
2489
|
+
},
|
|
2490
|
+
"daily_records": base_payment_data.get("records", {}).get("records", []),
|
|
2491
|
+
"schema": base_payment_data.get("records", {}).get("schema")
|
|
2492
|
+
},
|
|
2493
|
+
"other_payment": {
|
|
2494
|
+
"total_all_time": other_payment_data.get("total"),
|
|
2495
|
+
"special_payments": other_payment_data.get("records", {}).get("records", []),
|
|
2496
|
+
"schema": other_payment_data.get("records", {}).get("schema"),
|
|
2497
|
+
"currency": other_payment_data.get("currency")
|
|
2498
|
+
},
|
|
2499
|
+
"timestamp": datetime.now().isoformat()
|
|
2500
|
+
}
|
|
2501
|
+
|
|
2502
|
+
except Exception as e:
|
|
2503
|
+
return {"error": f"Error retrieving payment information: {str(e)}"}
|
|
2504
|
+
|
|
2431
2505
|
if __name__ == "__main__":
|
|
2432
2506
|
print("🧠 WorldQuant BRAIN MCP Server Starting...", file=sys.stderr)
|
|
2433
|
-
mcp.run()
|
|
2507
|
+
mcp.run()
|
|
2508
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
cnhkmcp/__init__.py,sha256=VI3A7Rs-oPVrJX-aR6KauxyjODzST-gEyIdqFQc9WP0,2758
|
|
2
|
+
cnhkmcp/untracked/forum_functions.py,sha256=QW-CplAsqDkw-Wcwq-1tuZBq48dEO-vXZ8xw7X65EuE,42303
|
|
3
|
+
cnhkmcp/untracked/platform_functions.py,sha256=lJ_ENgn7SU94MoDr0Vta9MwcJS34SE7-4M_j8FMTk88,105451
|
|
4
|
+
cnhkmcp/untracked/user_config.json,sha256=_INn1X1qIsITrmEno-BRlQOAGm9wnNCw-6B333DEvnk,695
|
|
5
|
+
cnhkmcp-1.2.7.dist-info/licenses/LICENSE,sha256=QLxO2eNMnJQEdI_R1UV2AOD-IvuA8zVrkHWA4D9gtoc,1081
|
|
6
|
+
cnhkmcp-1.2.7.dist-info/METADATA,sha256=Yr5UmRTdagf8iX_Xn1p4TId8ApYQ4hhjWHL0Aq-rlvA,5171
|
|
7
|
+
cnhkmcp-1.2.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
+
cnhkmcp-1.2.7.dist-info/entry_points.txt,sha256=lTQieVyIvjhSMK4fT-XwnccY-JBC1H4vVQ3V9dDM-Pc,70
|
|
9
|
+
cnhkmcp-1.2.7.dist-info/top_level.txt,sha256=x--ibUcSgOS9Z_RWK2Qc-vfs7DaXQN-WMaaxEETJ1Bw,8
|
|
10
|
+
cnhkmcp-1.2.7.dist-info/RECORD,,
|
cnhkmcp-1.2.5.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
cnhkmcp/__init__.py,sha256=9lcmFTzQJ3bfvmROp2IucO7n4RWArWsslGxIzyQWvZU,2758
|
|
2
|
-
cnhkmcp/untracked/forum_functions.py,sha256=QW-CplAsqDkw-Wcwq-1tuZBq48dEO-vXZ8xw7X65EuE,42303
|
|
3
|
-
cnhkmcp/untracked/platform_functions.py,sha256=a_WZR9sXAGa_7obv0CXY1-xViEZr4DWwGN8g3_W1IQ0,102025
|
|
4
|
-
cnhkmcp/untracked/user_config.json,sha256=_INn1X1qIsITrmEno-BRlQOAGm9wnNCw-6B333DEvnk,695
|
|
5
|
-
cnhkmcp-1.2.5.dist-info/licenses/LICENSE,sha256=QLxO2eNMnJQEdI_R1UV2AOD-IvuA8zVrkHWA4D9gtoc,1081
|
|
6
|
-
cnhkmcp-1.2.5.dist-info/METADATA,sha256=bo9Zt5xdJD3GgUiC7-GZJVMt36zagZvIrPCC6Fk3ba8,5171
|
|
7
|
-
cnhkmcp-1.2.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
-
cnhkmcp-1.2.5.dist-info/entry_points.txt,sha256=lTQieVyIvjhSMK4fT-XwnccY-JBC1H4vVQ3V9dDM-Pc,70
|
|
9
|
-
cnhkmcp-1.2.5.dist-info/top_level.txt,sha256=x--ibUcSgOS9Z_RWK2Qc-vfs7DaXQN-WMaaxEETJ1Bw,8
|
|
10
|
-
cnhkmcp-1.2.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|