
mcsrv mcp server
一个为大语言模型提供API的Minecraft服务器插件,支持日志访问、聊天监控和命令执行。
Repository Info
About This Server
一个为大语言模型提供API的Minecraft服务器插件,支持日志访问、聊天监控和命令执行。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
MCP Tools Server
MCP Tools Server is a Minecraft server plugin that provides an API for Large Language Models (LLMs) to interact with your Minecraft server. It leverages the Model Context Protocol (MCP) to expose server functionality as tools that can be called by AI assistants.
Features
- Server Logs Access: View server logs remotely through the API
- Chat Monitoring: Access player chat messages and Discord messages (via DiscordSRV)
- Command Execution: Execute Minecraft commands remotely
- MCP Compatibility: Follows the Model Context Protocol for seamless integration with LLMs
- DiscordSRV Integration: Connect your Minecraft server chat with Discord
Requirements
- Minecraft server running Paper/Spigot 1.19+
- Java 17 or higher
- DiscordSRV plugin (optional, for Discord integration)
Installation
- Download the latest release JAR file from the Releases page
- Place the JAR file in your server's
pluginsfolder - Restart your server
- The plugin will generate a default configuration file at
plugins/MCPToolsServer/config.yml - Edit the configuration file to customize settings (see Configuration section)
- Use
/mcptools reloadin-game to apply changes
Configuration
The plugin's configuration file (config.yml) contains the following sections:
mcp:
server:
port: 8080 # Port for the MCP server
https: false # Whether to use HTTPS
access-token: "" # Access token for authentication (empty = no auth)
logs:
max-lines: 1000 # Maximum number of log lines to store
include-console: true # Include console logs
include-chat: true # Include player chat
include-commands: true # Include command execution
chat:
max-messages: 100 # Maximum number of chat messages to store
include-discord: true # Include Discord messages
commands:
allowed-prefixes: [] # Allowed command prefixes (empty = all)
blocked-prefixes: # Blocked command prefixes
- "op"
- "deop"
- "ban"
- "kick"
- "stop"
- "reload"
log-execution: true # Log command execution
API Usage
The plugin exposes an HTTP API that follows the Model Context Protocol (MCP). The API endpoints are:
GET /info- Get server informationGET /tools/list- List available toolsPOST /tools/call- Call a tool
Available Tools
1. View Logs (view_logs)
Retrieves server logs.
Parameters:
limit(integer, optional): Number of log lines to return (default: 50, max: 1000)filter(string, optional): Filter logs by textlogType(string, optional): Type of logs to return ("all", "console", "chat", "command")
Example Request:
{
"name": "view_logs",
"arguments": {
"limit": 100,
"filter": "error",
"logType": "console"
}
}
2. View Chat (view_chat)
Retrieves chat messages.
Parameters:
limit(integer, optional): Number of messages to return (default: 20, max: 100)player(string, optional): Filter messages by player nameincludeDiscord(boolean, optional): Whether to include Discord messages (default: true)
Example Request:
{
"name": "view_chat",
"arguments": {
"limit": 50,
"player": "Steve",
"includeDiscord": true
}
}
3. Execute Command (execute_command)
Executes a Minecraft command.
Parameters:
command(string, required): Command to execute (without leading slash)asConsole(boolean, optional): Whether to execute as console (default: true)player(string, optional): Player to execute as (only if asConsole is false)
Example Request:
{
"name": "execute_command",
"arguments": {
"command": "time set day",
"asConsole": true
}
}
Example: Calling the API with curl
# List available tools
curl -X GET http://localhost:8080/tools/list
# View logs
curl -X POST http://localhost:8080/tools/call \
-H "Content-Type: application/json" \
-d '{"name":"view_logs","arguments":{"limit":50}}'
# Execute a command
curl -X POST http://localhost:8080/tools/call \
-H "Content-Type: application/json" \
-d '{"name":"execute_command","arguments":{"command":"say Hello from API"}}'
Integration with LLMs
This plugin is designed to be used with Large Language Models that support the Model Context Protocol. The API allows LLMs to:
- Discover available tools via the
/tools/listendpoint - Call tools via the
/tools/callendpoint - Process the results and take further actions
Commands and Permissions
/mcptools reload- Reload the plugin configuration (Permission:mcptools.admin)/mcptools status- Show the current plugin status (Permission:mcptools.admin)
Building from Source
- Clone the repository
- Build using Maven:
mvn clean package - The compiled JAR will be in the
targetdirectory
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Quick Start
Clone the repository
git clone https://github.com/metrovoc/mcsrv-mcp-serverInstall dependencies
cd mcsrv-mcp-server
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.