Skip to main content

liangmai-mcp

量脉金融数据 MCP 服务器 —— 把量脉平台全部 255 个金融数据接口 暴露为 MCP 工具,供 Claude Desktop / Claude Code / Cursor / Windsurf 等 AI 客户端调用。

配置好后,你可以直接对 AI 说「查一下贵州茅台最近三个月的走势」「帮我看看今天龙虎榜」「北向资金在买什么」,AI 会自动调用量脉接口取数并回答。


1. 准备工作

  1. 安装 uv(推荐,用于 uvx 一键运行);或安装 Python 3.9+ 和 pip。
  2. 在量脉平台用户中心获取 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 个 stock_realtimequote_bars_historydragonTiger 等工具。

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 从平台配置自动生成,接口变更后重跑即可同步。

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

liangmai_mcp-0.1.4.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

liangmai_mcp-0.1.4-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file liangmai_mcp-0.1.4.tar.gz.

File metadata

  • Download URL: liangmai_mcp-0.1.4.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for liangmai_mcp-0.1.4.tar.gz
Algorithm Hash digest
SHA256 e9221e64a4f27438dc4e9eb7b976020ca5e6d88ec8dd13b2aa315c36bd128d9c
MD5 8fb7169e78ce8c67fa3d0aafe1ddbda7
BLAKE2b-256 9dca471eada03ba031cb2598d23fe93e82594a23c6373def027d0691a6457b77

See more details on using hashes here.

File details

Details for the file liangmai_mcp-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: liangmai_mcp-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for liangmai_mcp-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 40c5e6b471106e28b3a45dc0c7fce73e469f422a1e6bbe090822665048390d17
MD5 b3a8a2c2d6436f9448f872acec136fff
BLAKE2b-256 c4ea8d7b2746342a57ea282befa8582325ba29fbfec220209b1411e93a709759

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.0

2 files

0.1.6

2 files

0.1.5

2 files

This release

0.1.4 This release

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page