MCPGame

MCPGame

A multiplayer first-person 3D virtual house environment with interactive elements including a TV with image display system and computer terminal for accessing MCP systems.

Category
访问服务器

README

MCPGame

A multi-player control panel game with Node.js backend featuring a virtual house environment with interactive elements.

Features

  • Immersive first-person 3D virtual house with outdoor environment
  • Beautifully detailed house with interior and exterior features
  • Interactive door to enter and exit the house
  • Garden area with trees, plants, and decorative elements
  • Interactive TV with image generation capabilities
  • Computer terminal for accessing MCP systems
  • Realistic movement and collision detection
  • Real-time server communication

Setup

  1. Install dependencies:
npm install
  1. Run the server:
npm start

Or for development with auto-restart:

npm run dev

The server will start on port 3002.

Game Controls

  • Movement: WASD keys
  • Look around: Mouse movement (click on game to enable)
  • Interact: Press ENTER when near interactive objects
  • Exit interfaces: ESC key
  • Exit mouse lock: ESC key

Interactive Elements

Outdoor Environment

  • Explore the terrain with trees and garden beds
  • Follow the path to the house entrance
  • Press ENTER when near the door to enter/exit the house

TV System

  • Approach the TV and press ENTER to access the remote control
  • Generate images that will display on the TV screen
  • Type a prompt for image generation in the terminal interface

MCP Terminal

  • Find the computer desk and press ENTER to access the terminal
  • Send commands to the MCP system
  • Access various virtual tools (email, web search, etc.)

Technical Details

  • Built with Three.js for 3D rendering
  • First-person camera with pointer lock controls
  • Outdoor environment with procedurally placed trees
  • Express.js server for backend communication
  • Canvas library for image generation
  • RESTful API for server communication

MCP Game Image System

This document explains how the image display system works in the MCP Game.

Overview

The system displays existing images from the server/openai-server/public/image directory on the TV in the virtual house. Instead of generating new images, which was causing 500 Internal Server errors, the system now checks for existing images in the specified directory.

How It Works

  1. The TV in the virtual house displays images that exist in the server/openai-server/public/image directory.
  2. The system checks for new images every 10 seconds.
  3. When a user requests a new image through the TV remote interface, the system selects a random image from the directory.

Adding New Images

To add new images to the TV:

  1. Place image files (jpg, jpeg, png, gif, webp) in the server/openai-server/public/image directory.
  2. The system will automatically detect and display them.
  3. Files should be a reasonable size for web display (recommended: 800x450 pixels).

Usage

  1. Approach the TV in the virtual house.
  2. Press Enter to access the TV remote control interface.
  3. Type any command related to displaying images.
  4. The system will select and display an image from the available ones in the directory.

Troubleshooting

  • If no images are displayed, check if the server/openai-server/public/image directory exists and contains image files.
  • Make sure the server is running on the correct port (default: 3002).
  • Check the browser console for any error messages related to image loading.

Technical Details

  • The system no longer attempts to generate images directly, avoiding the 500 Internal Server errors.
  • Images are selected randomly from the directory when requested.
  • The system provides appropriate feedback when no images are available.

Connecting to MCP Backend Server

The MCPGame can connect to an external MCP Backend Server to enable advanced AI functionality for the terminal and TV interactions.

Configuration

  1. Open the main.js file and locate the configuration section at the top:
// --- Configuration ---
const MCP_BACKEND_URL = 'http://localhost:3001'; // MCP Terminal backend connection
const IMAGE_SERVER_URL = 'http://localhost:3002'; // Image server connection
  1. Update the MCP_BACKEND_URL to point to your MCP Backend Server:
    • For local development: http://localhost:PORT (replace PORT with your backend port)
    • For production: Use the full URL to your deployed backend server

Required API Endpoints

Your MCP Backend Server should implement these endpoints:

  1. GET /api/status - Returns the status of the MCP system
  2. POST /api/query - Accepts user queries and returns AI responses

Response Format

The query endpoint should return JSON in this format:

{
  "response": "Text to display in the terminal",
  "spokenResponse": "Optional text for voice synthesis" 
}

Testing the Connection

  1. Start your MCP Backend Server
  2. Start the MCPGame server (node server.js)
  3. Open the game in a browser
  4. Interact with the computer terminal in the virtual house
  5. The game will connect to your MCP Backend Server when you use the terminal

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选