npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@minecraft-docker/mcctl-api

v2.2.0

Published

REST API server for managing Docker Minecraft servers

Readme

@minecraft-docker/mcctl-api

REST API server for managing Docker Minecraft servers.

Installation

Native Execution (Recommended)

The recommended way to run mcctl-api is natively with Node.js and PM2.

Prerequisites

  • Node.js 20+
  • pnpm (or npm/yarn)
  • PM2 (for production deployment)
  • Docker and Docker Compose (for managing Minecraft servers)

Setup

# From the project root
pnpm install
pnpm --filter @minecraft-docker/mcctl-api build

# Start in development mode
cd platform/services/mcctl-api
pnpm dev

# Or start in production mode
pnpm start

PM2 Deployment

# Install PM2 globally
npm install -g pm2

# Start with PM2
cd platform/services/mcctl-api
pnpm start:pm2

# Other PM2 commands
pnpm stop:pm2      # Stop the service
pnpm restart:pm2   # Restart the service
pnpm logs:pm2      # View logs

Docker (Legacy)

Docker deployment is deprecated but still supported for legacy installations.

# From project root
docker build -f platform/services/mcctl-api/docker/Dockerfile -t mcctl-api .

docker run -d \
  --name mcctl-api \
  -p 5001:5001 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v ~/minecraft-servers:/data \
  -e MCCTL_ROOT=/data \
  mcctl-api

Configuration

Environment Variables

| Variable | Description | Default | |----------|-------------|---------| | PORT | API server port | 5001 | | HOST | Bind address | 0.0.0.0 | | NODE_ENV | Environment (development, production, test) | development | | LOG_LEVEL | Log level (fatal, error, warn, info, debug, trace) | debug (dev) / info (prod) | | MCCTL_ROOT | Root directory for mcctl data | ~/minecraft-servers | | PLATFORM_PATH | Platform directory with docker-compose.yml | Same as MCCTL_ROOT | | AUTH_MODE | Authentication mode | disabled (dev) / api-key (prod) | | AUTH_API_KEY | API key for authentication | - | | AUTH_IP_WHITELIST | Comma-separated IP whitelist | - | | SWAGGER_ENABLED | Enable Swagger UI in production | false |

Authentication Modes

  • disabled: No authentication (development only)
  • api-key: Require X-API-Key header
  • ip-whitelist: Restrict access by IP address
  • basic: HTTP Basic authentication
  • combined: Require both API key and IP whitelist

Example .env

PORT=5001
HOST=0.0.0.0
NODE_ENV=production
LOG_LEVEL=info
MCCTL_ROOT=/home/user/minecraft-servers
AUTH_MODE=api-key
AUTH_API_KEY=your-secret-api-key

API Endpoints

  • GET /health - Health check
  • GET /api/servers - List all servers
  • GET /api/servers/:name - Get server details
  • POST /api/servers/:name/start - Start server
  • POST /api/servers/:name/stop - Stop server
  • POST /api/servers/:name/restart - Restart server
  • GET /api/servers/:name/logs - Get server logs
  • POST /api/servers/:name/exec - Execute RCON command
  • GET /api/worlds - List all worlds
  • POST /api/console/exec - Execute RCON command

Graceful Shutdown

The API server handles graceful shutdown for:

  • SIGTERM - Sent by PM2 and container orchestrators
  • SIGINT - Sent by Ctrl+C

This ensures:

  • Active requests are completed
  • Connections are properly closed
  • Resources are cleaned up

Development

# Run tests
pnpm test

# Run tests in watch mode
pnpm test:watch

# Start development server with hot reload
pnpm dev

Documentation

API documentation is available at /docs when running in development mode or when SWAGGER_ENABLED=true.