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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cnhkmcp
3
- Version: 1.2.5
3
+ Version: 1.2.6
4
4
  Summary: A comprehensive Model Context Protocol (MCP) server for quantitative trading platform integration
5
5
  Home-page: https://github.com/cnhk/cnhkmcp
6
6
  Author: CNHK
@@ -50,7 +50,7 @@ from .untracked.forum_functions import (
50
50
  read_full_forum_post
51
51
  )
52
52
 
53
- __version__ = "1.2.5"
53
+ __version__ = "1.2.6"
54
54
  __author__ = "CNHK"
55
55
  __email__ = "cnhk@example.com"
56
56
 
@@ -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()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cnhkmcp
3
- Version: 1.2.5
3
+ Version: 1.2.6
4
4
  Summary: A comprehensive Model Context Protocol (MCP) server for quantitative trading platform integration
5
5
  Home-page: https://github.com/cnhk/cnhkmcp
6
6
  Author: CNHK
@@ -13,7 +13,7 @@ def read_requirements():
13
13
 
14
14
  setup(
15
15
  name="cnhkmcp",
16
- version="1.2.5",
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