MCP Chess Server

MCP Chess Server

Provides Chess.com player data integration, enabling AI assistants to fetch real-time chess player profiles and comprehensive statistics including ratings, game counts, and performance metrics from Chess.com's public API.

Category
访问服务器

README

<div align="center"> <img src="https://raw.githubusercontent.com/CyprianFusi/mcp-chess-server/main/assets/binati_logo.png" alt="BINATI AI Logo" width="75"/><strong></strong>

MCP Chess Server

By BINATI AInalytics </div>

A Model Context Protocol (MCP) server that provides Chess.com player data integration. This server allows AI assistants like Claude to fetch real-time chess player profiles and statistics from Chess.com's public API.

Screenshots

UI Screenshot 1 UI Screenshot 2 UI Screenshot 3 UI Screenshot 4 UI Screenshot 5

Features

  • Player Profile Lookup: Get detailed profile information for any Chess.com player
  • Player Statistics: Retrieve comprehensive statistics including ratings, game counts, and performance metrics
  • Error Handling: Robust error handling for API requests with detailed error messages
  • Type Safety: Full type hints for better code quality and IDE support

Installation

Prerequisites

  • Python >= 3.13
  • uv (recommended) or pip for package management

Setup

  1. Clone the repository:
git clone https://github.com/CyprianFusi/mcp-chess-server.git
cd mcp_chess_server
  1. Install dependencies using uv:
uv sync

Or using pip:

pip install -e .

Usage

Running the Server

The server can be run directly using the installed command:

chess

Or via Python module:

python -m chess.server

Integration with Claude Desktop

To use this MCP server with Claude Desktop, add the following configuration to your Claude Desktop config file:

For MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json For Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "chess": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/mcp_chess_server",
        "run",
        "chess.py"
      ]
    }
  }
}

Replace /path/to/mcp_chess_server with the actual path to your installation directory.

Alternatively, you can also integrate it directly from Github by updating claude desktop as follows:

"chess": {
	"command": "uvx",
	"args": [
		"--from",
		"git+https://github.com/CyprianFusi/mcp-chess-server.git",
		"chess.py"
	]
}

If this is your first MCP server then use this instead:

{
  "mcpServers": {
	"chess": {
		"command": "uvx",
		"args": [
			"--from",
			"git+https://github.com/CyprianFusi/mcp-chess-server.git",
			"chess.py"
		]
	}
  }
}

Available Tools

1. get_chess_player_profile

Retrieves the public profile for a Chess.com player.

Parameters:

  • player_name (str): The Chess.com username

Returns:

  • Player profile information including:
    • Username
    • Player ID
    • URL
    • Name (if public)
    • Country
    • Location
    • Join date
    • Last online timestamp
    • Followers count
    • And more...

Example:

Get the profile for player "hikaru"

2. get_chess_player_stats

Retrieves comprehensive statistics for a Chess.com player.

Parameters:

  • player_name (str): The Chess.com username

Returns:

  • Player statistics including:
    • Current ratings for all game types (blitz, bullet, rapid, daily, etc.)
    • Best ratings
    • Win/loss/draw records
    • Tactics rating
    • Lessons stats
    • Puzzle rush scores

Example:

Get the stats for player "magnuscarlsen"

Project Structure

mcp_chess_server/
├── src/
│   └── chess/
│       ├── __init__.py       # Package initialization
│       ├── server.py         # MCP server implementation
│       └── chess_api.py      # Chess.com API client
├── assets/                   # Screenshots and images
├── main.py                   # Entry point (legacy)
├── pyproject.toml           # Project configuration
├── uv.lock                  # Dependency lock file
└── README.md                # This file

Dependencies

  • mcp[cli] (>=1.22.0): Model Context Protocol framework
  • requests (>=2.32.5): HTTP library for API calls
  • openai (>=2.8.1): OpenAI Python client

API Reference

This server uses the Chess.com Public API (https://api.chess.com/pub). No API key is required as it uses publicly available endpoints.

Error Handling

The server includes comprehensive error handling:

  • Network timeouts (10 second timeout on requests)
  • HTTP error responses
  • Invalid player names
  • API downtime

All errors are properly propagated with descriptive messages to help diagnose issues.

Development

Running Tests

# Install development dependencies
uv sync --dev

# Run tests (when available)
pytest

Code Quality

The codebase follows Python best practices:

  • Type hints for all functions
  • Comprehensive docstrings
  • PEP 8 style guidelines
  • Error handling on all API calls

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is open source and available under the MIT License.

Acknowledgments

Support

For issues, questions, or contributions, please open an issue on the GitHub repository.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选