send-chat
Send custom chat messages in Minecraft using the MCP Server. Enables AI-controlled characters or bots to communicate in-game through predefined commands.
Instructions
Send a chat message in-game
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | Message to send in chat |
Implementation Reference
- src/bot.ts:532-548 (registration)The registerChatTools function contains the registration of the 'send-chat' tool using server.tool(). It includes the tool name, description, input schema (message: string), and the inline handler function that executes bot.chat(message) to send the chat message in the Minecraft game.function registerChatTools(server: McpServer, bot: any) { server.tool( "send-chat", "Send a chat message in-game", { message: z.string().describe("Message to send in chat") }, async ({ message }): Promise<McpResponse> => { try { bot.chat(message); return createResponse(`Sent message: "${message}"`); } catch (error) { return createErrorResponse(error as Error); } } ); }
- src/bot.ts:539-546 (handler)Inline handler function for the send-chat tool. It receives the message parameter and calls bot.chat(message) to send it, then returns a success response.async ({ message }): Promise<McpResponse> => { try { bot.chat(message); return createResponse(`Sent message: "${message}"`); } catch (error) { return createErrorResponse(error as Error); } }
- src/bot.ts:536-538 (schema)Input schema for the send-chat tool, defining a required 'message' parameter as a string.{ message: z.string().describe("Message to send in chat") },