jeu-plaza-mcp-server
v1.0.4
Published
MCP server for Jeu Plaza game management
Downloads
11
Maintainers
Readme
Jeu Plaza MCP Server
An MCP (Model Context Protocol) server for managing games in the Jeu Plaza platform. This server allows users to create, update, and manage their canvas-based games using their wallet address through secure API endpoints.
Features
- create_game: Create a new game for a wallet address
- update_game: Update an existing game with new requirements
- list_games: List all games owned by a wallet address
- get_game: Retrieve a specific game's code and details
Security
This MCP server uses secure API endpoints instead of direct database access:
- All requests are authenticated using API keys
- Communication happens through your application's REST API
- No direct database credentials are exposed to users
- Rate limiting and validation handled by your main application
Installation
cd mcp-server
npm installDevelopment
npm run devBuild
npm run build
npm startEnvironment Variables
Create a .env file in the mcp-server directory:
# Base URL of your running Jeu Plaza application
# For production: https://crossfi-v0.vercel.app/
# For development: http://localhost:3000
API_BASE_URL=https://crossfi-v0.vercel.app/
# Secure API key (must match MCP_API_KEY in your main app's .env.local)
API_KEY=jeu-plaza-mcp-secure-key-2024Usage with MCP Client
Tool: create_game
Creates a new game for a wallet address with integrated AI generation. This tool combines game creation and AI code generation into a single streamlined operation.
Parameters:
walletAddress(string): The wallet address of the game ownergameName(string): The name of the game to creategamePrompt(string): Description of the game to generate
Example:
{
"walletAddress": "0x1234567890abcdef1234567890abcdef12345678",
"gameName": "Space Invaders",
"gamePrompt": "Create a space invaders game with moving aliens and a player ship that can shoot"
}Process:
- Creates a new game record in the database
- Automatically generates game code using AI based on the provided prompt
- Saves the generated code as the first checkpoint
- Returns the complete game information including the AI-generated description
Note: This streamlined approach eliminates the need for separate game creation and code generation steps, making the process more efficient and user-friendly.
Tool: update_game
Updates an existing game with new requirements. The server automatically retrieves the current game code and generates an updated version based on the provided prompt.
Parameters:
walletAddress(string): The wallet address of the game ownergameName(string): The name of the game to updateupdatePrompt(string): Description of changes to make
Example:
{
"walletAddress": "0x1234567890abcdef1234567890abcdef12345678",
"gameName": "Space Invaders",
"updatePrompt": "Add power-ups that increase fire rate and add particle effects when aliens are destroyed"
}Process:
- Validates the game exists and is owned by the wallet address
- Automatically retrieves the latest game code from checkpoints
- Generates updated code using AI with the current code as context
- Saves the updated code as a new checkpoint
Tool: list_games
Lists all games for a wallet address.
Parameters:
walletAddress(string): The wallet address to list games for
Tool: get_game
Retrieves a specific game's complete code and details.
Parameters:
walletAddress(string): The wallet address of the game ownergameName(string): The name of the game to retrieve
Integration with Main App
This MCP server communicates with your Jeu Plaza application through secure REST API endpoints:
POST /api/games- Create new gamesPUT /api/games/[gameName]- Update existing gamesGET /api/games- List games by wallet addressGET /api/games/[gameName]- Get specific game details
Games created or updated through the MCP server are immediately available in the web interface since they use the same backend API.
API Endpoints
The main application includes these new API routes for MCP integration:
- Authentication: All requests require
Authorization: Bearer <API_KEY>header - Validation: Request data is validated using Zod schemas
- AI Integration: Uses your existing
generateGameCodeflow for game creation/updates - Error Handling: Proper HTTP status codes and error messages
Setup Instructions
Option 1: Production API (Recommended)
Use the live production deployment at https://crossfi-v0.vercel.app/
Add to your MCP client configuration:
{
"mcpServers": {
"jeu-plaza": {
"command": "npx",
"args": ["jeu-plaza-mcp-server@latest"],
"env": {
"API_BASE_URL": "https://crossfi-v0.vercel.app/",
"API_KEY": "jeu-plaza-mcp-secure-key-2024"
},
"disabled": false,
"autoApprove": ["list_games", "get_game"]
}
}
}Benefits:
- No need to run the main application locally
- Always up-to-date with the latest features
- Production-grade performance and reliability
- Immediate access to the live game database
Option 2: Local Development
For development and testing with your local instance:
- Start your main Jeu Plaza application:
npm run dev # Main app should be running on http://localhost:3000- Add to your MCP client configuration:
{
"mcpServers": {
"jeu-plaza": {
"command": "npx",
"args": ["jeu-plaza-mcp-server@latest"],
"env": {
"API_BASE_URL": "http://localhost:3000",
"API_KEY": "jeu-plaza-mcp-secure-key-2024"
},
"disabled": false,
"autoApprove": ["list_games", "get_game"]
}
}
}Option 3: Local MCP Server Development
For advanced development where you want to modify the MCP server itself:
- Configure MCP server:
cd mcp-server
cp .env.example .env
# Edit .env with your API_BASE_URL and API_KEY- Install and run MCP server:
npm install
npm run build
npm start- Add to your MCP client configuration:
{
"mcpServers": {
"jeu-plaza": {
"command": "node",
"args": ["dist/index.js"],
"cwd": "./mcp-server",
"env": {
"API_BASE_URL": "https://crossfi-v0.vercel.app/",
"API_KEY": "jeu-plaza-mcp-secure-key-2024"
},
"disabled": false,
"autoApprove": ["list_games", "get_game"]
}
}
}Notes
- Uses your existing AI flow from
ai/flows/generate-game-code.ts - All games are canvas-based following the platform's architecture
- Wallet addresses are used as the primary ownership mechanism
- Secure API communication with proper authentication
- No direct database access - all operations go through your app's API layer
