Connect Claude (or any MCP client) to your remote Minecraft server from anywhere
PaperMCP enables AI assistants like Claude to monitor and manage your Minecraft server remotely through the Model Context Protocol (MCP). Perfect for server administrators who want AI-powered automation and monitoring.
[Your PC] [Remote Datacenter]
ββββββββββββββββββββββββββββ ββββββββββββββββββββββββββ
β Claude Desktop β β Minecraft Server β
β β β β βββββββββββββββββββ β
β PaperMCP Client βββββWebSocketββββββββ PaperMCP Plugin β β
β (MCP Server on stdio) β (Internet) β β (WS Server) β β
ββββββββββββββββββββββββββββ β βββββββββββββββββββ β
ββββββββββββββββββββββββββ
Two Components:
- PaperMCP Plugin - Runs on your Minecraft server, exposes WebSocket API
- PaperMCP Client - Runs on your PC, connects Claude to the remote server
- Complete Setup Guide - Step-by-step installation and configuration (START HERE!)
- Usage Examples - Real-world examples of what you can do with AI + Minecraft
- Quick Reference - Fast lookup for commands, configs, and troubleshooting
- Server health (TPS, memory, uptime)
- Online players with locations and stats
- Console logs and output
- Player chat history
- Execute commands (with security controls)
- Send messages to players
- Manage time/weather/gamerules
- Teleport players
- Token-based authentication
- Command whitelist/blacklist with wildcards
- Audit logging
- IP whitelisting (optional)
- Encrypted WebSocket connections (WSS)
# Build the plugin
./gradlew :plugin:build
# Copy to your server
scp plugin/build/libs/PaperMCP-Plugin-1.0.0-SNAPSHOT.jar user@yourserver:/path/to/plugins/Configure Plugin (plugins/PaperMCP/config.yml):
server:
host: "0.0.0.0" # Listen on all interfaces
port: 25577 # WebSocket port
authentication_token: "your-super-secret-token-here" # CHANGE THIS!
mcp:
security:
command_whitelist:
- "list"
- "tps"
- "time*"
- "weather*"
# Add more as needed
command_blacklist:
- "stop"
- "*op*"
- "ban*"
# Blocks dangerous commandsOpen Firewall Port:
# Allow WebSocket connections
sudo ufw allow 25577/tcp# Build the client
./gradlew :client:build
# Copy client JAR to your PC
cp client/build/libs/PaperMCP-Client-1.0.0-SNAPSHOT.jar ~/papermcp/Configure Client (papermcp-client-config.json):
{
"host": "your-minecraft-server.com",
"port": 25577,
"token": "your-super-secret-token-here",
"use_ssl": false,
"reconnect": {
"enabled": true,
"max_attempts": 10,
"delay_ms": 5000
}
}Add to your Claude Desktop config:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"minecraft": {
"command": "java",
"args": [
"-jar",
"/full/path/to/PaperMCP-Client-1.0.0-SNAPSHOT.jar",
"/full/path/to/papermcp-client-config.json"
]
}
}
}- Start your Minecraft server (plugin auto-starts)
- Restart Claude Desktop
- Ask Claude: "What's the TPS on my Minecraft server?"
Get server stats, TPS, version, player count
AI: "How's my server performing?"
List online players with details
AI: "Who's online and where are they?"
Read recent console output
AI: "Show me the last 50 console messages"
Read player chat history
AI: "What have players been talking about?"
Execute server commands (with security)
AI: "Set the time to day and clear the weather"
Send messages to players
AI: "Announce that the server will restart in 10 minutes"
AI: "Check server health every hour and notify me if TPS drops below 18"
AI: "Monitor chat and respond to questions about server rules"
AI: "If anyone complains about lag, check TPS and report back"
AI: "At 8 PM, tp all players to spawn and announce the event"
-
Change Default Token
- Use a long, random token (32+ characters)
- Never commit tokens to git
- Rotate tokens regularly
-
Use Command Whitelist
command_whitelist: - "list" # Only allow specific commands - "tps" - "help" # Empty whitelist = allow all (dangerous!)
-
Enable SSL/TLS
{ "use_ssl": true # In client config }Configure nginx/caddy reverse proxy for SSL termination
-
IP Whitelisting
allowed_ips: - "your.home.ip.address" - "your.office.ip.address/24"
-
Audit Logging
audit_logging: true # Track all AI actions
Only expose WebSocket port, not Minecraft port:
# Good: WebSocket on custom port
sudo ufw allow 25577/tcp
# Don't expose Minecraft port to internet if not needed
# sudo ufw allow 25565/tcp # Only if players connect directlyUse nginx or Caddy as reverse proxy:
Caddy (easiest):
your-minecraft-server.com:25577 {
reverse_proxy localhost:25577
}
nginx:
server {
listen 443 ssl;
server_name mc.yourdomain.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location / {
proxy_pass http://localhost:25577;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}Then use wss://mc.yourdomain.com in client config.
/papermcp status- Show WebSocket server status/papermcp clients- List connected clients/papermcp reload- Reload configuration/papermcp help- Show help
# Run with default config (./papermcp-client-config.json)
java -jar PaperMCP-Client-1.0.0-SNAPSHOT.jar
# Run with custom config
java -jar PaperMCP-Client-1.0.0-SNAPSHOT.jar /path/to/config.json
# Enable debug logging
java -Dlogback.configurationFile=logback-debug.xml -jar PaperMCP-Client-1.0.0-SNAPSHOT.jarRequirements:
- Java 21 (for plugin)
- Java 17+ (for client)
# Build everything
./gradlew build
# Build just plugin (requires Java 21)
./gradlew :plugin:build
# Build just client (requires Java 17+)
./gradlew :client:build
# Outputs:
# plugin/build/libs/PaperMCP-Plugin-1.0.0-SNAPSHOT.jar
# client/build/libs/PaperMCP-Client-1.0.0-SNAPSHOT.jarError: "Please set a secure authentication_token"
- Edit
plugins/PaperMCP/config.yml - Change
CHANGE_ME_TO_A_SECURE_TOKENto a random string
Port Already in Use
- Change
server.portin config.yml - Or stop conflicting service:
sudo lsof -i :25577
Authentication Failed
- Ensure tokens match in plugin and client configs
- Tokens are case-sensitive
Connection Refused
- Check firewall:
sudo ufw status - Verify port is open:
telnet yourserver.com 25577 - Check plugin logs:
logs/latest.log
SSL/TLS Errors
- If using
use_ssl: true, ensure reverse proxy is configured - Check certificate validity
- Try with
use_ssl: falsefirst to isolate issue
Tools Don't Appear
- Restart Claude Desktop after config changes
- Check client logs for errors
- Verify JSON syntax in
claude_desktop_config.json
"Request timed out"
- Client may not be connected to server
- Check client logs
- Verify server is running:
/papermcp status
PaperMCP/
βββ plugin/ # Minecraft server plugin
β βββ src/main/kotlin/com/badgersmc/papermcp/
β βββ PaperMCPPlugin.kt # Main plugin class
β βββ bridge/ # Minecraft API bridge
β β βββ MinecraftBridge.kt
β β βββ EventListeners.kt
β βββ websocket/ # WebSocket server
β βββ WebSocketServer.kt
β βββ RequestHandler.kt
β
βββ client/ # PC client application
βββ src/main/kotlin/com/badgersmc/papermcp/client/
βββ PaperMCPClient.kt # Main entry point
βββ ClientConfig.kt # Configuration
βββ websocket/ # WebSocket client
β βββ WebSocketClient.kt
βββ mcp/ # MCP protocol
βββ MCPProtocolHandler.kt
βββ ToolRegistry.kt
1. Add method to RequestHandler.kt (plugin)
private fun handleMyNewTool(id: Any?, params: JsonObject?): JsonObject {
// Implement tool logic
return createSuccess(id, result)
}2. Add tool to ToolRegistry.kt (client)
class MyNewTool : MCPTool {
override val name = "minecraft_my_tool"
override val definition = ToolDefinition(...)
override fun execute(client: WebSocketClient, arguments: JsonObject) =
client.sendRequest("my_new_tool", arguments)
.thenApply { it.get("result").asJsonObject }
}./gradlew test- WebSocket server plugin
- Remote client with MCP protocol
- Token authentication
- Command execution with security
- Chat and console monitoring
- SSL/TLS support (native)
- Inventory management tools
- World editing capabilities
- Multi-server support (proxy mode)
- Web dashboard
- Metrics and analytics
- Plugin API for extensions
Q: Is this secure for production use? A: With proper configuration (strong tokens, command whitelist, SSL, IP filtering), yes. Always audit what AI has access to.
Q: Does this work with Forge/Fabric? A: Currently only Paper/Spigot. Forge/Fabric support planned.
Q: Can multiple people connect? A: Yes, the WebSocket server supports multiple concurrent clients.
Q: What's the performance impact? A: Minimal. The plugin uses async I/O and runs on separate threads.
Q: Does this work with BungeeCord/Velocity? A: Yes, install the plugin on each backend server. Proxy support coming soon.
Q: What Java version is required? A: The plugin requires Java 21 (for Minecraft 1.21+). The client requires Java 17+. Make sure your server is running Java 21 before installing the plugin.
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes with tests
- Submit a pull request
- Issues: GitHub Issues
- Pull Requests: Contributions welcome!
- Docs: See the markdown files in this repository
Built with β€οΈ by BadgersMC
Technologies:
- Model Context Protocol by Anthropic
- Paper MC - High-performance Minecraft server
- Javalin - Lightweight web framework
- Kotlin - Modern JVM language