liangmai-mcp
量脉金融数据 MCP 服务器 —— 把量脉平台全部 255 个金融数据接口 暴露为 MCP 工具,供 Claude Desktop / Claude Code / Cursor / Windsurf 等 AI 客户端调用。
配置好后,你可以直接对 AI 说「查一下贵州茅台最近三个月的走势」「帮我看看今天龙虎榜」「北向资金在买什么」,AI 会自动调用量脉接口取数并回答。
1. 准备工作
- 安装 uv(推荐,用于
uvx一键运行);或安装 Python 3.9+ 和 pip。 - 在量脉平台用户中心获取 Token。
2. 运行方式
方式 A:uvx(推荐,免安装)
export LIANGMAI_TOKEN=你的Token
uvx liangmai-mcp
方式 B:pip 安装后运行
pip install liangmai-mcp
export LIANGMAI_TOKEN=你的Token
liangmai-mcp
3. 配置到各客户端
3.1 Claude Desktop
编辑 claude_desktop_config.json(Claude Desktop → Settings → Developer → Edit Config):
{
"mcpServers": {
"liangmai-mcp": {
"command": "uvx",
"args": ["liangmai-mcp"],
"env": {
"LIANGMAI_TOKEN": "你的Token"
}
}
}
}
保存后重启 Claude Desktop,工具列表里会出现 255 个 market_quote、kline_history、lhb_daily 等工具。
3.2 Claude Code(终端)
claude mcp add liangmai-mcp --env LIANGMAI_TOKEN=你的Token -- uvx liangmai-mcp
3.3 Cursor
在项目根目录新建 .cursor/mcp.json:
{
"mcpServers": {
"liangmai-mcp": {
"command": "uvx",
"args": ["liangmai-mcp"],
"env": {
"LIANGMAI_TOKEN": "你的Token"
}
}
}
}
重启 Cursor 后即可在 AI 对话中使用。
3.4 Windsurf
在 ~/.codeium/windsurf/mcp_config.json 中添加同上配置。
4. 使用示例
配置完成后,直接自然语言提问:
- 「查一下 600519 的实时行情」
- 「看下宁德时代最近三个月的日线走势」
- 「今天涨停股池有哪些」
- 「查平安银行的资产负债表」
- 「北向资金最近在买什么」
- 「今天龙虎榜上机构和游资买了什么」
AI 会自动选择合适的工具(接口)并传参取数。
5. 环境变量
| 变量 | 必填 | 说明 |
|---|---|---|
LIANGMAI_TOKEN |
是 | 平台 Token,在量脉用户中心获取 |
LIANGMAI_BASE_URL |
否 | 网关地址,默认 https://liangmai.pro/api/gateway |
6. 本地开发
git clone <仓库地址>
cd liangmai-mcp
pip install -e .
export LIANGMAI_TOKEN=你的Token
liangmai-mcp
工具由 tools/gen_liangmai_mcp.php 从平台配置自动生成,接口变更后重跑即可同步。
Metadata
Release files for liangmai-mcp 0.2.0
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 |
|---|---|---|---|---|
| liangmai_mcp-0.2.0.tar.gz | 19.0 kB | Without provenance | Details for liangmai_mcp-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| liangmai_mcp-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for liangmai_mcp-0.2.0-py3-none-any.whl |
Total release size: 39.3 kB
Release files / liangmai_mcp-0.2.0.tar.gz
| Download URL | liangmai_mcp-0.2.0.tar.gz |
|---|---|
| Size | 19.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b10788ac5e4061344deae43af4d2bc4c4dbb86ba6ec2a88372be5696de644c6
|
|
BLAKE2b-256 checksum How to use checksums |
fa55b9826a5555ddd40141b5844ed2a75f5e0a66ed5342ec82451a6dc509dccd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Release files / liangmai_mcp-0.2.0-py3-none-any.whl
| Download URL | liangmai_mcp-0.2.0-py3-none-any.whl |
|---|---|
| Size | 20.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
392192d944d678561c58a1d67f073bf9615441092eb1fcd8fa98e59b0318148f
|
|
BLAKE2b-256 checksum How to use checksums |
07c865b53649238671cd5b6cf50432412aa0b53881e6288097a4dc7a24186dda
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.2
|
Security for liangmai-mcp 0.2.0
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.