disconnectFromServer
Terminate the connection to the Minecraft server managed by MCP Minecraft Remote, ending remote control and interaction sessions.
Instructions
Disconnect from the Minecraft server
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/connect.ts:103-117 (handler)The handler function that disconnects the bot from the Minecraft server by calling bot.quit(), updating the connection state, and returning appropriate responses.async () => { if (!botState.isConnected || !botState.bot) { return createNotConnectedResponse() } try { botState.bot.quit() updateConnectionState(false, null) return createSuccessResponse( 'Successfully disconnected from the server.' ) } catch (error) { return createErrorResponse(error) } }
- src/tools/connect.ts:99-118 (registration)Registers the 'disconnectFromServer' tool with its description, empty input schema, and inline handler function within registerConnectTools.server.tool( 'disconnectFromServer', 'Disconnect from the Minecraft server', {}, async () => { if (!botState.isConnected || !botState.bot) { return createNotConnectedResponse() } try { botState.bot.quit() updateConnectionState(false, null) return createSuccessResponse( 'Successfully disconnected from the server.' ) } catch (error) { return createErrorResponse(error) } } )