# romcp

Official domain: **romcp.dev**. Website deployment is being prepared as part of the v3 launch.

> The programmable development and operations toolkit for Roblox Studio

**romcp is the new name for Dominus.** Version 3 retains the `dominus-cli` package name for upgrade compatibility and provides `romcp`, `romcp-mcp`, and `romcp-install-plugin` commands alongside the existing aliases. See the [branding transition](docs/V3_BRANDING.md).

romcp gives MCP hosts direct, typed access to Studio instances, scripts, UI, reflection, output, and tests. Tools with structured schemas and risk hints cover inspection, mutation, 3D building, UI fidelity, testing, and Roblox Open Cloud commerce.

Version 3 includes an opt-in local developer API and a typed SDK at `dominus-cli/sdk`. The HTTP API contract remains a preview. See the [API quickstart](docs/V3_API_PREVIEW.md) for implemented endpoints and authentication, and the [release notes](CHANGELOG.md) for known limits.

MCP script operations also support [place-scoped project source mappings](docs/V3_PROJECT_CONTEXT.md), local/Studio conflict reporting, and omission of source already available in a matching local file.

[Persistent build preferences](docs/V3_BUILD_STYLES.md) let direct and procedural builds inherit material, color, anchoring, collision, and stud-surface choices per place.

## Features

The v3 preview also includes [native UI-to-code export](docs/V3_UI_EXPORT.md) for React Luau and plain Luau, with typed snapshots and explicit fidelity diagnostics.

- **Typed tools with schemas**: Input validation and structured results for every Studio operation
- **Zero friction setup**: Guided installer handles credentials, plugin installation, and MCP client detection
- **Atomic mutations**: Batches and UI replacements are undoable; changes roll back on failure
- **Stable refs**: Instance references survive renames, reparenting, and duplicate sibling names
- **Parallel coordination**: MCP-native Sampling for multi-agent Studio work with coordinator-owned writes
- **Revision-locked scripts**: Write protection via revision tokens from `studio_read_script`
- **Dockable control panel**: Live connection state, reconnects, Luau safety toggle, and project rules
- **Optional code execution**: Explicitly enabled and per-request confirmed Luau runs for custom builds
- **3D building utilities**: Part creation, cloning, transforms, CSG unions, spatial queries, and procedural geometry
- **Windows Studio capture**: Non-focusing full-window screenshots and consistent multi-region crops without Studio screenshot permission
- **Commerce APIs**: Developer products and game passes via Roblox Open Cloud with duplicate checks
- **Admin panel**: Connection diagnostics, forced reconnects, target selection, and database inspection
- **Secure bridge**: Single background process, token auth, stdio transport, rate limits, and method allowlist

## Requirements

- Node.js 20 or newer
- Roblox Studio with HTTP requests enabled for Studio/plugin use
- An MCP client such as Codex, Claude Code, Claude Desktop, Cursor, or VS Code
- A scoped Roblox Open Cloud API key when creating developer products or game passes
- A numeric Roblox creator user or group ID when uploading assets through Open Cloud

romcp does not require its own AI API key. Your MCP host supplies the model.
Commerce creation reads `ROBLOX_OPEN_CLOUD_API_KEY` from the MCP server
environment, or `openCloudApiKey` from romcp config. Grant only
`developer-product:read`, `developer-product:write`, `game-pass:read`, and
`game-pass:write` for the intended experience.
Asset uploads use the same key with asset read/write access. Pass `creatorGroupId`
to `roblox_upload_asset` for a group-owned upload or `creatorUserId` for a
user-owned upload. Defaults can come from `ROBLOX_CREATOR_GROUP_ID`,
`ROBLOX_CREATOR_USER_ID`, `ROBLOX_USER_ID`, `robloxGroupId`, or `robloxUserId`
in romcp config. The API key must authorize the intended creator, including
the target group for group-owned uploads.

## Installation

```bash
pnpm install -g dominus-cli@latest
```

Run the guided setup:

```bash
dominus setup
```

This provisions your local credential, installs the Studio plugin, configures your MCP client, and verifies the connection. Roblox Studio reloads the plugin automatically.

For unattended setup: `dominus setup --yes --skip-studio-check`

## Updating

```bash
dominus update
```

An explicit update always checks npm instead of relying on the passive update
cache, upgrades through the package manager that installed romcp, and installs
the matching Studio plugin. Current bridge versions are restarted gracefully so
the new background code takes effect too. Reload Studio after it completes. When
the local bridge discovers a newer release, the Studio plugin logs a warning and
opens an update card once for that release.

## Configuration

Add to your MCP client config:

```json
{
  "mcpServers": {
    "dominus": {
      "command": "dominus-mcp"
    }
  }
}
```

For version-pinned setup without global install:

```json
{
  "mcpServers": {
    "dominus": {
      "command": "pnpm",
      "args": ["dlx", "dominus-cli@latest", "dominus-mcp"]
    }
  }
}
```

## Getting started

1. Run `dominus setup` to install the plugin and configure your client
2. Open Roblox Studio and start your MCP client
3. romcp authenticates automatically with no manual pairing

The **romcp** toolbar panel shows connection state, reconnect controls, Luau execution toggle, and project rules that sync with your MCP host.

Run `dominus doctor --wait 30` to verify the plugin/bridge connection.

## Tool patterns

**Inspection & scripting**: Read the tree, scripts, selection, and API docs. Script updates are revision-locked; use `studio_read_script` to get the revision token.

**UI building**: Use `studio_build_ui` then `studio_snapshot_ui` to compare fonts, UDim2 values, colors, and hierarchy. Take screenshots to verify layout.

**Windows capture**: `studio_capture_window` captures only the active romcp Roblox Studio window without focusing it or sending input. Request one full client/window image or up to 12 labeled pixel crops from the same frame. If Roblox's DirectX surface rejects native window capture, romcp copies visible pixels only after proving that no other application overlaps the target; otherwise it fails without taking a screenshot.

**3D building**: Batch create parts with `studio_create_parts`, clone templates with `studio_clone_instances`, transform with `studio_transform_instances`, and organize with grouping tools. Use `studio_query_parts` for spatial discovery and `studio_union_parts` for CSG. Verify with `studio_review_3d`.

**Procedural geometry**: `studio_run_build_program` combines lines, helixes, rings, grids, and spheres in one undoable operation. Specify tapered sizes and path-aware rotations for structures like spiral trees.

**Code execution**: `studio_run_luau` runs generated Luau (off by default; toggle with toolbar button). Requires `confirm=true`. Code should return or call `dominus.track(model)` so the tool captures and screenshots results.

**Parallel work**: `run_parallel_task` fans out to Sampling workers for independent subtasks. Workers are proposal-only; the coordinator validates and applies changes atomically.

**Metadata**: Use `studio_get_metadata`, `studio_set_attributes`, and `studio_update_tags` for instance data. romcp writes real Studio attributes/tags directly.

**Commerce**: `roblox_create_developer_product` and `roblox_create_game_pass` hit Open Cloud APIs with duplicate checks. Requires `confirm=true`. Never invents IDs.

## Tool catalog

Connection tools:

- `dominus_status`
- `dominus_select_studio`

Parallel coordination:

- `run_parallel_task`

Studio inspection:

- `studio_get_tree`
- `studio_inspect`
- `studio_get_selection`
- `studio_read_script`
- `studio_snapshot_ui`
- `studio_get_output`
- `studio_get_reflection`
- `studio_get_metadata`
- `studio_list_callable_methods`
- `studio_query_parts`
- `studio_review_3d`
- `studio_capture_window` (Windows only; full Studio window or multi-region PNG crops)

Studio changes and verification:

- `studio_update_script`
- `studio_apply`
- `studio_create_parts`
- `studio_clone_instances`
- `studio_transform_instances`
- `studio_group_instances`
- `studio_ungroup_instances`
- `studio_create_welds`
- `studio_union_parts`
- `studio_run_build_program`
- `studio_run_luau`
- `studio_set_selection`
- `studio_set_attributes`
- `studio_update_tags`
- `studio_invoke_methods`
- `studio_delete_instances`
- `studio_build_ui`
- `studio_run_test`

Roblox documentation:

- `roblox_search_api`
- `roblox_get_api`

Roblox Open Cloud commerce:

- `roblox_commerce_status`
- `roblox_list_developer_products`
- `roblox_create_developer_product`
- `roblox_list_game_passes`
- `roblox_create_game_pass`

Roblox Open Cloud assets:

- `roblox_upload_asset` (user- or group-owned images, models, and audio; images can be applied to a Studio target)

## Security

- **Bridge**: Local-only WebSocket on `127.0.0.1`, token-authenticated, message-size limited, rate-limited
- **Plugin**: Shipped with placeholder credentials; setup writes the user-specific token to the local copy
- **Commands**: Explicit allowlist; reflected methods pass a capability policy (excludes destructive, network, signal operations)
- **Luau execution**: Opt-in toggle (default off) plus per-request confirmation
- **Transport**: stdio (MCP standard)

## Development

```powershell
pnpm install
pnpm lint
pnpm typecheck
pnpm test
pnpm build
pnpm build:plugin
npm pack --dry-run
```

The editable toolbar icons and Roblox-upload PNGs live in `plugin/assets`. Roblox
toolbar icons require moderated asset URIs; upload both PNGs from the creator
account and replace the temporary toolbar asset IDs before publishing the plugin.

Run the MCP server in development:

```powershell
pnpm dev:mcp
```

The design and research notes are in
[`docs/DOMINUS_2_PLAN.md`](docs/DOMINUS_2_PLAN.md).

## License

[Dominus License 1.0](LICENSE) — you may use romcp and modify your own copy,
but you may not sell, redistribute, rebrand, or claim the software or a modified
version as entirely your own. This is not an open-source license.
