# mpp-client-net

> Client for MultiplayerPiano.net

Latest version **1.2.4** (published 2026-02-05) · GPL-3.0-only license · 0 weekly downloads

## Install

```sh
npm install mpp-client-net
pnpm add mpp-client-net
yarn add mpp-client-net
bun add mpp-client-net
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.2.4 |
| Published | 2026-02-05 |
| First published | 2023-10-12 |
| Weekly downloads | 0 |
| License | GPL-3.0-only |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 36.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Hri7566 |
| Maintainers | hri7566 |

## Links

- npm: https://www.npmjs.com/package/mpp-client-net
- npm.io page: https://npm.io/package/mpp-client-net

## Dependencies (1)

- [ws](https://npm.io/package/ws.md) ^8.19.0

## Recent versions

- 1.2.4 (latest) — 2026-02-05
- 1.2.3 — 2024-08-12
- 1.2.2 — 2024-08-11
- 1.2.1 — 2024-07-24
- 1.2.0 — 2024-03-20
- 1.1.3 — 2023-10-12

## README

# mpp-client-net

This module is a fork of the [MPP.net client](https://github.com/mppnet/frontend). This module is only meant for [MPP.net](https://multiplayerpiano.net), but it will likely work on any MPP site that uses token-based authentication in the same way as MPP.net.

This is not meant to work in the browser. It is for independent runtimes like Bun, Deno, or Node.js.

## Usage

It is strongly recommended that you keep your bot tokens in a safe place where nobody else can access them.
Personally, I keep mine in a `.env` file in the root of my project, as that is a typical place for project secrets.

For more information on how to interact with the server, see the [MPP.net Protocol Documentation](https://github.com/mppnet/frontend/blob/main/docs/protocol.md).

```env
# .env
MPPNET_TOKEN=your token here
```

```ts
// index.ts

// Load environment variables into process.env (not required for bun)
import { configDotenv } from "dotenv";
configDotenv();

import { Client } from "mpp-client-net";

// Instantiate a new client
const client = new Client("wss://mppclone.com", process.env.MPPNET_TOKEN);

// Connect to the server
client.start();
client.setChannel('test/awkward');

// Listen for chat messages
client.on('a', msg => {
    if (msg.a == "!ping") {
        // Send a chat message back
        client.sendArray([{
            m: "a",
            message: "Pong!"
        }]);
    }
});
```

---
_Source: https://npm.io/package/mpp-client-net · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
