Use this guide when you want to drive AXSG studio state from MCP against a live Avalonia process.
Studio MCP control lives on the runtime host because studio is part of the running application state.
axsg.studio.enableaxsg.studio.disableaxsg.studio.configureaxsg.studio.startSessionaxsg.studio.stopSessionaxsg.studio.applyUpdateaxsg.studio.scopesaxsg.studio.statusaxsg://runtime/studio/statusaxsg://runtime/studio/scopesaxsg://runtime/studio/eventsIn practice, studio clients often also subscribe to:
axsg://runtime/hotdesign/workspace/currentbecause the studio update result is usually interpreted together with the active hot design workspace.
Use this rule:
studio/status and studio/eventsstudio/scopes when scope selection UI needs a refreshhotdesign/workspace/current if the studio UX also shows the active design surface{
"jsonrpc": "2.0",
"id": 10,
"method": "tools/call",
"params": {
"name": "axsg.studio.enable",
"arguments": {
"showOverlayIndicator": false,
"enableExternalWindow": false
}
}
}
{
"jsonrpc": "2.0",
"id": 11,
"method": "tools/call",
"params": {
"name": "axsg.studio.configure",
"arguments": {
"canvasLayoutMode": "Stacked",
"enableRemoteDesign": true,
"remoteHost": "127.0.0.1",
"remotePort": 45832,
"waitMode": "HotReload",
"fallbackPolicy": "RuntimeApply"
}
}
}
Both tools return the full studio status snapshot, including:
sessionIdcurrentStateoptionsremotescopesoperations{
"jsonrpc": "2.0",
"id": 12,
"method": "tools/call",
"params": {
"name": "axsg.studio.startSession",
"arguments": {}
}
}
The returned status payload includes the new sessionId.
{
"jsonrpc": "2.0",
"id": 13,
"method": "resources/read",
"params": {
"uri": "axsg://runtime/studio/scopes"
}
}
Each scope entry includes:
scopeKindiddisplayNametargetTypeNamebuildUriUse that payload when the client needs to present scope selection without pulling the full studio status object again.
axsg.studio.applyUpdate is the studio mutation entry point.
Example:
{
"jsonrpc": "2.0",
"id": 14,
"method": "tools/call",
"params": {
"name": "axsg.studio.applyUpdate",
"arguments": {
"requestId": "studio-001",
"correlationId": 42,
"buildUri": "avares://MyApp/Views/MainView.axaml",
"xamlText": "<UserControl xmlns=\"https://github.com/avaloniaui\"><TextBlock Text=\"Studio\"/></UserControl>",
"waitMode": "HotReload",
"fallbackPolicy": "RuntimeApply",
"persistChangesToSource": true,
"timeoutMs": 3000
}
}
}
Result shape:
{
"applyResult": {
"succeeded": true,
"state": "Completed",
"requestId": "studio-001",
"correlationId": 42,
"buildUri": "avares://MyApp/Views/MainView.axaml",
"sourcePersisted": true,
"localUpdateObserved": true,
"runtimeFallbackApplied": false
},
"status": {
"isEnabled": true,
"currentState": "Ready"
},
"workspace": {
"activeBuildUri": "avares://MyApp/Views/MainView.axaml"
}
}
That combined response is deliberate:
applyResult tells you what happenedstatus tells you what studio thinks the session state is nowworkspace gives the refreshed hot design projection for the updated targetThe studio apply path supports:
waitModefallbackPolicypersistChangesToSourcetimeoutMsUse them when your client needs explicit control over whether it waits for hot reload completion or allows runtime fallback behavior.
Typical choices:
waitMode = NonewaitMode = HotReloadfallbackPolicy = RuntimeApplyRecommended pattern:
axsg://runtime/studio/statusaxsg://runtime/studio/eventsaxsg://runtime/hotdesign/workspace/currentaxsg.studio.applyUpdateThis keeps the client responsive:
{
"jsonrpc": "2.0",
"id": 15,
"method": "tools/call",
"params": {
"name": "axsg.studio.stopSession",
"arguments": {}
}
}
This returns the updated status snapshot after the current session has been cleared.
Studio and hot design overlap, but they are not the same surface:
Use hot design tools when you want direct element/document/canvas edits.
Use studio tools when you want: