xbox-cli-mcp
# xbox-cli-mcp
[](https://glama.ai/mcp/servers/zydziupolska-cmyk/xbox-cli-mcp)
An MCP server for the [XBOX CLI](https://github.com/xbox/cli). It gives Claude, Cursor, VS Code and any other MCP client safe access to Partner Center (games, sandboxes, playtests, test accounts), XBOX services configuration and PlayFab.
> Unofficial community project. It is not affiliated with or endorsed by Microsoft. XBOX is a trademark of Microsoft.
**Read-only by default.** Agents can look around freely. To make changes, you have to opt in. Even then, the server refuses changes that can't be undone (creating a game or sandbox, publishing to RETAIL, …) unless you opt in a second time.
## Why use this instead of letting an agent run `xbox` in a shell?
The XBOX CLI acts with your permissions, which usually means admin rights on production titles. The CLI's docs point out that it [can't tell whether a person approved a change](https://github.com/xbox/cli/blob/main/docs/cli-for-agents.md#approving-changes), because the confirmation is passed on the same command line. This server puts an approval layer in front of it:
| | Shell access | xbox-cli-mcp |
| --- | --- | --- |
| Reads and changes are separate tools | ✗ | ✓ `xbox_read` (readOnlyHint) and `xbox_change` (destructiveHint), so your client can auto-approve reads and ask about changes |
| Changes off by default | ✗ | ✓ `XBOX_MCP_MODE=read-only` |
| Irreversible commands blocked | ✗ | ✓ unless `XBOX_MCP_MODE=full` |
| `--confirm` can't slip in through args | ✗ | ✓ only via `confirm: true` |
| RETAIL / CERT / title-wide publishes detected | ✗ | ✓ also when `--sandbox-id` is missing and a saved default might point at RETAIL |
| `playfab api` classified by operation | ✗ | ✓ `Get*`, `List*` and `Search*` read; everything else is a change |
| Exit code 3 ("outcome unknown") explained | ✗ | ✓ tells the agent to read the state instead of retrying |
| Audit log of every change, Partner Center and XBOX services included | PlayFab only | ✓ JSONL, with request bodies redacted |
| Always `--no-input` and JSON output | You have to remember | ✓ |
## Requirements
- Node.js 20+
- The XBOX CLI, installed and on your PATH: `winget install XBOX.cli` on Windows, or the [install script](https://github.com/xbox/cli/blob/main/docs/installation.md) on macOS and Linux
- A Partner Center account. PlayFab commands also need Admin permission on the title.
## Install
No install step is needed: MCP clients run it with `npx`.
### Claude Code
```bash
claude mcp add xbox -- npx -y xbox-cli-mcp
# allow changes:
claude mcp add xbox -e XBOX_MCP_MODE=write -- npx -y xbox-cli-mcp
```
### Claude Desktop, Cursor, VS Code (`mcpServers` JSON)
```json
{
"mcpServers": {
"xbox": {
"command": "npx",
"args": ["-y", "xbox-cli-mcp"],
"env": { "XBOX_MCP_MODE": "read-only" }
}
}
}
```
### From source
```bash
git clone https://github.com/zydziupolska-cmyk/xbox-cli-mcp && cd xbox-cli-mcp
npm install && npm run build # then point your client at dist/index.js
```
Sign in once with `xbox auth login` in a terminal, or have the agent call `xbox_auth_login`. Either way, a browser window opens.
## Modes
| `XBOX_MCP_MODE` | Reads | Changes | Irreversible changes |
| --- | --- | --- | --- |
| `read-only` (default) | ✓ | ✗ (`xbox_change` refuses and says how to enable it) | ✗ |
| `write` | ✓ | ✓ | ✗ |
| `full` | ✓ | ✓ | ✓ |
The server treats these commands as irreversible, following the CLI's [safety docs](https://github.com/xbox/cli/blob/main/docs/safety.md):
- `game create`, `sandbox create`, `xbl business-partner create`, `xbl relying-party create`
- `xbl web-service certificate create`, `xbl binding create|delete`, `playfab privacy export`
- `xbl config publish` to RETAIL, CERT, CERT.DEBUG, ALL or HIDDEN, with `--scope title|account`, across sandboxes, or without an explicit `--sandbox-id`
## Tools
| Tool | What it does |
| --- | --- |
| `xbox_auth_status`, `xbox_auth_login`, `xbox_auth_logout` | Sign-in state; browser sign-in; sign out |
| `xbox_context_get`, `xbox_context_set` | Saved default seller, title, sandbox and PlayFab title |
| `xbox_seller_list`, `xbox_game_list`, `xbox_sandbox_list`, `xbox_playtest_list` | Common lookups |
| `xbox_help` | The installed CLI's Help for any command, which is the authority on its options |
| `xbox_skill`, resource `xbox://skill` | The CLI's built-in agent skill (`xbox --skill`) |
| `xbox_classify` | Dry run: shows what a command would do, whether it can be undone, and which tool may run it |
| `xbox_read` | Runs any read-only command, including `playfab api /…/Get*` |
| `xbox_change` | Runs a change. Requires a `summary` for the audit log, and `confirm: true` for commands the CLI asks about. Listed in every mode; in `read-only` it changes nothing and says how to enable it, and in `write` it refuses irreversible commands. |
## Configuration
| Variable | Default | |
| --- | --- | --- |
| `XBOX_MCP_MODE` | `read-only` | `read-only`, `write` or `full` (or pass `--mode=`) |
| `XBOX_MCP_BIN` | `xbox` | Path to the CLI |
| `XBOX_MCP_TIMEOUT_MS` | `600000` | Per-command timeout |
| `XBOX_MCP_MAX_OUTPUT_BYTES` | `200000` | Longer output is truncated |
| `XBOX_MCP_AUDIT_LOG` | `~/.xbox-mcp/audit.jsonl` | `off` to disable |
The CLI's own settings (`XBOX_SELLER_ID`, `XBOX_PLAYFAB_TITLE_ID`, `XBOX_AUDITLOG__ENABLED`, …) pass straight through.
## Development
```bash
npm test # builds, then runs the suite against test/fake-xbox.mjs; no Partner Center account needed
```
The XBOX CLI is a technical preview, so its commands can change between releases. The safety rules live in [`src/safety.ts`](src/safety.ts). Commands the server doesn't recognise are treated as changes.
## License
MIT
TDQS
Scored across 14 tools
The set is well-partitioned by design: xbox_read vs xbox_change are clearly split by state safety, and xbox_skill, xbox_help, and xbox_classify serve distinct informational roles (session guide, per-command docs, read/change classification). The only real overlap is that the typed list tools (seller/game/sandbox/playtest) can also be reached through xbox_read, but the read description explicitly directs agents to prefer the typed tools for covered reads.
All names share an xbox_ prefix and snake_case, with coherent family groups (xbox_auth_*, xbox_context_*, xbox_*_list). Minor deviation: list tools use noun_list ordering while the runners use verb ordering (xbox_read, xbox_change, xbox_help, xbox_skill), so it is consistent in style but not a single uniform verb_noun pattern.
14 tools is well within the sweet spot and each tool maps to a real need: auth lifecycle, context defaults, four discovery listings, generic read/change runners, and the three guidance/classification helpers. Nothing feels redundant or padded for a CLI wrapper of this scope.
The surface covers the full lifecycle of a CLI session: sign in/out, inspect and set defaults, discover sellers/games/sandboxes/playtests, get help, classify safety, and then execute any read or write through the generic runners. The generic xbox_read/xbox_change design means arbitrary CLI commands are reachable, so there are no dead ends beyond what the CLI itself exposes.