Lichess MCP

Lichess MCP

一个 MCP 服务器,它支持与 Lichess 国际象棋平台进行自然语言交互,允许用户通过 Claude 来下棋、分析棋局、管理账户以及参与比赛。

游戏与游戏化
访问服务器

Tools

unblock_user

Unblock a user

get_user_profile

Get a user's Lichess profile information

get_my_email

Get your email address

get_kid_mode

Get kid mode status

set_kid_mode

Set kid mode status

create_challenge

Create a new challenge

set_token

Set your Lichess API token

get_my_profile

Get your Lichess profile information

make_move

Make a move in an ongoing game

get_preferences

Get your preferences

get_timeline

Get your timeline

test_tokens

Test multiple OAuth tokens

revoke_token

Revoke the current access token

upgrade_to_bot

Upgrade to Bot account. WARNING: This is irreversible and the account must not have played any games.

add_user_note

Add a private note about a user

send_message

Send a private message to another player

get_following

Get users followed by the logged in user

follow_user

Follow a player

unfollow_user

Unfollow a player

block_user

Block a player

get_users_status

Get real-time users status

get_all_top_10

Get the top 10 players for each speed and variant

get_leaderboard

Get the leaderboard for a single speed or variant

get_user_public_data

Get public data of a user

get_rating_history

Get rating history of a user for all perf types

get_user_performance

Get performance statistics of a user

get_user_activity

Get activity feed of a user

get_users_by_id

Get multiple users by their IDs

export_game

Export one game in PGN or JSON format

export_ongoing_game

Export ongoing game of a user

export_user_games

Export all games of a user

export_games_by_ids

Export multiple games by IDs

get_tv_channels

Get all TV channels and their current games

get_tv_game

Get current TV game in PGN format

get_puzzle_activity

Get your puzzle activity

get_puzzle_dashboard

Get your puzzle dashboard

get_puzzle_race

Get info about a puzzle race

create_puzzle_race

Create a puzzle race

get_puzzle_storm_dashboard

Get your puzzle storm dashboard

get_team_info

Get team information by ID

get_team_members

Get members of a team

get_team_join_requests

Get join requests for a team

join_team

Join a team

leave_team

Leave a team

kick_user_from_team

Kick a user from your team

accept_join_request

Accept a join request for your team

decline_join_request

Decline a join request for your team

search_teams

Search for teams

make_board_move

Make a move in a board game

abort_board_game

Abort a board game

resign_board_game

Resign a board game

write_in_chat

Write in the chat of a board game

handle_draw_board_game

Handle draw offers for a board game

claim_victory

Claim victory if opponent abandoned the game

list_challenges

List incoming and outgoing challenges

README

Lichess MCP

使用自然语言与 Lichess 交互,从而与该国际象棋平台互动。将其与 Claude Desktop 结合使用,可以进行对弈、分析局面以及管理您的国际象棋活动。

基于 Model Context Protocol 构建。

<a href="https://glama.ai/mcp/servers/x7iuw37s1v"> <img width="380" height="200" src="https://glama.ai/mcp/servers/x7iuw37s1v/badge" alt="Lichess MCP server" /> </a>

该服务器支持:

  • 管理您的 Lichess 帐户
  • 进行国际象棋对弈和挑战
  • 分析局面和棋局
  • 加入比赛和团队
  • 与其他玩家互动

配置

Lichess API 令牌可以通过两种方式设置:

  1. 环境变量:将其添加到项目根目录下的 .env 文件中,或直接设置:

    LICHESS_TOKEN=your-lichess-api-token
    
  2. 在运行时使用 set_token 工具:

    set_token({
      token: "your-lichess-api-token"
    });
    

令牌可以在 https://lichess.org/account/oauth/token 生成

可用工具

1. 帐户管理

// 设置您的 Lichess API 令牌
set_token({
  token: "your-lichess-api-token"
});

// 获取您的 Lichess 个人资料
get_my_profile();

// 获取另一个用户的个人资料
get_user_profile({
  username: "player_name",
  trophies: true  // 包括奖杯,可选
});

2. 游戏对弈

// 向另一位玩家发起挑战
create_challenge({
  username: "opponent_username",
  timeControl: "10+0",  // 10 分钟,无增时
  color: "random"       // 或 "white", "black"
});

// 在游戏中走一步棋
make_move({
  gameId: "abcd1234",
  move: "e2e4",
  offeringDraw: false
});

// 获取您正在进行的游戏
get_ongoing_games({
  nb: 10  // 要获取的游戏数量
});

3. 棋局分析

// 以 PGN 格式导出游戏
export_game({
  gameId: "abcd1234",
  clocks: true,
  evals: true
});

// 获取位置的云评估
get_cloud_eval({
  fen: "rnbqkbnr/ppp1pppp/8/3p4/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 2"
});

4. 比赛

// 列出当前的比赛
get_arena_tournaments();

// 加入比赛
join_arena({
  tournamentId: "abc123"
});

// 创建一个新的比赛
create_arena({
  name: "My Tournament",
  clockTime: 3,
  clockIncrement: 2,
  minutes: 45
});

国际象棋记谱法

走法格式

Lichess API 接受以下格式的走法:

  • UCI: 通用国际象棋界面格式(例如,e2e4g8f6
  • SAN: 标准代数记谱法(例如,e4Nf6)- 仅适用于某些端点

FEN 格式

Forsyth-Edwards 符号 (FEN) 用于表示国际象棋局面:

rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

这表示:

  • 棋子位置(从第 8 行到第 1 行)
  • 主动方颜色 (w/b)
  • 易位可用性 (KQkq)
  • 吃过路兵目标格
  • 半步数
  • 全步数

错误处理

服务器提供详细的错误消息,用于:

  • 无效的走法或位置
  • 身份验证问题
  • 速率限制
  • 找不到资源的情况

安装说明

  1. 克隆存储库:

    git clone https://github.com/karayaman/lichess-mcp.git
    cd lichess-mcp
    
  2. 安装依赖项:

    npm install
    
  3. 配置环境变量: 在根目录中创建一个 .env 文件:

    LICHESS_TOKEN=your-lichess-api-token
    
  4. 构建项目:

    npm run build
    
  5. 全局安装软件包(推荐用于 Claude Desktop 集成):

    npm install -g
    
  6. 启动服务器(用于独立使用):

    npm start
    

配置 Claude Desktop

要将此 MCP 服务器与 Claude Desktop 结合使用:

  1. 找到您的 Claude Desktop 配置文件:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  2. 将 Lichess MCP 服务器添加到您的配置中:

    {
      "mcpServers": {
        "lichess": {
          "command": "lichess-mcp",
          "env": {
            "LICHESS_TOKEN": "your-lichess-api-token",
            "DEBUG": "*"
          }
        }
      }
    }
    

    注意:将 your-lichess-api-token 替换为您实际的 Lichess API 令牌。 DEBUG 环境变量是可选的,但有助于进行故障排除。

  3. (可选)您也可以添加其他 MCP 服务器:

    {
      "mcpServers": {
        "filesystem": {
          "command": "npx",
          "args": [
            "-y",
            "@modelcontextprotocol/server-filesystem",
            "/Users/username/Desktop",
            "/Users/username/Downloads"
          ]
        },
        "lichess": {
          "command": "lichess-mcp",
          "env": {
            "LICHESS_TOKEN": "your-lichess-api-token"
          }
        }
      }
    }
    
  4. 重新启动 Claude Desktop 以应用更改。

    • 确保完全关闭 Claude Desktop(包括从系统托盘/菜单栏中关闭)
    • 再次启动 Claude Desktop
    • 在界面中查找锤子图标,表示 MCP 服务器已连接
  5. 通过询问 Claude 关于您的 Lichess 帐户来测试集成:

    • "Show me my Lichess profile"
    • "Start a new chess game with 10 minutes time control"

故障排除

如果您在 MCP 服务器连接方面遇到问题:

  1. 确保您已使用 npm install -g 全局安装了该软件包
  2. 验证 lichess-mcp 命令在您的 PATH 中是否可用 (which lichess-mcp)
  3. 检查您的配置文件是否具有正确的格式(较新的 mcpServers 格式而不是 mcp_servers
  4. 完全重新启动 Claude Desktop
  5. 尝试在 Claude Desktop 中启用开发者模式(如果可用)以获取其他日志记录
  6. 验证您的 Lichess API 令牌是否有效

参考

推荐服务器

steam

steam

Okay, I understand. As a large language model, I don't "play" games in the same way a human does. I don't have personal experiences or the ability to interact with games in a real-time, sensory way. However, I can be used to *process* information about games. Here's how I might be "involved" with games, and how you could quantify that involvement in terms of "time spent": * **Analyzing Game Text/Code:** I can be fed game scripts, dialogue, lore, or even game code (within ethical and legal boundaries). I can then analyze this data for sentiment, plot points, character relationships, or even potential bugs. The "time spent" would be the duration it takes to process the data. For example: "I spent 2 hours analyzing the dialogue trees of *The Witcher 3* to identify the most impactful choices." * **Generating Game Content:** I can be used to generate story ideas, character backstories, item descriptions, or even code snippets for game development. The "time spent" would be the duration of the content generation process. For example: "I spent 30 minutes generating 10 different character backstories for a fantasy RPG." * **Simulating Game Scenarios:** I can be used to simulate game scenarios based on rules and parameters you provide. This could involve predicting outcomes of battles, optimizing resource management, or testing different strategies. The "time spent" would be the duration of the simulation. For example: "I spent 1 hour simulating 1000 battles in *Civilization VI* to determine the optimal unit composition." * **Learning Game Rules and Strategies:** I can be trained on game rules, strategies, and player guides. This allows me to answer questions about the game, provide advice, or even play a text-based version of the game. The "time spent" would be the duration of the training process. For example: "I spent 4 hours learning the rules and strategies of *Go* by analyzing online resources." * **Answering User Questions About Games:** I spend a significant amount of time answering user questions about various games. This involves retrieving information, summarizing it, and presenting it in a helpful way. The "time spent" is the cumulative time spent answering these queries. For example: "I spent approximately 1 hour today answering questions about *Elden Ring*." **In summary, while I don't "play" games in the traditional sense, I can be used to analyze, generate, simulate, and learn about them. The "time spent" is the duration of these processes.** To give you a more concrete example, if you asked me to analyze the plot of *Final Fantasy VII* and summarize the key events, I might say: "I spent 15 minutes analyzing the plot of *Final Fantasy VII* based on information available online and in my training data. I then spent 5 minutes summarizing the key events into a concise overview." **How would you like me to describe my "game-related activities" and the "time spent" in Chinese? Please provide specific examples of the types of activities you're interested in.**

官方
Chess Analysis Assistant

Chess Analysis Assistant

使用 Stockfish 帮助您分析国际象棋局面并获得专业评估。

本地
TypeScript
mcp-minecraft

mcp-minecraft

允许人工智能模型通过一个机器人来观察和与 Minecraft 世界互动。

本地
TypeScript
Minecraft Docker MCP

Minecraft Docker MCP

允许AI通过RCON与Docker容器内运行的Minecraft服务器进行交互,从而使模型能够以编程方式创建Minecraft建筑并管理服务器。

本地
Python
OpenDota MCP Server

OpenDota MCP Server

模型上下文协议服务器,它使大型语言模型和人工智能助手能够通过标准化接口检索实时的 Dota 2 统计数据、比赛数据、玩家信息和游戏指标。

Python
WebGL-MCP Server

WebGL-MCP Server

一个模型上下文协议服务器,提供分析和优化 WebGL 游戏的一系列工具,包括性能洞察、内存使用分析以及特定于模板的优化建议。

JavaScript