Skip to content

Preserve MCP registration scope across client operations - #61257

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/074a3db10549438cb6aff33eb7bed10791adae4d
Nov 13, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/074a3db10549438cb6aff33eb7bed10791adae4d

Conversation

@copyberry

@copyberry copyberry Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Preserve MCP registration scope across client operations

Why

MCP servers registered under the same name in different environments need distinct inventory, routing, and status reporting.

What changed

  • Keep MCP inventory and runtime status keyed by registration scope so same-named servers remain separate.
  • Add optional environmentId selectors for status lookup, tool calls, resource reads, and OAuth login. Omitting the selector preserves existing name-only routing.
  • Carry environment identity through startup notifications, elicitation requests, and tool-call history, and display it in the TUI.
  • Support /mcp login <name> --environment <id> and update generated protocol schemas and SDK types.

Testing

Add integration coverage for two environments with identically named MCP servers, tools, and resource URIs. Verify separate inventory, explicit environment routing, legacy routing when the selector is omitted, and errors for unknown environments. Update protocol and TUI tests for environment identity.

## Why

MCP servers registered under the same name in different environments need distinct inventory, routing, and status reporting.

## What changed

- Keep MCP inventory and runtime status keyed by registration scope so same-named servers remain separate.
- Add optional `environmentId` selectors for status lookup, tool calls, resource reads, and OAuth login. Omitting the selector preserves existing name-only routing.
- Carry environment identity through startup notifications, elicitation requests, and tool-call history, and display it in the TUI.
- Support `/mcp login <name> --environment <id>` and update generated protocol schemas and SDK types.

## Testing

Add integration coverage for two environments with identically named MCP servers, tools, and resource URIs. Verify separate inventory, explicit environment routing, legacy routing when the selector is omitted, and errors for unknown environments. Update protocol and TUI tests for environment identity.

GitOrigin-RevId: 074a3db10549438cb6aff33eb7bed10791adae4d
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/074a3db10549438cb6aff33eb7bed10791adae4d branch from 9922579 to 6fcfa75 Compare November 13, 2026 04:51
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor
Codex Review Summary: 🔄 Running

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

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-13T04:51:31.686380Z 9922579 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.

@copyberry
copyberry Bot merged commit 6fcfa75 into main Nov 13, 2026
9 of 24 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/074a3db10549438cb6aff33eb7bed10791adae4d branch November 13, 2026 04:51
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 13, 2026

This branch was previously deployed

1 inactive deployment
issue-triage — 6fcfa75a Deployed Nov 13, 2026 by slowtokki0409 via Identify potential duplicates (all issues) #63248
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants