mcpField
C
Chess.com MCP Server

Chess.com MCP Server

本地服务
github.com/udarrr游戏娱乐05 周前更新

关于 Chess.com MCP Server

Chess.com MCP Server 通过工具和资源开放 Chess.com 文档所述的公开 API,涵盖棋手、俱乐部、锦标赛和谜题。默认使用 stdio,也支持可选的 SSE 传输,且无需身份验证。

主要功能

  1. 01获取棋手资料和统计数据
  2. 02浏览对局、存档和 PGN 下载
  3. 03查看俱乐部、比赛和锦标赛
  4. 04获取每日及随机谜题
  5. 05读取棋手和俱乐部资源

适用场景

  1. 01查询棋手资料和近期对局
  2. 02查看锦标赛轮次或俱乐部比赛
  3. 03获取棋谜用于分析

MCP 相关

该服务通过 30 个 MCP 工具和 7 个资源提供 Chess.com PubAPI 数据。默认使用 stdio,也支持可选的 SSE 传输。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"udarrr-chess-mcp-node": {
"command": "npx",
"args": [
"-y",
"chess-mcp-node"
]
}
}
}
启动命令npx -y chess-mcp-node

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npmchess-mcp-node0.8.8

工具

30

收录的工具列表 · 更新于 2 周前

参数类型必填说明
usernamestring是

详细介绍

Chess.com MCP 服务

这是一个使用 TypeScript 编写的 Model Context Protocol 服务,适用于 Chess.com 公共 API。它无需身份验证即可通过 30 个工具和 7 个资源提供 Chess.com PubAPI 中所有已公开文档说明的功能。

从 npm 安装

要求:Node.js 20.9 或更高版本。

直接运行最新发布的软件包:

npx -y chess-mcp-node@latest

默认传输方式为 stdio。该软件包通过 npm 分发,注册表元数据发布后,也可以从 VS Code MCP Gallery 安装。

对于 VS Code,请在工作区中创建或打开 .vscode/mcp.json:

{
  "servers": {
    "chess": {
      "command": "npx",
      "args": ["-y", "chess-mcp-node@latest"]
    }
  }
}

发布后,在 VS Code 中搜索 @mcp chess,然后选择 Install,即可从 MCP Gallery 添加服务。

对于 Claude Desktop,请将服务添加到其 MCP 配置中:

{
  "mcpServers": {
    "chess": {
      "command": "npx",
      "args": ["-y", "chess-mcp-node@latest"]
    }
  }
}

从源代码运行

要求:Node.js 20.9 或更高版本。

npm ci
npm run build
npm start

默认的源码运行传输方式为 stdio。如需运行可选的 SSE 传输方式:

# macOS/Linux
MCP_TRANSPORT=sse npm start
# Windows PowerShell
$env:MCP_TRANSPORT = "sse"
npm start

SSE 服务默认监听端口 8000,并提供 /sse、/messages 和 /health。设置 PORT 和 HOST 可覆盖这些默认值。

设置 CHESS_API_BASE_URL 可在开发或测试时覆盖 Chess.com API 基础 URL。

开发

运行测试套件和类型检查器:

npm test
npm run typecheck

使用以下命令生成覆盖率报告:

npm run test:coverage

可用工具

  • get_player_profile
  • get_titled_players
  • get_player_stats
  • is_player_online
  • get_player_current_games
  • get_player_games_to_move
  • get_player_game_archives
  • get_player_games_by_month
  • get_player_live_games
  • download_player_games_pgn
  • get_player_clubs
  • get_player_matches
  • get_player_tournaments
  • get_club_profile
  • get_club_members
  • get_club_matches
  • get_tournament
  • get_tournament_round
  • get_tournament_round_group
  • get_team_match
  • get_team_match_board
  • get_live_team_match
  • get_live_team_match_board
  • get_country_profile
  • get_country_players
  • get_country_clubs
  • get_daily_puzzle
  • get_random_puzzle
  • get_streamers
  • get_leaderboards

可用资源

  • chess://player/{username}
  • chess://player/{username}/stats
  • chess://player/{username}/games/current
  • chess://player/{username}/games/{year}/{month}
  • chess://player/{username}/games/{year}/{month}/pgn
  • chess://titled/{title}
  • chess://club/{url_id}

许可证

MIT

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。