Generic WebSocket gateway SDK for Minecraft Bedrock Edition
Project description
mcbe-ws-sdk
Generic WebSocket gateway SDK for Minecraft Bedrock Edition.
It owns the WS transport, packet protocol, and byte-safe command chunking
(461-byte hard limit). Your host injects behaviour through ConnectionHook and
ResponseSink, and drives the stack with McbeServerFacade.
There is no message broker and no LLM worker inside the SDK — those stay in the host application.
Minecraft client ←── /wsserver IP:port ──→ Your Python host (this SDK)
Install
pip install mcbe-ws-sdk
Editable install for development:
pip install -e ".[dev,docs]"
Requires Python 3.11+.
30-second taste
import asyncio
from mcbe_ws_sdk import McbeServerFacade, NoOpHook
class MyHook(NoOpHook):
async def on_connected(self, state):
print("connected:", state.id)
async def on_player_message(self, state, event, parsed=None):
print(f"{event.sender}: {event.message}")
async def main() -> None:
facade = McbeServerFacade(hook=MyHook())
print(f"ws://{facade.settings.websocket.host}:{facade.settings.websocket.port}")
await facade.run_lifetime()
if __name__ == "__main__":
asyncio.run(main())
Then in Minecraft: /wsserver <this-machine-ip>:8080
For a reply-with-tellraw host, run the ready-made example:
python examples/basic-server/server.py
Documentation
Full beginner tutorial, architecture, protocol, and API reference live on the docs site (English + 中文):
| Online | https://rice-awa.github.io/mcbe-ws-sdk/ |
| Local | pip install -e ".[docs]" && mkdocs serve → http://127.0.0.1:8000 |
| Page | Content |
|---|---|
| Getting Started | Install, 5-minute walkthrough, minimal echo bot, FAQ |
| Architecture | Layer stack and dependency inversion |
| Protocol | mcbews v1 bridge wire format |
| API Reference | Generated from source |
Examples
| Path | What it shows |
|---|---|
examples/basic-server/ |
Echo chat with tellraw (start here) |
examples/addon-server/ |
Capability calls via the companion addon |
examples/addon-capability-call/ |
In-memory bridge round-trip (no game) |
Companion TypeScript addon: addon/. Worlds that load it must enable
Experiments → Beta APIs (see addon README).
Development
pip install -e ".[dev,docs]"
ruff check --no-cache src tests examples
mypy --no-incremental src
pytest -p no:cacheprovider -q
python tools/format.py # ruff format+fix (Python); prettier (Addon if Node)
python tools/format.py --check # CI-style check
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcbe_ws_sdk-0.1.0.tar.gz.
File metadata
- Download URL: mcbe_ws_sdk-0.1.0.tar.gz
- Upload date:
- Size: 3.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f871691ab9445721186fa2004c2ef6cb8e82294720bd32e3f37398465b2bf36c
|
|
| MD5 |
6e0bc6bb68602e2f01e2a1dc8c3fd698
|
|
| BLAKE2b-256 |
89cf897786a102fd056163006a9c109270420e327b924f9887cc4a12d57714b9
|
Provenance
The following attestation bundles were made for mcbe_ws_sdk-0.1.0.tar.gz:
Publisher:
release.yml on rice-awa/mcbe-ws-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcbe_ws_sdk-0.1.0.tar.gz -
Subject digest:
f871691ab9445721186fa2004c2ef6cb8e82294720bd32e3f37398465b2bf36c - Sigstore transparency entry: 2210076323
- Sigstore integration time:
-
Permalink:
rice-awa/mcbe-ws-sdk@e1bb0aa3b62294853b8efb4bf58cbc15c91cbc9e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/rice-awa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e1bb0aa3b62294853b8efb4bf58cbc15c91cbc9e -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcbe_ws_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcbe_ws_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 46.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbe1e0ba24197b76d8a6b5fa402bdeacc73d21ff157732086c1388c6fd47e398
|
|
| MD5 |
15f766a11a77bf49751f8b491a7a2631
|
|
| BLAKE2b-256 |
2bf4acfc582eaf1a917505976b14311ec300b584c192ef71d3489c06651ce619
|
Provenance
The following attestation bundles were made for mcbe_ws_sdk-0.1.0-py3-none-any.whl:
Publisher:
release.yml on rice-awa/mcbe-ws-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcbe_ws_sdk-0.1.0-py3-none-any.whl -
Subject digest:
bbe1e0ba24197b76d8a6b5fa402bdeacc73d21ff157732086c1388c6fd47e398 - Sigstore transparency entry: 2210076350
- Sigstore integration time:
-
Permalink:
rice-awa/mcbe-ws-sdk@e1bb0aa3b62294853b8efb4bf58cbc15c91cbc9e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/rice-awa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e1bb0aa3b62294853b8efb4bf58cbc15c91cbc9e -
Trigger Event:
push
-
Statement type: