本项目是一个集成 Balldontlie API 的 MCP 服务器实现,能够提供关于 NBA、NFL 和 MLB 球员、球队和比赛的信息,为体育数据的获取和处理提供了便利。
在使用本服务器前,你需要先获取 API 密钥并完成安装与配置。以下是详细步骤:
使用以下命令安装:
npx -y @smithery/cli install @mikechao/balldontlie-mcp
在 balldontlie-mcp.config.js
文件中进行配置:
module.exports = {
// API 密钥在此处配置
}
league
(枚举 ['NBA', 'NFL', 'MLB']):要获取球队的体育联盟。league
(枚举 ['NBA', 'NFL', 'MLB']):要获取球员的体育联盟。firstName
(字符串,可选):要搜索的球员的姓。lastName
(字符串,可选):要搜索的球员的名。cursor
(数字,可选):分页游标。league
(枚举 ['NBA', 'NFL', 'MLB']):要获取比赛的体育联盟。dates
(字符串数组,可选):获取特定日期的比赛,格式为 YYYY - MM - DD。teamIds
(字符串数组,可选):获取指定球队的比赛。cursor
(数字,可选):分页游标。league
(枚举 ['NBA', 'NFL', 'MLB']):要获取比赛的体育联盟。gameId
(数字):从 get_games 工具获得的比赛编号。const { balldontlieMCP } = require('@mikechao/balldontlie-mcp');
// 获取球队列表示例
balldontlieMCP.getTeams({ league: 'NBA' })
.then(teams => console.log(teams))
.catch(error => console.error('Error:', error));
// 获取球员列表示例
balldontlieMCP.getPlayers({ league: 'NFL', firstName: 'John', lastName: 'Doe' })
.then(players => console.log(players))
.catch(error => console.error('Error:', error));
本项目采用 MIT License 许可证。
该项目与任何第三方服务或公司无关,仅为学习和研究目的而开发。