英雄联盟电竞数据服务

MCP服务器提供实时访问英雄联盟电竞数据的标准化接口,包括实时比赛、赛程、联赛、赛事详情和录像等功能。

  • by andraderaul
  • TypeScript
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 andraderaul/mcp-server-lol

使用说明

MCP服务器英雄联盟

MCP(模型上下文协议)服务器,用于实时访问《英雄联盟》电子竞技数据。通过标准化界面提供有关现场比赛、赛程、联赛、赛事详情和VOD的信息。

🚀 快速开始

1.安装

# Clone and install dependencies
npm install

# Configure environment variables
cp .env.example .env

2.配置

编辑 .env 使用您的设置文件:

# League of Legends eSports API Configuration
LOL_API_BASE_URL=https://esports-api.lolesports.com
LOL_API_KEY=your_api_key_here

# Server Configuration
HTTP_TIMEOUT=10000

3.构建和运行

# Build
npm run build

# Run
npm start

# Or development with watch mode
npm run dev

⚙️ 光标配置

要在Cursor中使用此MCP服务器,请配置 .cursor/mcp.json 文件:

{
  "mcpServers": {
    "league-of-legends": {
      "command": "node",
      "args": ["./dist/index.js"],
      "cwd": "/path/to/your/mcp-server-lol",
      "env": {
        "NODE_ENV": "production",
        "LOL_API_BASE_URL": "https://esports-api.lolesports.com",
        "LOL_API_KEY": ""
      }
    }
  }
}

备注:替换 /path/to/your/mcp-server-lol 使用系统上的实际项目路径。

🛠️ 可用工具

工具 说明 参数
get-schedule LoL电子竞技时间表 language, leagueId (可选)
get-live-matches 现场比赛 language
get-leagues 可用联赛 language, region (可选)
get-event-details 具体事件详情 eventId, language
get-match-vods 匹配投票结果 eventId, language
get-upcoming-matches 即将到来的比赛 language, limit
get-live-match-score 实时团队得分 teamName, language

支持的语言

en-US, es-ES, fr-FR, de-DE, it-IT, pt-BR, ru-RU, tr-TR, ja-JP, ko-KR, zh-CN, zh-TW

📚 文档

有关功能、体系结构和高级用法的详细信息:

🔧 NPM脚本

脚本 描述
npm run build 将TypeScript编译为JavaScript
npm run dev 手表模式开发
npm start 运行已编译的服务器
npm run lint 运行代码linting
npm run format 使用生物特征格式化代码
npm run check 完整的lint+格式

🔒 安全

  • 所有敏感配置都是通过环境变量加载的
  • .env 文件包含在 .gitignore
  • 关键变量的强制性验证
  • HTTP请求的可配置超时

📄 许可证

GPL-3.0-见 许可证 文件以获取详细信息。