Skip to main content
Glama

server_send_command

Send console commands to a running Minecraft server to manage gameplay, permissions, and server settings directly from the MCP interface.

Instructions

Send a command to a running Minecraft server's console. Examples: 'say Hello everyone!', 'op PlayerName', 'whitelist add Player', 'gamemode creative Player', 'time set day', 'weather clear'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
server_idYesServer ID or UUID
commandYesCommand to send to the server console (without leading slash)

Implementation Reference

  • The `server_send_command` tool is registered using `server.tool` and contains the handler implementation that makes a POST request to the Crafty server's stdin endpoint.
    server.tool(
      "server_send_command",
      "Send a command to a running Minecraft server's console. Examples: 'say Hello everyone!', 'op PlayerName', 'whitelist add Player', 'gamemode creative Player', 'time set day', 'weather clear'",
      {
        server_id: z.string().describe("Server ID or UUID"),
        command: z.string().describe("Command to send to the server console (without leading slash)"),
      },
      async ({ server_id, command }) => {
        try {
          const data = await client.post(`/servers/${server_id}/stdin`, { command });
          return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
        } catch (error) {
          const msg = error instanceof Error ? error.message : String(error);
          return { content: [{ type: "text", text: `Error: ${msg}` }], isError: true };
        }
      }
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/HadiCherkaoui/crafty-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server