cnhkmcp 1.2.5__tar.gz → 1.2.6__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.
- {cnhkmcp-1.2.5/cnhkmcp.egg-info → cnhkmcp-1.2.6}/PKG-INFO +1 -1
- {cnhkmcp-1.2.5 → cnhkmcp-1.2.6}/cnhkmcp/__init__.py +1 -1
- {cnhkmcp-1.2.5 → cnhkmcp-1.2.6}/cnhkmcp/untracked/platform_functions.py +77 -0
- {cnhkmcp-1.2.5 → cnhkmcp-1.2.6/cnhkmcp.egg-info}/PKG-INFO +1 -1
- {cnhkmcp-1.2.5 → cnhkmcp-1.2.6}/setup.py +1 -1
- {cnhkmcp-1.2.5 → cnhkmcp-1.2.6}/LICENSE +0 -0
- {cnhkmcp-1.2.5 → cnhkmcp-1.2.6}/MANIFEST.in +0 -0
- {cnhkmcp-1.2.5 → cnhkmcp-1.2.6}/README.md +0 -0
- {cnhkmcp-1.2.5 → cnhkmcp-1.2.6}/cnhkmcp/untracked/forum_functions.py +0 -0
- {cnhkmcp-1.2.5 → cnhkmcp-1.2.6}/cnhkmcp/untracked/user_config.json +0 -0
- {cnhkmcp-1.2.5 → cnhkmcp-1.2.6}/cnhkmcp.egg-info/SOURCES.txt +0 -0
- {cnhkmcp-1.2.5 → cnhkmcp-1.2.6}/cnhkmcp.egg-info/dependency_links.txt +0 -0
- {cnhkmcp-1.2.5 → cnhkmcp-1.2.6}/cnhkmcp.egg-info/entry_points.txt +0 -0
- {cnhkmcp-1.2.5 → cnhkmcp-1.2.6}/cnhkmcp.egg-info/not-zip-safe +0 -0
- {cnhkmcp-1.2.5 → cnhkmcp-1.2.6}/cnhkmcp.egg-info/requires.txt +0 -0
- {cnhkmcp-1.2.5 → cnhkmcp-1.2.6}/cnhkmcp.egg-info/top_level.txt +0 -0
- {cnhkmcp-1.2.5 → cnhkmcp-1.2.6}/requirements.txt +0 -0
- {cnhkmcp-1.2.5 → cnhkmcp-1.2.6}/setup.cfg +0 -0
|
@@ -2428,6 +2428,83 @@ 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
|
+
# Initialize client
|
|
2448
|
+
brain_client = BrainApiClient()
|
|
2449
|
+
|
|
2450
|
+
# Authenticate if credentials provided
|
|
2451
|
+
if email and password:
|
|
2452
|
+
auth_result = await brain_client.authenticate(email, password)
|
|
2453
|
+
if auth_result.get('status') != 'authenticated':
|
|
2454
|
+
return {"error": f"Authentication failed: {auth_result.get('message', 'Unknown error')}"}
|
|
2455
|
+
else:
|
|
2456
|
+
# Try to use existing session or config
|
|
2457
|
+
config = await manage_config("get")
|
|
2458
|
+
if not config.get('is_authenticated'):
|
|
2459
|
+
return {"error": "Not authenticated. Please provide email and password or authenticate first."}
|
|
2460
|
+
|
|
2461
|
+
# Get base payment data
|
|
2462
|
+
base_payment_response = brain_client.session.get(
|
|
2463
|
+
'https://api.worldquantbrain.com/users/self/activities/base-payment'
|
|
2464
|
+
)
|
|
2465
|
+
|
|
2466
|
+
if base_payment_response.status_code != 200:
|
|
2467
|
+
return {"error": f"Failed to get base payment data: {base_payment_response.status_code}"}
|
|
2468
|
+
|
|
2469
|
+
base_payment_data = base_payment_response.json()
|
|
2470
|
+
|
|
2471
|
+
# Get other payment data
|
|
2472
|
+
other_payment_response = brain_client.session.get(
|
|
2473
|
+
'https://api.worldquantbrain.com/users/self/activities/other-payment'
|
|
2474
|
+
)
|
|
2475
|
+
|
|
2476
|
+
if other_payment_response.status_code != 200:
|
|
2477
|
+
return {"error": f"Failed to get other payment data: {other_payment_response.status_code}"}
|
|
2478
|
+
|
|
2479
|
+
other_payment_data = other_payment_response.json()
|
|
2480
|
+
|
|
2481
|
+
# Return comprehensive payment information
|
|
2482
|
+
return {
|
|
2483
|
+
"success": True,
|
|
2484
|
+
"base_payment": {
|
|
2485
|
+
"summary": {
|
|
2486
|
+
"yesterday": base_payment_data.get("yesterday"),
|
|
2487
|
+
"current_quarter": base_payment_data.get("current"),
|
|
2488
|
+
"previous_quarter": base_payment_data.get("previous"),
|
|
2489
|
+
"year_to_date": base_payment_data.get("ytd"),
|
|
2490
|
+
"total_all_time": base_payment_data.get("total"),
|
|
2491
|
+
"currency": base_payment_data.get("currency")
|
|
2492
|
+
},
|
|
2493
|
+
"daily_records": base_payment_data.get("records", {}).get("records", []),
|
|
2494
|
+
"schema": base_payment_data.get("records", {}).get("schema")
|
|
2495
|
+
},
|
|
2496
|
+
"other_payment": {
|
|
2497
|
+
"total_all_time": other_payment_data.get("total"),
|
|
2498
|
+
"special_payments": other_payment_data.get("records", {}).get("records", []),
|
|
2499
|
+
"schema": other_payment_data.get("records", {}).get("schema"),
|
|
2500
|
+
"currency": other_payment_data.get("currency")
|
|
2501
|
+
},
|
|
2502
|
+
"timestamp": datetime.now().isoformat()
|
|
2503
|
+
}
|
|
2504
|
+
|
|
2505
|
+
except Exception as e:
|
|
2506
|
+
return {"error": f"Error retrieving payment information: {str(e)}"}
|
|
2507
|
+
|
|
2431
2508
|
if __name__ == "__main__":
|
|
2432
2509
|
print("🧠 WorldQuant BRAIN MCP Server Starting...", file=sys.stderr)
|
|
2433
2510
|
mcp.run()
|
|
@@ -13,7 +13,7 @@ def read_requirements():
|
|
|
13
13
|
|
|
14
14
|
setup(
|
|
15
15
|
name="cnhkmcp",
|
|
16
|
-
version="1.2.
|
|
16
|
+
version="1.2.6",
|
|
17
17
|
author="CNHK",
|
|
18
18
|
author_email="cnhk@example.com",
|
|
19
19
|
description="A comprehensive Model Context Protocol (MCP) server for quantitative trading platform integration",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|