npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@iflow-mcp/chess-mcp

v1.0.0

Published

A Model Context Protocol (MCP) server that provides an interactive chess game experience using MCP-UI. This server exposes chess game functionality through MCP tools and provides a web-based chessboard interface for playing games.

Readme

Chess MCP Server

A Model Context Protocol (MCP) server that provides an interactive chess game experience using MCP-UI. This server exposes chess game functionality through MCP tools and provides a web-based chessboard interface for playing games.

Features

  • ♟️ Full Chess Game: Complete chess implementation using chess.js
  • 🔧 MCP Tools: Chess game actions exposed as MCP tools
  • 🎮 Interactive UI: Web-based chessboard using ChessBoard.js
  • 💾 Game State Management: Persistent game state with session-based saves

Workshop

In the ./workshop directory, you can find a step by step to creating this MCP server.

Architecture

This MCP server is built using Express.js with integrated MCP capabilities:

Key Components

  • MCP Server (src/server.ts): Main server with chess tools and UI generation
  • Store (src/lib/store.ts): Game state persistence using file system
  • MCP Framework (src/lib/mcp/): Custom MCP middleware implementation with Express integration

MCP Tools Available

  • chess_get_board_state: Get the current state of the chess board with visual representation
  • chess_move: Make a move in standard algebraic notation (e.g., e4, Nf3, O-O) or start a new game

Getting Started

Prerequisites

  • Node.js 18+
  • npm

Installation

Install the dependencies:

npm install

Development

Start the development server:

npm run dev

The server will be available at:

  • MCP endpoint: http://localhost:3000/mcp

Development Commands

  • npm run dev - Start development server

Usage

As an MCP Server

The server exposes MCP tools that can be consumed by MCP clients:

// Get current board state
{
  "method": "tools/call",
  "params": {
    "name": "chess_get_board_state",
    "arguments": {}
  }
}

// Make a move
{
  "method": "tools/call",
  "params": {
    "name": "chess_move",
    "arguments": {
      "move": "e4"
    }
  }
}

// Start a new game
{
  "method": "tools/call",
  "params": {
    "name": "chess_move",
    "arguments": {
      "move": "new"
    }
  }
}

Interactive Chessboard

When using the MCP tools, each response includes:

  • Text representation: ASCII board and FEN notation with valid moves
  • Interactive UI: Drag-and-drop chessboard that allows moves via mouse interaction

Game Rules

  • Standard chess rules apply
  • Uses chess.js for move validation and game logic
  • Supports all legal chess moves including castling, en passant, and pawn promotion
  • Game state persists per session ID

Project Structure

src/
├── lib/
│   ├── mcp/           # Custom MCP middleware framework
│   │   ├── index.ts   # Main exports
│   │   ├── middleware.ts  # Express middleware integration
│   │   ├── header.ts  # HTTP header utilities
│   │   └── uuid.ts    # UUID validation
│   └── store.ts       # Game state persistence
├── server.ts          # Main server with chess tools and UI
games/                 # Persistent game files (FEN notation)

Game State Persistence

  • Each chess game is saved to a JSON file in the games/ directory
  • Games are identified by MCP session ID
  • Game state is stored as FEN (Forsyth-Edwards Notation) strings
  • Games automatically resume when reconnecting with the same session

Dependencies

  • chess.js: Chess game logic and move validation
  • @chrisoakman/chessboardjs: Interactive chessboard UI
  • @mcp-ui/server: MCP UI resource creation
  • @modelcontextprotocol/sdk: MCP server implementation
  • express: Web server framework

License

Apache 2.0 License - see LICENSE file for details.