cnhkmcp 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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cnhkmcp
3
- Version: 1.2.5
3
+ Version: 1.2.7
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.7"
54
54
  __author__ = "CNHK"
55
55
  __email__ = "cnhk@example.com"
56
56
 
@@ -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 get_forum_post(self, email: str, password: str, article_id: str,
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 get_forum_post(article_id: str, email: str = "", password: str = "",
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
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cnhkmcp
3
- Version: 1.2.5
3
+ Version: 1.2.7
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.7",
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