kick_player
Remove a player from a Minecraft server with an optional reason, enabling administrator-level moderation and player management through the MCP protocol.
Instructions
Kick a player from the server with an optional reason.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| player | Yes | Player name | |
| reason | No | Kick reason message |
Implementation Reference
- src/tools/player-tools.ts:88-112 (handler)The kick_player tool handler registers the MCP tool, defines its schema using Zod, and executes the kick command via RCON.
server.tool( "kick_player", "Kick a player from the server with an optional reason.", { player: z.string().describe("Player name"), reason: z.string().optional().describe("Kick reason message"), }, async ({ player, reason }) => { const cmd = reason ? `kick ${player} ${reason}` : `kick ${player}`; try { const response = await manager.rcon.send(cmd); return { content: [{ type: "text", text: response }] }; } catch (error) { return { content: [ { type: "text", text: `Failed: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } } );