Lichess MCP

by karayaman
Verified

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Provides support for loading environment variables from a .env file for configuring the Lichess API token.

  • Enables comprehensive interaction with the Lichess chess platform, including account management, playing chess games, creating challenges, analyzing positions, managing tournaments, joining teams, and connecting with other players.

리치스 MCP

Lichess에 자연어로 대화하여 체스 플랫폼과 소통하세요. Claude Desktop과 함께 사용하면 게임을 플레이하고, 포지션을 분석하고, 체스 활동을 관리할 수 있습니다.

모델 컨텍스트 프로토콜을 사용하여 구축되었습니다.

서버를 사용하면 다음이 가능합니다.

  • Lichess 계정 관리
  • 체스 게임과 챌린지 플레이
  • 포지션과 게임 분석
  • 토너먼트 및 팀 참여
  • 다른 플레이어와 상호 작용

구성

Lichess API 토큰은 두 가지 방법으로 설정할 수 있습니다.

  1. 환경 변수: 프로젝트 루트의 .env 파일에 추가하거나 직접 설정하세요.지엑스피1
  2. 런타임 동안 set_token 도구 사용:
    set_token({ token: "your-lichess-api-token" });

토큰은 https://lichess.org/account/oauth/token 에서 생성할 수 있습니다.

사용 가능한 도구

1. 계정 관리

// Set your Lichess API token set_token({ token: "your-lichess-api-token" }); // Get your Lichess profile get_my_profile(); // Get another user's profile get_user_profile({ username: "player_name", trophies: true // include trophies, optional });

2. 게임 플레이

// Create a challenge against another player create_challenge({ username: "opponent_username", timeControl: "10+0", // 10 minutes, no increment color: "random" // or "white", "black" }); // Make a move in a game make_move({ gameId: "abcd1234", move: "e2e4", offeringDraw: false }); // Get your ongoing games get_ongoing_games({ nb: 10 // number of games to fetch });

3. 게임 분석

// Export a game in PGN format export_game({ gameId: "abcd1234", clocks: true, evals: true }); // Get cloud evaluation for a position get_cloud_eval({ fen: "rnbqkbnr/ppp1pppp/8/3p4/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 2" });

4. 토너먼트

// List current tournaments get_arena_tournaments(); // Join a tournament join_arena({ tournamentId: "abc123" }); // Create a new tournament create_arena({ name: "My Tournament", clockTime: 3, clockIncrement: 2, minutes: 45 });

체스 표기법

이동 형식

Lichess API는 다음 형식의 이동을 허용합니다.

  • UCI : Universal Chess Interface 형식(예: e2e4 , g8f6 )
  • SAN : 표준 대수 표기법(예: e4 , Nf6 ) - 일부 엔드포인트에만 해당

FEN 형식

포사이스-에드워즈 표기법(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 구성

Claude Desktop과 함께 이 MCP 서버를 사용하려면:

  1. Claude Desktop 구성 파일을 찾으세요.
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • 리눅스: ~/.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 계정에 대해 질문하여 통합을 테스트하세요.
    • "내 리치스 프로필 보여줘"
    • "10분의 시간 제한으로 새로운 체스 게임을 시작하세요"

문제 해결

MCP 서버 연결에 문제가 발생하는 경우:

  1. npm install -g 사용하여 패키지를 전역적으로 설치했는지 확인하세요.
  2. PATH에 lichess-mcp 명령이 있는지 확인하세요( which lichess-mcp ).
  3. 구성 파일의 형식이 올바른지 확인하세요( mcp_servers 대신 최신 mcpServers 형식)
  4. Claude Desktop을 완전히 다시 시작하세요
  5. 추가 로깅을 위해 Claude Desktop에서 개발자 모드를 활성화해 보세요(사용 가능한 경우)
  6. Lichess API 토큰이 유효한지 확인하세요

참고문헌

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Lichess 체스 플랫폼과 자연어 상호작용을 가능하게 하는 MCP 서버로, 이를 통해 사용자는 Claude를 통해 게임을 플레이하고, 포지션을 분석하고, 계정을 관리하고, 토너먼트에 참여할 수 있습니다.

  1. Configuration
    1. Available Tools
      1. 1. Account Management
      2. 2. Game Play
      3. 3. Game Analysis
      4. 4. Tournaments
    2. Chess Notation
      1. Move Formats
      2. FEN Format
    3. Error Handling
      1. Setup Instructions
        1. Configuring Claude Desktop
          1. Troubleshooting
            1. References
              ID: x7iuw37s1v