mathema-mcp
Mathema MCP 的 Python 绑定(SWIG mcp.py + 原生 _mcp)。用户按自己的 操作系统 + Python 版本 只下载 一只 对应 wheel,不会把 Win/Linux、3.9/3.13 全拉下来。
安装
内部索引(HTTP,与现有 mcp_release 同一台机器):
pip install mathema-mcp \
--index-url http://172.20.0.15/mcp_release/pypi/simple \
--trusted-host 172.20.0.15
或直接装本地 / 已下载的 wheel:
pip install path/to/mathema_mcp-1.5.0-cp39-cp39-win_amd64.whl
使用
主入口是 dict 传参(与 mcpexcel 例子相同),不是 SWIG 位置参数:
from mcp.tools import McpCalendar, McpVersion
from mcp.tool.tools_main import McpYieldCurve
from mcp.utils.enums import DayCounter, Frequency, InterpolatedVariable, InterpolationMethod
print(McpVersion())
cal = McpCalendar()
yc = McpYieldCurve({
"ReferenceDate": "2024-12-13",
"Tenors": ["1M", "1Y"],
"ZeroRates": [0.03, 0.035],
"Calendar": cal,
"DayCounter": DayCounter.Act365Fixed,
"Frequency": Frequency.Continuous,
"Variable": InterpolatedVariable.SIMPLERATES,
"InterpolationMethod": InterpolationMethod.LINEARINTERPOLATION,
})
mcp.wrapper.Mcp* 是底层类;业务请走 mcp.tools / mcp.tool.tools_main。
dict 造对象 不需要 numpy / pandas。FixedLegs / McpPayoff / McpZeroRate 等表格 API 才要:pip install mathema-mcp[data]。不含 Excel / PyXLL。
支持的 wheel
| 平台 | Python | 标签 |
|---|---|---|
| Windows x64 | 3.9 / 3.13 | win_amd64 |
| Linux x64(glibc ≥ 2.28) | 3.9 / 3.13 | manylinux_2_28_x86_64 |
其它 Python 小版本(3.10/3.11/3.12)没有对应扩展,pip 会提示无匹配发行包。
运行时依赖
- Windows:第三方(curl / OpenSSL / yaml-cpp / fftw / zlib)已静态链入
_mcp.pyd。当前 Release 仍链接 CUDA,wheel 会附带cudart/curand。 - Linux(
MATHEMA_LINUX_STATIC_THIRDPARTY):yaml-cpp、curl、OpenSSL、zlib、FFTW、OpenBLAS 均静链进_mcp.so。目标机不再需要这些系统库。若绑定编了 CUDA,仍需 CUDA runtime(libcudart/libcurand),或后续打进 wheel。
打包(开发机)
在仓库根目录,先按现有流程编出 _mcp,再:
python python-package/pack_wheel.py
python python-package/pack_wheel.py --smoke
python python-package/pack_wheel.py --upload
不要对 python-package/ 执行 pip install -e .(这里没有可现场编译的扩展)。
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
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 mathema_mcp-1.5.0-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: mathema_mcp-1.5.0-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 69.4 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e08f6e3042e51ed1eb373c6d03fcfae51085b40fc1df13d29ea68600e34ea915
|
|
| MD5 |
20a5964b3f7f3af25e13efc92167bdce
|
|
| BLAKE2b-256 |
af3d0a8b2ba9fa5503936ee37a398ba066665c4dae7dbbaff79060a4d120945a
|
File details
Details for the file mathema_mcp-1.5.0-cp313-cp313-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: mathema_mcp-1.5.0-cp313-cp313-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 20.6 MB
- Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66847e84426de6150af26db060ceafa263630c1442c20222c8e41a2e34ba4195
|
|
| MD5 |
5fd29d63f4d6f2c3fefafb9bea730973
|
|
| BLAKE2b-256 |
c41496ae992cd6713899d6e5e37b5143d2103b9df5b728542573a2f2fe748b64
|
File details
Details for the file mathema_mcp-1.5.0-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: mathema_mcp-1.5.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 69.4 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de200f943580e658355e9aac8e113e6e763cad6bd70bcb7e315a95ecc4ae54bd
|
|
| MD5 |
3cc384e05383b6723909f9dde83f619d
|
|
| BLAKE2b-256 |
4766dc4946f2a9fc7fa1701772192025ad5d72ae384118a9e7132af7e206eb00
|
File details
Details for the file mathema_mcp-1.5.0-cp312-cp312-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: mathema_mcp-1.5.0-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 20.6 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
294a15756f1cfe88a09004cf6bda8247a23a40c066c1c61c90078cf4b51274a7
|
|
| MD5 |
658a606dd5f1e1ac581473336330d9e6
|
|
| BLAKE2b-256 |
fe88b6add1effbbb7a9db5d1f1819c69cf27149917aee66045614c69bd964aa7
|
File details
Details for the file mathema_mcp-1.5.0-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: mathema_mcp-1.5.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 69.4 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fcadef0a5cb4f06f2af12bff0c981770c2549aef14b77f59fcf19a4e10c72a7
|
|
| MD5 |
82da0f0453c7340f7dd5eb9f6b34b539
|
|
| BLAKE2b-256 |
cab34b6e6bd748db9a8af66d2d0a00449e2b3127748b7632bd7d423f943c00a2
|
File details
Details for the file mathema_mcp-1.5.0-cp311-cp311-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: mathema_mcp-1.5.0-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 20.6 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1253ee62d8919a13fe282116c0a99df6475451a736664f687d9408b49ce14c92
|
|
| MD5 |
7908a1d516c6dc1ec5cf17d6c3328273
|
|
| BLAKE2b-256 |
6af9de67d888354c54bd99e758fe76214cfb0be97a8fb75c20516883a8c00139
|
File details
Details for the file mathema_mcp-1.5.0-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: mathema_mcp-1.5.0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 69.4 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc74c04394414f5fe0454be7336eaee2125865345b337f3d9568f41c46f0d72d
|
|
| MD5 |
0c2d683f498e7c4f493709eba455d08a
|
|
| BLAKE2b-256 |
396f4193381a724387309fc02d10a842d2bb3013f9a3287a9d519e662615103c
|
File details
Details for the file mathema_mcp-1.5.0-cp310-cp310-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: mathema_mcp-1.5.0-cp310-cp310-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 20.6 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3baa0309770754611e028d95433110d1abf43ca9197e214af21156a62fbcdd48
|
|
| MD5 |
f1356baa6c3ece92412752a73d32b2a2
|
|
| BLAKE2b-256 |
e794ca8e4508743e250b4df9bdcd3d5d9f66ca0351e665b3dd67eb3c1b9e645b
|
File details
Details for the file mathema_mcp-1.5.0-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: mathema_mcp-1.5.0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 69.4 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f59880984cf929f3b4272c0272115b3cb6bdfe935374659a2d37ecc39a6c1ae0
|
|
| MD5 |
b908cbbf63069d74d17d685d86815508
|
|
| BLAKE2b-256 |
9d85ee362c30031dd8cd74defe3b1d86ae5eb09ba177650f4f9ce1b3d29e5b99
|
File details
Details for the file mathema_mcp-1.5.0-cp39-cp39-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: mathema_mcp-1.5.0-cp39-cp39-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 20.6 MB
- Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b9d06dc266b0b0fa2290b8399353d731ab9c2ec4e4be05aa39e53f5e650a586
|
|
| MD5 |
4e24bd25b2f27085cea4d66909175862
|
|
| BLAKE2b-256 |
1143758e0d1dd08e510f7d55afc2b2bdb872b768d5434c7aa4518d53eb4c41a2
|