mcp-server-stock-hedge
一个基于 Model Context Protocol (MCP) 的金融量化工具包,专门用于计算 Black-Scholes-Merton (BSM) 模型下的期权 Delta 及其对应的股票与期货对冲配比。
🌟 功能特性
- BSM 定价引擎:精确计算欧式期权的理论 Delta 值。
- 对冲比例建议:直接输出为实现 Delta 中性所需的标的资产(股票或期货)操作数量。
- 灵活参数:支持自定义执行价、到期时间、波动率、无风险利率及合约乘数。
- AI 友好:深度优化了工具描述,方便大模型(如 Claude, GPT)进行函数调用(Tool Calling)。
🛠 技术原理
工具核心使用 BSM 模型计算 Delta ($\Delta$):
$$d_1 = \frac{\ln(S/K) + (r + \sigma^2/2)T}{\sigma\sqrt{T}}$$
对于看涨期权(Call): $$\Delta = N(d_1)$$
对于看跌期权(Put): $$\Delta = N(d_1) - 1$$
对冲比例依据 $\Delta$ 与合约乘数(Contract Size)动态生成。
🚀 安装与准备
本工具推荐使用 uv 进行管理。
1. 环境要求
- Python 3.10+
- 安装
uv:curl -LsSf [https://astral.sh/uv/install.sh](https://astral.sh/uv/install.sh) | sh
2. 本地测试
在发布到 PyPI 前,你可以在本地运行以下命令验证:
uvx --from . mcp-server-stock-hedge
Metadata
Release files for mcp-server-stock-hedge 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mcp_server_stock_hedge-0.1.1.tar.gz | 2.3 kB | Without provenance | Details for mcp_server_stock_hedge-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mcp_server_stock_hedge-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for mcp_server_stock_hedge-0.1.1-py3-none-any.whl |
Total release size: 5.4 kB
Release files / mcp_server_stock_hedge-0.1.1.tar.gz
| Download URL | mcp_server_stock_hedge-0.1.1.tar.gz |
|---|---|
| Size | 2.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1219a258ec5dc0479e6c723fd186192d23cf863b95e5977cab996d250902e5fe
|
|
BLAKE2b-256 checksum How to use checksums |
5c441586ca2de40eae546d5dbff5c92942331c53fd579e57ab653106945bc04e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / mcp_server_stock_hedge-0.1.1-py3-none-any.whl
| Download URL | mcp_server_stock_hedge-0.1.1-py3-none-any.whl |
|---|---|
| Size | 3.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8a1a9faf42a6d87690602644bcfab6bf4fc62685f684f4a62e87751bcd3dfcd2
|
|
BLAKE2b-256 checksum How to use checksums |
ca7cfa838e993f05c222e445d1a94223920ecd90b9005ed1d2adfb803f4e7d21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Security for mcp-server-stock-hedge 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.