Attention: Here be dragons (unstable version)
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Redot.
Checking the stable version of the documentation...
MCPServer
Inherits: Object
Stdio-based MCP (Model Context Protocol) server for AI agent integration.
Description
The MCP server exposes the running Redot project to AI coding assistants over a JSON-RPC stdio transport. It is started with the --mcp-server command-line flag, which implies headless mode. The server reads newline-delimited JSON-RPC requests on stdin and writes responses to stdout. A TCP bridge (MCPBridge) is used to forward tool calls (screenshots, input, tree inspection) to a separately launched game process. See the MCP specification for protocol details.
Methods
is_running() const |
|
void |
start() |
void |
stop() |
Method Descriptions
Returns true while the server loop is processing requests.
void start() 🔗
Starts the blocking server loop. Reads requests from stdin and dispatches them to the registered protocol handlers. Returns when the input stream is closed or stop() is requested.
void stop() 🔗
Signals the server loop to stop and wakes the stdin poll.