Register a session template in Partner Center under your title's Xbox Live configuration, specifying session capabilities (gameplay, large, connectivity), member constants, and timeouts.
Create a session by sending a PUT request to the MPSD REST endpoint for your service configuration ID (SCID) and session template name, with the authenticated user's Xbox token in the Authorization header.
Add the local player as a member by writing to the /members/me path in the session document; set the member's properties such as gamertag, connection string, and custom join properties.
For peer-to-peer connectivity, write secure device addresses (SDA) to member properties and use XblMultiplayerGetSessionByHandleAsync (GDK) to read other members' SDAs for NAT traversal.
Subscribe to session change notifications using XblMultiplayerSessionChangedHandler so your title reacts to members joining, leaving, or updating properties in near-real-time.
When the session ends, explicitly delete it or allow it to expire via the session's inactivity timeout defined in the template.
Known gotchas
MPSD session writes use optimistic concurrency via an ETag; if your write conflicts with a concurrent change, you receive a 412 and must re-read the session, merge changes, and retry.
Session templates are configured per environment (CERT and RETAIL are separate); testing in CERT does not validate that your RETAIL template has the correct capabilities.
Large sessions (for activity feeds and join-in-progress) have different capability flags than gameplay sessions; using the wrong template type causes invite and join flows to behave unexpectedly.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp