Skip to content

Resources, prompts, and opt-in confirmation for live actions - #7

Merged
Tom-R-Main merged 1 commit into
mainfrom
improve/protocol-features
Sep 24, 2026
Merged

Tom-R-Main merged 1 commit into
mainfrom
improve/protocol-features

Conversation

@Tom-R-Main

Copy link
Copy Markdown
Owner

Stacked on #6.

Resources. Each one duplicates a read-only tool, since many clients read resources rarely or not at all.

URI Updated on
obs://status record, stream, replay, virtual camera, program scene, profile or collection changes
obs://scenes scenes created, removed, renamed or switched
obs://scene/{sceneName}/items items created, removed, reindexed, shown/hidden or locked. Listed per scene, with scene-name completion
obs://scene/{sceneName}/screenshot read on demand (960px JPEG)
  • 2025-era clients get resources/updated only for URIs they subscribed to. The subscribe and unsubscribe handlers are registered here, because McpServer doesn't register them.
  • 2026-07-28 clients filter updates on their subscriptions/listen stream.
  • Each session removes its OBS listeners when it closes.

Prompts. record-demo walks through capture-window → preflight → record-clip. pre-stream-check is a read-only go/no-go review.

OBS_MCP_CONFIRM_LIVE (off by default)

  • Makes the stop and toggle tools for stream and record ask before running.
  • Uses elicitation when the client supports it: both the 2025 elicitation/create and the 2026 input_required round trip are tested.
  • Otherwise it returns an error asking the model to get consent and call again with confirm: true.
  • Also exposed as a .mcpb user setting.

Left out on purpose

  • Long-running tasks: SDK 2.0.0 has no tasks runtime, and none of the clients surveyed (Claude Code, Claude Desktop, claude.ai, ChatGPT, Codex, Cursor, VS Code) support the 2026 tasks extension.
  • tools/list_changed: tool filtering is fixed at startup.

Tests

  • 14 new unit tests covering resources, subscriptions, listener cleanup, prompts, and all confirmation paths in both protocol eras.
  • A live read-only resource test.

Results:

  • npm run check: 106 unit, 10 e2e
  • npm run test:package passes
  • Live read-only suite: 4 passed, 2 skipped by design

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vjn8uBEa4mJshaQU3pFuqX

Resources: obs://status, obs://scenes, obs://scene/{sceneName}/items, and
obs://scene/{sceneName}/screenshot. OBS events become resources/updated
notifications: 2025-era clients get them for URIs they subscribe to, and
2026-07-28 clients filter them on their listen stream. Each session removes
its OBS listeners when it closes.

Prompts: record-demo and pre-stream-check.

OBS_MCP_CONFIRM_LIVE makes stop/toggle stream and record ask first: through
elicitation when the client supports it (2025 elicitation/create and the
2026 input_required round trip), otherwise by requiring confirm: true.

initialize() now takes an options object. Long-running tasks are left out:
SDK 2.0.0 has no tasks runtime and no client surveyed supports the extension.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vjn8uBEa4mJshaQU3pFuqX
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-22T22:07:38.474975Z 9a20e4a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9a20e4ae1c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/tools/resources.ts
Comment on lines +74 to +78
const [record, stream, scene] = await Promise.all([
client.sendRequest("GetRecordStatus"),
client.sendRequest("GetStreamStatus"),
client.sendRequest("GetCurrentProgramScene"),
]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Return connection status while OBS is offline

When OBS is unavailable, each sendRequest attempts to connect and rejects, so this Promise.all fails before the resource can serialize client.getConnectionStatus(). As a result, obs://status cannot report the disconnected state—the main reason to include connection information—and instead blocks for the connection timeout and returns a resource error. Return the connection state with unavailable OBS fields omitted or nullable when the client is disconnected.

Useful? React with 👍 / 👎.

Comment thread src/tools/resources.ts
Comment on lines +171 to +173
const listeners: [string, (eventData: unknown) => void][] = [
...STATUS_EVENTS.map((event): [string, () => void] => [event, () => notify(STATUS_URI)]),
...SCENE_LIST_EVENTS.map((event): [string, () => void] => [event, () => notify(SCENES_URI)]),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Notify status subscribers on connection changes

When the OBS socket disconnects or reconnects, OBSWebSocketClient emits disconnected and identified (src/client.ts), not any of the OBS protocol events in STATUS_EVENTS. Therefore a client subscribed to obs://status receives no update for the connection changes that this resource explicitly advertises, leaving its cached status stale until an unrelated output or scene event occurs.

Useful? React with 👍 / 👎.

Comment thread src/tools/resources.ts
Comment on lines +37 to +43
const SCENE_ITEM_EVENTS = [
"SceneItemCreated",
"SceneItemRemoved",
"SceneItemListReindexed",
"SceneItemEnableStateChanged",
"SceneItemLockStateChanged",
];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Notify scene-item subscribers after transform changes

When an item's position, crop, scale, or other transform changes, GetSceneItemList returns different data and OBS emits SceneItemTransformChanged, but that event is omitted here. Subscribers to the per-scene items resource therefore keep stale transform data after common layout operations until another listed item event happens.

Useful? React with 👍 / 👎.

@Tom-R-Main
Tom-R-Main changed the base branch from improve/recording-tools to main September 24, 2026 05:11
@Tom-R-Main
Tom-R-Main merged commit 7dfc565 into main Sep 24, 2026
4 checks passed
@Tom-R-Main
Tom-R-Main deleted the improve/protocol-features branch September 24, 2026 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant