Spaces:
Sleeping
Sleeping
๐ Examples
This directory contains example scripts demonstrating various features of the RTS game.
๐ค MCP Integration Examples
mcp_client_example.py
Demonstrates how to connect to the RTS game MCP server and interact with the game programmatically.
python examples/mcp_client_example.py
This example shows:
- How to connect to the MCP server
- Available commands for interacting with the game
- How to use the MCP integration with AI clients like Claude
mcp_connection_test.py
A simple test script that demonstrates how to connect to the MCP server and shows available tools and resources.
python examples/mcp_connection_test.py
This example shows:
- How to import and create an MCP server instance
- Available tools and resources
- Basic connection information
Usage
To use the MCP integration:
Start the game server:
python start.pyStart the MCP server:
python mcp_server.pyConnect an AI client to the MCP server at
localhost:8001
The AI client will be able to:
- Retrieve the current game state
- Get tactical analysis from the built-in AI
- Perform actions in the game (move units, attack, build structures)
- Access game documentation and rules