Skip to content

Repository files navigation

CCA Client

English | 简体中文

CCA Client (Console Command API Client) is the WebSocket server component that provides centralized command management for multiple MCDReforged servers. It acts as a relay between external clients (bots, APIs) and MCDR plugin instances.

This project is part of the Console Command API system:

Features

  • Centralized WebSocket server for command relay
  • Bearer token authentication for secure access
  • Multi-server routing via unique server_name
  • Command request/response message protocol
  • Health check endpoint for monitoring
  • HTTP REST API for additional operations
  • Automatic plugin connection management
  • Graceful handling of plugin disconnections

Requirements

  • Python 3.8+
  • websockets>=12.0
  • pyyaml

Installation

  • Click "Download zip" on the code page
  • Extract to your desired location and double-click start.bat to run

First Run

On first startup, the server will:

  1. Generate a random token for authentication
  2. Create config.yaml with default settings
  3. Display the token in the console

Important: Copy this token - you'll need it for plugin configuration. You can also view the token later in config.yaml.

[INFO] Token generated: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
[INFO] Please add this token to the plugin's config.json

Configuration

config.yaml

host: "0.0.0.0"
port: 8001
http_host: "0.0.0.0"
http_port: 8000
token: ""  # Leave empty to auto-generate on first run
timeout: 30.0
max_connections: 100
log_level: "INFO"
Field Type Default Description
host string 0.0.0.0 Bind address. Use 127.0.0.1 for localhost only.
port int 8001 WebSocket listen port
http_host string 0.0.0.0 Bind address. Use 127.0.0.1 for localhost only.
http_port int 8000 HTTP listen port
token string (auto) Bearer token. Auto-generated if empty.
timeout float 30.0 Command execution timeout (seconds).
max_connections int 100 Max concurrent WebSocket connections.
log_level string INFO Log level: DEBUG, INFO, WARNING, ERROR.

HTTP API

You can view the API documentation at:

http://host:port/docs

License

MIT License. See LICENSE for details.

Related Projects

About

Unified entry point for the MCDReforged plugin console_command_api

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages