Turn-Based Game

v1.0.0โ€ขAPIsโ€ขstable

A turn-based games app built with Next.js and TypeScript that features Tic-Tac-Toe and Rock Paper Scissors games with AI opponents powered by the Model Context Protocol (MCP), offering three difficulty levels.

aiai-opponentfortheloveofcodegame-developmentmcp
Share:
31
Stars
0
Downloads
0
Weekly
0/5

What is Turn-Based Game?

Turn-Based Game is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to turn-based games app built with next.js and typescript that features tic-tac-toe and rock paper scissors games with ai opponents powered by the model context protocol (mcp), offering three difficulty ...

A turn-based games app built with Next.js and TypeScript that features Tic-Tac-Toe and Rock Paper Scissors games with AI opponents powered by the Model Context Protocol (MCP), offering three difficulty levels.

This server falls under the APIs category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A turn-based games app built with Next.js and TypeScript tha

Use Cases

Play Tic-Tac-Toe
Rock Paper Scissors
AI opponent gameplay
github-samples

Maintainer

LicenseMIT
Languagetypescript
Versionv1.0.0
UpdatedApr 28, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx turn-based-game

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Turn-Based Game

The Turn-Based Game MCP Server exposes Tic-Tac-Toe and Rock Paper Scissors as MCP tools, letting AI assistants act as game opponents or facilitate play between a human and an AI across three difficulty levels. Built with Next.js and TypeScript, it consists of a web frontend and a stdio MCP server that implements game logic, state analysis, and player-move synchronization. It is primarily a demonstration of how MCP servers can manage stateful, interactive experiences and serves as a learning resource for MCP server development.

Prerequisites

  • Node.js 18 or higher and npm installed
  • Git for cloning the monorepo
  • An MCP-compatible client such as Claude Desktop or VS Code with MCP extension
  • The shared package must be built before the MCP server can run
1

Clone the repository

Clone the turn-based-game-mcp monorepo from GitHub.

git clone https://github.com/github-samples/turn-based-game-mcp.git
cd turn-based-game-mcp
2

Install all dependencies

Install Node.js packages for all workspaces (web frontend, shared logic, and MCP server).

npm install
3

Build the shared package

The shared package contains game logic used by both the web app and the MCP server. It must be compiled before anything else.

npm run build --workspace=shared
4

Build and start the MCP server

Build the MCP server workspace, then start it. The server operates over stdio for MCP client integration.

npm run build --workspace=mcp-server
npm run dev --workspace=mcp-server
5

Optionally start the web frontend

If you also want to use the browser-based game UI, start the Next.js development server separately.

npm run dev --workspace=web
6

Add the MCP server to your client configuration

Register the compiled MCP server with Claude Desktop or VS Code so tools appear in your AI assistant.

# See configuration example below

Turn-Based Game Examples

Client configuration

Claude Desktop configuration for the Turn-Based Game MCP server, pointing to the compiled entry point in the mcp-server workspace.

{
  "mcpServers": {
    "turn-based-game": {
      "command": "node",
      "args": ["/absolute/path/to/turn-based-game-mcp/mcp-server/dist/index.js"]
    }
  }
}

Prompts to try

Example prompts to play games and analyze game state through the MCP server.

- "Start a new Tic-Tac-Toe game and play against me at hard difficulty. I'll go first."
- "Create a Rock Paper Scissors game at medium difficulty and play 5 rounds."
- "Analyze the current Tic-Tac-Toe board state and tell me the best move."
- "Play Tic-Tac-Toe against yourself at easy difficulty and narrate your strategy."

Troubleshooting Turn-Based Game

MCP server fails to start with 'Cannot find module' referencing shared package

The shared workspace must be built first. Run 'npm run build --workspace=shared' before building or starting the MCP server. The shared package exports game logic that the MCP server imports.

Tools do not appear in Claude Desktop after adding the config

Ensure the path in args points to the compiled dist/index.js inside the mcp-server directory (not the repo root). The file only exists after running the build step. Restart Claude Desktop after updating the config.

wait_for_player_move tool hangs indefinitely

This tool blocks until it receives a human player's move input. If you are testing via an automated client without human input, the tool will time out. Ensure you are providing moves through the correct tool call sequence.

Frequently Asked Questions about Turn-Based Game

What is Turn-Based Game?

Turn-Based Game is a Model Context Protocol (MCP) server that turn-based games app built with next.js and typescript that features tic-tac-toe and rock paper scissors games with ai opponents powered by the model context protocol (mcp), offering three difficulty levels. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Turn-Based Game?

Follow the installation instructions on the Turn-Based Game GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Turn-Based Game?

Turn-Based Game works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Turn-Based Game free to use?

Yes, Turn-Based Game is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More APIs MCP Servers

Explore all apis servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "turn-based-game": { "command": "npx", "args": ["-y", "turn-based-game"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide โ†’

Ready to use Turn-Based Game?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides