A newer version of the Gradio SDK is available:
6.1.0
MCP Server Guide
This application functions as an MCP (Model Context Protocol) Server. External LLMs can connect to this server and use game management tools.
Connection URL
https://mcp-1st-birthday-unpredictable-lord.hf.space/gradio_api/mcp/
For local development:
http://localhost:7860/gradio_api/mcp/
How to Connect
Add the following to your MCP settings configuration.
VS Code
{
"servers": {
"unpredictable-lord": {
"url": "https://mcp-1st-birthday-unpredictable-lord.hf.space/gradio_api/mcp/"
"type": "http"
}
},
"inputs": []
}
Claude Desktop / Cursor
{
"mcpServers": {
"unpredictable-lord": {
"url": "https://mcp-1st-birthday-unpredictable-lord.hf.space/gradio_api/mcp/"
}
}
}
Available Tools
| Tool | Description |
|---|---|
init_game |
Initialize a new game session. Returns a session_id and available advice options. |
get_game_state |
Get the current game state for a session. |
list_available_advice |
Get all available advice options for execute_turn. |
execute_turn |
Execute a turn with the given advice. Returns whether advice was adopted and results. |
Usage Flow
- Call
init_game(<personality>)to start a new game session - User gives advice to the Lord AI
- Lord AI interprets advice and calls
execute_turn(session_id, advice) - Lord AI explains the result to the user (adopted/rejected, action taken, effects)
- Repeat from step 2 until game over