A comprehensive Model Context Protocol (MCP) server for quantitative trading platform integration
Project description
CNHK MCP Server
A comprehensive Model Context Protocol (MCP) server for quantitative trading platform integration. This package provides a complete set of tools for interacting with quantitative trading APIs, managing simulations, and accessing financial data.
Features
- API Integration: Complete API client for quantitative trading platforms
- Simulation Management: Create, monitor, and manage trading simulations
- Data Access: Retrieve datasets, data fields, and financial information
- Alpha Management: Comprehensive alpha factor management and analysis
- Forum Integration: Access to support forums and documentation
- Performance Analysis: Advanced performance metrics and correlation analysis
- Competition Support: Tools for trading competitions and leaderboards
Installation
pip install cnhkmcp
Quick Start
from cnhkmcp import BrainApiClient
# Initialize client
client = BrainApiClient()
# Authenticate
await client.authenticate("your_email@example.com", "your_password")
# Create a simulation
simulation_data = {
"type": "REGULAR",
"settings": {
"instrumentType": "EQUITY",
"region": "USA",
"universe": "TOP3000"
},
"regular": "your_alpha_formula"
}
result = await client.create_simulation(simulation_data)
print(f"Simulation created: {result}")
Main Components
API Client (pythonmcp.py)
- Authentication and session management
- Simulation creation and monitoring
- Alpha factor management
- Data retrieval and analysis
- Performance metrics
Forum Client (forum_functions.py)
- Glossary term extraction
- Forum post search and reading
- Support documentation access
Usage Examples
Authentication
from cnhkmcp import authenticate
result = await authenticate("email@example.com", "password")
print(f"Authentication status: {result}")
Create Simulation
from cnhkmcp import create_simulation
result = await create_simulation(
type="REGULAR",
instrument_type="EQUITY",
region="USA",
universe="TOP3000",
regular="your_alpha_formula_here"
)
Get Alpha Details
from cnhkmcp import get_alpha_details
alpha_info = await get_alpha_details("alpha_id_here")
print(f"Alpha details: {alpha_info}")
Search Forum Posts
from cnhkmcp import search_forum_posts
results = await search_forum_posts(
email="email@example.com",
password="password",
search_query="alpha formula"
)
Configuration
The package supports configuration through JSON files:
user_config.json: User-specific settingsbrain_config.json: Platform configuration
Requirements
- Python 3.8+
- Chrome browser (for forum functionality)
- Valid platform credentials
Dependencies
- requests
- pandas
- selenium
- beautifulsoup4
- mcp
- pydantic
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For support and questions, please refer to the documentation or create an issue in the repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cnhkmcp-3.1.1.tar.gz.
File metadata
- Download URL: cnhkmcp-3.1.1.tar.gz
- Upload date:
- Size: 20.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e25605fa474982a225519e3aa1e65d9a0daa6406b295fd035627a989a1d8b49
|
|
| MD5 |
e92aa6db30b3cf4d279a7d95642eee10
|
|
| BLAKE2b-256 |
4ee47c74f89d23ec1f2a93b815f629ad0baa7dd3e55ff01a9112c5ab90952b37
|
File details
Details for the file cnhkmcp-3.1.1-py3-none-any.whl.
File metadata
- Download URL: cnhkmcp-3.1.1-py3-none-any.whl
- Upload date:
- Size: 21.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fab509b5b23f8cf1f70112f7c16659e3dafa7afaa59b443a5f13e592d635dc14
|
|
| MD5 |
8557f546a73723f41aee6f58529fa12e
|
|
| BLAKE2b-256 |
ab9d6274f7c76ae22c120ca9f2b92cb656066d9dc650e7a15215194c48b91052
|