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. | |
| ```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 |