Spaces:
Sleeping
Sleeping
File size: 1,263 Bytes
551ad28 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# 📚 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.
```bash
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.
```bash
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:
1. Start the game server:
```bash
python start.py
```
2. Start the MCP server:
```bash
python mcp_server.py
```
3. Connect 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 |