OP.GG 电竞 MCP 服务器是 Model Context Protocol 的一个实现,它能让 OP.GG 电竞数据与 AI 代理和平台实现无缝对接。借助该服务器,AI 代理可通过函数调用获取《英雄联盟》即将进行的比赛日程和相关信息。
OP.GG 电竞 MCP 服务器为 AI 代理提供了访问 OP.GG 电竞数据的标准化接口。它基于 TypeScript 和 Node.js 构建,直接连接到 OP.GG 电竞 GraphQL API,并将数据格式化,以便 AI 模型和代理框架更方便地消费。
当前 OP.GG 电竞 MCP 服务器支持以下工具:
通过 Smithery 自动安装 OP.GG 电竞 MCP(针对 Claude Desktop):
npx -y @smithery/cli install @opgginc/esports-mcp --client claude
# 安装依赖项
pnpm install
# 构建项目
pnpm build
# 在标准输入输出上启动 MCP 服务器
pnpm start
# 使用 Node.js 启动
node dist/index.js
# 直接通过 npx 运行
npx -y @opgg/esports-mcp
要在 MCP 配置(例如 Windsurf 的 mcp_config.json)中添加此服务器,请添加以下条目:
{
"mcpServers": {
"opgg-esports": {
"command": "node",
"args": ["/path/to/esports-mcp/dist/index.js"]
}
}
}
或者,如果已发布 npm 包,则可以这样做:
{
"mcpServers": {
"opgg-esports": {
"command": "npx",
"args": ["-y", "@opgg/esports-mcp"]
}
}
}
OP.GG 电竞 MCP 服务器可以与任何兼容 MCP 的客户端一起使用。以下是一些示例:
{ "type": "list_tools" }
响应:
{
"tools": [
{
"name": "get-lol-matches",
"description": "从 OP.GG 电竞获取《英雄联盟》即将进行的比赛日程"
}
]
}
{
"type": "tool_call",
"tool_call": {
"name": "get-lol-matches"
}
}
响应:
{
"content": [
{
"type": "text",
"text": "即将进行的比赛日程:
比赛:队伍 A 对战 队伍 B
联赛:LCK
状态:预定中
比分:0-0
预定时间:[具体时间]
比赛链接:[具体链接]
"
}
]
}
本项目采用 MIT 许可证。