tomholford/mcp-tic-tac-toe

๐ŸŽฎ Gaming
0 Views
0 Installs

๐ŸŽ๏ธ ๐Ÿ  - Play Tic Tac Toe against an AI opponent using this MCP server.

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "tomholford-mcp-tic-tac-toe": {
      "command": "npx",
      "args": [
        "-y",
        "tomholford-mcp-tic-tac-toe"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

MCP Tic-Tac-Toe

A Model Context Protocol (MCP) server that enables AI assistants to play tic-tac-toe through standardized tool interfaces. Perfect for demonstrating AI-human collaboration and MCP integration.

mcp-tic-tac-toe screenshot

Overview

This project implements a complete tic-tac-toe game as an MCP server, allowing AI assistants like Claude to:

  • Create and manage multiple game sessions
  • Make strategic moves and analyze positions
  • Provide game commentary and suggestions
  • Play against humans or other AIs

Quick Start

Prerequisites

  • Go 1.19+ installed
  • Claude Code or other MCP-compatible client

Installation

git clone https://github.com/tomholford/mcp-tic-tac-toe
cd mcp-tic-tac-toe
go mod tidy
go build -o bin/server cmd/server.go

Basic Usage

# Start MCP server (stdio transport)
./bin/server

# Or specify transport method
./bin/server -transport=sse -addr=:8080

MCP Configuration

Claude Code Setup

  1. Build the server:

    go build -o bin/server cmd/server.go
    
  2. Add to your MCP configuration:

    Create or edit your MCP configuration file:

    # For macOS/Linux
    ~/.config/claude-code/mcp_servers.json
    
    # For Windows  
    %APPDATA%\claude-code\mcp_servers.json
    
  3. Add the server configuration:

    {
      "mcpServers": {
        "tic-tac-toe": {
          "command": "/full/path/to/mcp-tic-tac-toe/bin/server",
          "args": ["-transport=stdio"],
          "env": {}
        }
      }
    }
    
  4. Restart Claude Code and the tic-tac-toe tools will be available. c

Claude Desktop

"tic-tac-toe": {
  "command": "/full/path/to/mcp-tic-tac-toe/bin/server",
  "args": [""]
}

Available MCP Tools

The server exposes 8 tools for complete game management:

Game Management

  • new_game - Create a new tic-tac-toe game

    • Optional: game_id (string) - Custom game identifier
    • Returns: Game ID, starting player, initial board
  • list_games - Show all active game sessions

    • Returns: List of active game IDs
  • reset_game - Reset a game to initial state

    • Required: game_id (string)
    • Returns: Confirmation and fresh board

Gameplay

  • make_move - Execute a move on the board

    • Required: game_id (string), position (A1-C3), player (X/O)
    • Returns: Updated board, game status, next player
  • get_board - Get current board state

    • Required: game_id (string)
    • Returns: Board display, current player, move count
  • get_available_moves - List all valid moves

    • Required: game_id (string)
    • Returns: Available positions for current player

Analysis

  • get_status - Check game status and winner

    • Required: game_id (string)
    • Returns: Game status (ongoing/won/draw), winner if applicable
  • analyze_position - Get strategic analysis

    • Required: game_id (string)
    • Returns: Position analysis and board state

Usage Examples

Start a New Game

AI: Use the new_game tool
โ†’ New game created with ID: game-a1b2c3d4
  Starting player: X
  Initial board:
    A B C
  1 ยท ยท ยท
  2 ยท ยท ยท  
  3 ยท ยท ยท

Make Strategic Moves

Human: I'll take the center
AI: Use make_move tool with {"game_id": "game-a1b2c3d4", "position": "B2", "player": "X"}

AI: Let me analyze the position first
AI: Use analyze_position tool โ†’ Shows current state and opportunities

AI: I'll take a corner for strategic advantage  
AI: Use make_move tool with {"game_id": "game-a1b2c3d4", "position": "A1", "player": "O"}

Get Game Status

AI: Use get_status tool โ†’ Game Status: Ongoing, Current player: X, Move count: 2
AI: Use get_available_moves tool โ†’ Available moves (7): A2, A3, B1, B3, C1, C2, C3

Transport Options

The server supports three transport methods:

1. Stdio (Default)

Best for local MCP clients like Claude Code:

./bin/server -transport=stdio

2. Server-Sent Events (SSE)

For web applications and real-time updates:

./bin/server -transport=sse -addr=:8080

3. Streamable HTTP

For traditional HTTP integrations:

./bin/server -transport=http -addr=:8080

Development

Project Structure

mcp-tic-tac-toe/
โ”œโ”€โ”€ cmd/
โ”‚   โ”œโ”€โ”€ server.go          # MCP server main entry point
โ”‚   โ””โ”€โ”€ demo.go            # Game logic demonstration  
โ”œโ”€โ”€ game/                  # Core tic-tac-toe logic
โ”‚   โ”œโ”€โ”€ types.go           # Game data structures
โ”‚   โ”œโ”€โ”€ engine.go          # Game rules and validation
โ”‚   โ””โ”€โ”€ engine_test.go     # Game logic tests
โ”œโ”€โ”€ server/                # MCP server implementation  
โ”‚   โ”œโ”€โ”€ server.go          # MCP server setup and tools
โ”‚   โ”œโ”€โ”€ handlers.go        # Tool request handlers
โ”‚   โ””โ”€โ”€ server_test.go     # MCP integration tests
โ””โ”€โ”€ bin/                   # Built executables

Running Tests

# Test all packages
go test ./game ./server -v

# Test specific functionality
go test ./game -run TestWinConditions
go test ./server -run TestMakeMoveTool

Building from Source

# Build server
go build -o bin/server cmd/server.go

# Build demo
go build -o bin/demo cmd/demo.go

# Run demo (no MCP required)
./bin/demo

Resources

Related MCP Servers

3aKHP/prts-mcp

๐Ÿ ๐Ÿ“‡ โ˜๏ธ ๐Ÿ  - MCP Server for Arknights, querying the PRTS Wiki API and serving auto-synced operator archives and voice lines from game data. Designed for fan-creation (ๅŒไบบๅ‰ตไฝœ) AI agents. Python (stdio/Docker) and TypeScript (Streamable HTTP) implementations.

๐ŸŽฎ Gaming0 views
alex-gon/thegamecrafter-mcp-server

๐Ÿ“‡ โ˜๏ธ - Design, manage, and price tabletop games on The Game Crafter. Browse catalogs, create projects, upload artwork, get pricing.

๐ŸŽฎ Gaming0 views
antics-gg/antics-mcp

๐Ÿ“‡ โ˜๏ธ - Deploy a single-file HTML game to a shareable multiplayer URL with rooms, state sync, and leaderboards. No backend or player accounts.

๐ŸŽฎ Gaming0 views
beckettlab/beckett-godot-mcp

๐Ÿ  ๐ŸŽ ๐ŸชŸ ๐Ÿง - Beckett โ€” MCP for Godot: a zero-sidecar GDScript editor addon that serves MCP over Streamable HTTP from inside the Godot 4 editor (no Node/Python sidecar). Reflection over any class, validate-before-write GDScript, scene/script/resource authoring, and a runtime play-test loop (play, screenshot, input, assert). MIT.

๐ŸŽฎ Gaming0 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Not checked yet

We have not completed a health check for this listing yet.

No check timestamp yet.

Unclaimed listing (imported or pending owner verification). Claim it โ†’
โ˜… Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.