Getting Started
Install Margrete RPC and write your first chart script.
Margrete RPC is a Margrete plugin plus a Python client package that lets you script chart editing for UMIGURI/Margrete.
Use it to read and rewrite charts programmatically: place notes, edit events, and apply changes inside the editor.
Requirements
- Python 3.13 or later
- Margrete 1.8.0 or later
Installation
1. Install the plugin
-
Download the latest release from the GitHub Releases page.
-
Open
margrete-rpc-vX.X.X.zipand copymargrete-rpc.dllandmargrete-rpc.inito your Margrete plugins directory.margrete-rpc.dllmargrete-rpc.iniMargrete.exe
-
Restart Margrete. Then open Extensions → Manage Extensions, enable margrete-rpc.dll, and click Confirm.
2. Install the Python package
pip install margrete-rpcuv add margrete-rpcQuick start
-
In Margrete, open Extensions → Margrete RPC to start the plugin.
👉
You need to start the plugin each time Margrete restarts. -
Create a file called
example.py:from margrete_rpc import Margrete from margrete_rpc.chart.notes import Tap m = Margrete() # auto-detect the running plugin instance status = m.status() print(f"Plugin v{status.server_version} (pid {status.pid})") print(f"Log: {status.log_path}") with m.open_edit() as tx: tx.chart.notes.append(Tap(t=0, x=0, w=4)) # changes are applied when this block exits successfullyThis connects to Margrete, prints the
ServerStatus, opens an edit transaction, and appends aTapnote to the chart. -
Run the script and check the editor:
python example.pyA new tap note will appear in the editor.

Handle multiple Margrete instances
Margrete() with no arguments works when exactly one running plugin instance is discovered.
When multiple Margrete instances are running, pass endpoint or instance_id.
Use list_instances() when you need to inspect available MargreteInstance values first:
from margrete_rpc import Margrete, list_instances
# list all discovered instances
for inst in list_instances():
print(inst.instance_id, inst.endpoint)
# connect by explicit host:port (left Margrete)
m_left = Margrete(endpoint="127.0.0.1:1328")
# connect by the instance_id (right Margrete)
m_right = Margrete(instance_id="47824-6a30f65d-b7f8afde84506008")