Skip to content

Expose MCP app identity in app context - #29934

Merged
martinauyeung-oai merged 5 commits into
mainfrom
martinauyeung/martin-48-expose-api-tool-v2-resource-identity-in-codex-appcontext
Jun 26, 2026
Merged

Expose MCP app identity in app context#29934
martinauyeung-oai merged 5 commits into
mainfrom
martinauyeung/martin-48-expose-api-tool-v2-resource-identity-in-codex-appcontext

Conversation

@martinauyeung-oai

@martinauyeung-oai martinauyeung-oai commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Why

MCP tool-call events need to expose trusted app identity and action metadata directly so v2 clients do not have to infer it from tool names or resource URIs.

What changed

  • Add optional appName, templateId, and actionName fields to MCP tool-call appContext.
  • Populate appName and templateId from trusted Codex Apps metadata, and derive actionName from the trusted app resource metadata.
  • Preserve all three fields through core events, legacy protocol events, persisted thread history, resume redaction, and app-server v2 responses.
  • Document the public appContext fields in codex-rs/app-server/README.md.
  • Regenerate app-server JSON and TypeScript schemas and add coverage for serialization, persistence, redaction, and metadata propagation.

Validation

  • just test -p codex-app-server-protocol mcp_tool_call
  • just test -p codex-core mcp_tool_call_item_metadata_only_trusts_codex_apps_identity mcp_tool_call_item_includes_app_identity
  • just write-app-server-schema
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@martinauyeung-oai
martinauyeung-oai marked this pull request as ready for review June 25, 2026 23:46
@martinauyeung-oai
martinauyeung-oai requested a review from a team as a code owner June 25, 2026 23:46
@martinauyeung-oai
martinauyeung-oai force-pushed the martinauyeung/martin-48-expose-api-tool-v2-resource-identity-in-codex-appcontext branch from ee40dac to 822163b Compare June 25, 2026 23:48

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

Copy link
Copy Markdown
Contributor

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: ee40dac10e

ℹ️ 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 codex-rs/app-server-protocol/src/protocol/v2/item.rs
pub connector_id: String,
pub link_id: Option<String>,
pub resource_uri: Option<String>,
pub app_name: Option<String>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: just name since everything in this payload already refers to an app? or display_name?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The consuming backend has it as app_name + we have action name passed here as well. app_name makes it more clear here i think

@martinauyeung-oai martinauyeung-oai changed the title Emit app name and template ID in MCP app context Expose MCP app identity in app context Jun 26, 2026
@martinauyeung-oai
martinauyeung-oai merged commit ec300bc into main Jun 26, 2026
31 checks passed
@martinauyeung-oai
martinauyeung-oai deleted the martinauyeung/martin-48-expose-api-tool-v2-resource-identity-in-codex-appcontext branch June 26, 2026 01:31
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants