Turn-Based Game
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.
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
Maintainer
Works with
Installation
Manual Installation
npx turn-based-gameConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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-mcpInstall all dependencies
Install Node.js packages for all workspaces (web frontend, shared logic, and MCP server).
npm installBuild 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=sharedBuild 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-serverOptionally 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=webAdd 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 belowTurn-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.
Turn-Based Game Alternatives โ Similar APIs Servers
Looking for alternatives to Turn-Based Game? Here are other popular apis servers you can use with Claude, Cursor, and VS Code.
Kong
โ 43.4k๐ฆ The API and AI Gateway
API Mega List
โ 5.4kThis GitHub repo is a powerhouse collection of APIs you can start using immediately to build everything from simple automations to full-scale applications. One of the most valuable API lists on GitHubโperiod. ๐ช
Fetch
โ 5.4kFetch web content and convert to markdown for AI consumption
Fusio
โ 2.1kSelf-Hosted API Management for Builders
Korean Law
โ 1.8k๊ตญ๊ฐ๋ฒ๋ น์ ๋ณดMCP v4.0 | ๋ฒ์ ์ฒ 41๊ฐ API โ 17๊ฐ MCP ๋๊ตฌ. ๋ฒ๋ นยทํ๋กยท์กฐ๋ก ๊ฒ์ + LLM ํ๊ฐ ๋ฐฉ์ง ์ธ์ฉ๊ฒ์ฆ + ์กฐ๋ฌธ ์ํฅ ๊ทธ๋ํ(impact_map) + ์์ ๋น๊ต ์๋ diff(time_travel) + ์๋ฏผ 5๋จ๊ณ ์คํ ๊ฐ์ด๋(action_plan) | 41 Korean legal APIs โ 17 MCP tools
RuleGo
โ 1.5kโ๏ธRuleGo is a lightweight, high-performance, embedded, next-generation component orchestration rule engine framework for Go.
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.
Set Up Turn-Based Game in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.