SPDX-License-Identifier: AGPL-3.0-or-later
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
-->
crafty-mcp
An MCP (Model Context Protocol) server for Crafty Controller 4 — manage your Minecraft servers via AI assistants.
> The first MCP server for Crafty Controller.
What it does
crafty-mcp exposes the full Crafty Controller 4 API V2 as MCP tools, letting AI assistants like Claude manage your Minecraft servers using natural language. Start and stop servers, send console commands, manage players, edit server files, configure backups, set up scheduled tasks, manage webhooks, and administer users — all without leaving your AI chat.
Quick Start
Add to your MCP client config:
**Claude Desktop** (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):
**Claude Code:**
**Cursor** (.cursor/mcp.json):
Configuration
| Variable | Required | Description |
|----------|----------|-------------|
| CRAFTY_URL | Yes | Crafty Controller base URL (e.g. https://localhost:8443) |
| CRAFTY_API_TOKEN | No* | Bearer token from Crafty UI |
| CRAFTY_ALLOW_INSECURE | No | Set to true to allow self-signed certificates (Crafty's default) |
| CRAFTY_TIMEOUT | No | Request timeout in milliseconds (default: 30000) |
> *CRAFTY_API_TOKEN is optional if you authenticate dynamically using the crafty_login tool, but recommended for most setups.
Getting your API token
1. Open Crafty Controller in your browser
2. Click your username -> **Profile**
3. Scroll to **API Keys** section
4. Click **Generate Key**
5. Copy the token and use it as CRAFTY_API_TOKEN
> A superuser token has full access to all servers and operations.
Available Tools
Auth / Meta
| Tool | Description |
|------|-------------|
| crafty_login | Login with username/password to get a bearer token |
| crafty_api_info | Get API version info and MOTD |
| crafty_list_schemas | List available JSON schema names |
| crafty_get_schema | Get a specific JSON schema by name |
Crafty Host (System)
| Tool | Description |
|------|-------------|
| crafty_get_stats | Get host CPU, RAM, disk, and boot time |
| crafty_get_config | Get Crafty panel configuration |
| crafty_update_config | Update Crafty panel configuration |
Servers — CRUD & Info
| Tool | Description |
|------|-------------|
| server_list | List all managed Minecraft servers |
| server_get | Get a server's full configuration |
| server_create | Create a new Minecraft server (Java, Bedrock, custom) |
| server_update | Update server configuration |
| server_delete | Permanently delete a server |
Servers — Runtime & Logs
| Tool | Description |
|------|-------------|
| server_get_stats | Get live stats: CPU/RAM, players online, version, world |
| server_get_logs | Get server console log lines |
| server_get_history | Get historical stats for graphing |
Servers — Actions
| Tool | Description |
|------|-------------|
| server_start | Start a server |
| server_stop | Stop a server |
| server_restart | Restart a server |
| server_kill | Force-kill a server process |
| server_backup | Trigger an immediate backup |
| server_update_executable | Update the server jar/executable |
| server_clone | Clone an existing server |
Servers — Console