This is a Model Context Protocol (MCP) server that interfaces with a Moonraker instance to control a 3D printer.
- Get printer state
- Emergency stop
- Firmware restart
- Pause, resume, cancel print jobs
- Get print status
- Return a live webcam view of the printer
- Get job queue status
- Enqueue jobs to the queue
- Remove jobs from the queue
- Pause the job queue
- Start the job queue
- Jump a job to the front of the queue
- Set nozzle temperature
- Set bed temperature
- Set enclosure temperature
- Get current temperatures
- Docker and Docker Compose installed
- Moonraker instance running
-
Clone or ensure you have the project files.
-
Set the
MOONRAKER_URLenvironment variable if different from default:export MOONRAKER_URL=http://your-moonraker-ip -
(Optional) Set the
API_KEYenvironment variable for authentication:export API_KEY=your-secret-api-key -
Build and run the containers:
docker-compose up --build
-
The server will be accessible at
http://localhost(or your server's IP) on port 80. -
When accessing, provide the API key in the X-API-Key header if API_KEY is set.
The MCP server can be used by MCP clients (e.g., Poke) by connecting to the HTTP endpoint with API key authentication.
Note: If API_KEY is set, the client must provide the X-API-Key header in requests.
MOONRAKER_URL: URL of the Moonraker instance (default: http://192.168.1.124)API_KEY: Optional API key for securing the server (if set, clients must provide X-API-Key header)
docker-compose down