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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"player": "<player>"
},
"name": "kick_player"
}
}Input 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, }; } } );