npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

lxr-data-mcp

v0.0.8

Published

理杏仁数据获取 MCP 工具,为 Agent 提供快速访问理杏仁金融数据的接口

Downloads

954

Readme

lxr-data-mcp

理杏仁数据获取 MCP (Model Context Protocol) 工具。为挂载了该 MCP 的 Agent 提供快速访问理杏仁金融数据的接口。

功能特性

  • 🚀 快速获取理杏仁金融数据
  • 📊 支持多种数据类型:
    • 大陆市场的公司/指数/行业/基金数据
    • 香港市场的公司/指数/行业数据
    • 美国指数数据
    • 宏观经济数据
  • 🔧 基于 MCP 协议,易于集成到各种 Agent 平台
  • 📝 自动注入 token,无需手动传递
  • 📚 内置完整 API 文档,Agent 可直接查阅

快速开始

1. MCP 客户端配置

在 MCP 客户端配置文件中添加服务器配置,例如在 Cursor 的 .cursor/mcp.json 中:

{
  "mcpServers": {
    "lxr-data": {
      "command": "npx",
      "args": ["-y", "lxr-data-mcp"],
      "env": {
        "LIXINGER_TOKEN": "your_token_here"
      }
    }
  }
}

配置说明:

  • command: "npx" - 使用 npx 运行(无需手动安装)
  • args: ["-y", "lxr-data-mcp"] - -y 自动确认,lxr-data-mcp 是包名
  • env.LIXINGER_TOKEN - 你的理杏仁 API Token(必填)

配置位置:

  • Cursor: .cursor/mcp.json
  • 其他 MCP 客户端: 参考各自文档

2. 获取理杏仁 API Token

访问 理杏仁开放平台 注册账号并获取 Token。

使用

MCP 工具

fetch_lixinger_data

从理杏仁开放平台获取金融数据。

参数:

  • apiPath (必需): API 路径,如 /api/cn/company/candlestick
  • params (可选): 请求参数对象,具体格式请参考对应 API 文档

使用流程:

  1. 查阅文档 - 使用 list_lxr_docs 工具列出所有可用文档,或使用 load_lxr_doc 工具加载文档
    • 主要文档:
      • lxr-doc://cn_company/INDEX - 公司数据接口索引
      • lxr-doc://cn_indexes/INDEX - 指数数据接口索引
      • lxr-doc://experiences/INDEX - 调用经验索引
  2. 查看具体接口文档 - 使用 load_lxr_doc 工具加载对应接口的详细文档了解参数格式
  3. 调用 API - 使用 fetch_lixinger_data 工具传入正确的参数

示例:

{
  "name": "fetch_lixinger_data",
  "arguments": {
    "apiPath": "/api/cn/company/fundamental/non_financial",
    "params": {
      "stockCodes": ["300750"],
      "date": "latest",
      "metricsList": ["q.ps.wroe.t"]
    }
  }
}

其他工具

  • load_lxr_doc - 加载 API 文档
    • 示例 URI:
      • lxr-doc://cn_company/INDEX - 公司数据接口索引
      • lxr-doc://cn_company/fs/non_financial - 非金融公司财务报表
      • lxr-doc://cn_indexes/INDEX - 指数数据接口索引
      • lxr-doc://experiences/INDEX - 调用经验索引
  • list_lxr_docs - 列出所有可用文档

最佳实践

  1. 使用 "date": "latest" 获取最新数据

    推荐使用 "date": "latest" 而不是具体日期:

    {
      "stockCodes": ["300750"],
      "date": "latest",
      "metricsList": ["q.ps.wroe.t"]
    }
  2. 财务报表指标格式

    必须使用完整格式:

    • ✅ 正确:"metricsList": ["q.ps.wroe.t"]
    • ❌ 错误:"metricsList": ["ps.wroe"]
  3. 先查文档再调用

    调用 API 前,先使用 load_lxr_doc 工具查看对应接口的文档,了解正确的参数格式。

故障排查

错误:未找到环境变量 LIXINGER_TOKEN

解决方案:

  1. 确保在 MCP 配置的 env 字段中设置了 LIXINGER_TOKEN
  2. 检查 token 值是否正确(没有多余空格)
  3. 重启 MCP 客户端

错误:请求失败

解决方案:

  1. 检查 API 路径是否正确(以 /api/ 开头)
  2. 检查请求参数格式是否符合 API 文档要求
  3. 检查 token 是否有效
  4. 查看 lxr-doc://experiences/INDEX 了解常见错误和解决方案

npx 执行失败

解决方案:

  1. 确保已安装 Node.js 18+ 和 npm
  2. 检查网络连接是否正常
  3. 尝试手动运行:npx -y lxr-data-mcp

技术栈

  • Node.js 18+
  • FastMCP - MCP 服务器框架
  • Zod - 参数验证
  • Model Context Protocol (MCP)

许可证

MIT