Class reference

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

bool is_running() const

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.

Source revision 5592dc3a7a61
Connection interrupted. Reload×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.