Back to Home
github-samples icon

turn-based-game-mcp

Verified Safe

by github-samples

Overview

Demonstrates the Model Context Protocol (MCP) by providing a turn-based games platform with an AI opponent that interacts with a Next.js frontend.

Installation

Run Command
npm run start --workspace=mcp-server

Environment Variables

  • GAMES_DB_PATH
  • WEB_API_BASE
  • NODE_ENV
  • VITEST

Security Notes

The project implements explicit data sanitization for MCP API endpoints (`/api/games/rock-paper-scissors/mcp`) to prevent the AI from accessing current, uncommitted player moves, which is a strong security measure against cheating. API communication defaults to `http://localhost:3000` which is safe for local development, and allows configuration via `process.env.WEB_API_BASE`. Input validation is performed for game moves. No hardcoded sensitive secrets or 'eval' statements were found. The architecture provides good separation of concerns.

Similar Servers

Stats

Interest Score42
Security Score9
Cost ClassLow
Avg Tokens1
Stars25
Forks14
Last Update2026-01-13

Tags

Turn-based gamesAI opponentModel Context ProtocolNext.jsTypeScript