MCPcopy Index your code
hub / github.com/EnriqCG/rcon-srcds

github.com/EnriqCG/rcon-srcds @v2.1.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.1.1 ↗ · + Follow
17 symbols 27 edges 4 files 6 documented · 35% 1 cross-repo links updated 2mo agov2.1.1 · 2026-04-15★ 624 open issues

Browse by type

Functions 13 Types & classes 4
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

RCON library for NodeJS

According to Valve's RCON specification

Install

npm install rcon-srcds --save

Usage

// ES5 import
const Rcon = require('rcon-srcds').default

// ES5+ import
import Rcon from 'rcon-srcds';

Options

These are the default values.

{
    host: '127.0.0.1',          // Host
    port: 27015,                // Port
    maximumPacketSize: 0,       // Maximum packet bytes (0 = no limit)
    encoding: 'ascii',          // Packet encoding (ascii, utf8)
    timeout: 1000               // in ms
}

The maximum possible value of packet size is 4096 bytes: https://developer.valvesoftware.com/wiki/Source_RCON_Protocol#Packet_Size

Minecraft Compatibility

Although the package name implies exclusive compatibility with Source games, Minecraft servers also use Valve's RCON implementation, so there should not be any issues using this package for your Minecraft projects!

Examples

Using async/await:

import Rcon from 'rcon-srcds';
const server = new Rcon({ host: '127.0.0.1', port: 25010 });
try {
    await server.authenticate('your_rcon_password');
    console.log('authenticated');
    let status = await server.execute('status'); // You can read `status` reponse
    server.execute('mp_autokick 0'); // no need to read the response
} catch(e) {
    console.error(e);
}

Using (native) promises:

import Rcon from 'rcon-srcds';
const server = new Rcon({ port: 25010 });

server.authenticate('rcon_password')
    .then(() => {
        console.log('authenticated');
        return server.execute('status');
    })
    .then(console.log)
    .catch(console.error);

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 11
Class 2
Function 2
Interface 2

Languages

TypeScript100%

Modules by API surface

src/rcon.ts14 symbols
src/packet.ts3 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add rcon-srcds \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page