Emit Trusted MCP App Identity on Tool-Call Items (#27132)

## Summary

- Add optional `appContext` to app-server MCP tool-call items with
trusted `connectorId`, `linkId`, and `mcpAppResourceUri` metadata.
- Preserve that context across tool-call events, persisted history,
reconnects, and thread resume.
- Keep the deprecated top-level `mcpAppResourceUri` temporarily for
client migration.

The consumer contract is `{ appContext: { connectorId, linkId,
mcpAppResourceUri }, tool }`.

## Validation

- Full GitHub Actions suite passes, including CLA, Bazel tests, clippy,
release builds, and argument-comment lint.

---------

Co-authored-by: martinauyeung-oai <280153141+martinauyeung-oai@users.noreply.github.com>
This commit is contained in:
martinauyeung-oai
2026-06-18 14:02:54 -07:00
committed by GitHub
co-authored by martinauyeung-oai
parent 9bcc09f9f7
commit 765309d5a6
40 changed files with 899 additions and 15 deletions
@@ -460,6 +460,29 @@
"LegacyAppPathString": {
"type": "string"
},
"McpToolCallAppContext": {
"properties": {
"connectorId": {
"type": "string"
},
"linkId": {
"type": [
"string",
"null"
]
},
"resourceUri": {
"type": [
"string",
"null"
]
}
},
"required": [
"connectorId"
],
"type": "object"
},
"McpToolCallError": {
"properties": {
"message": {
@@ -1235,6 +1258,16 @@
},
{
"properties": {
"appContext": {
"anyOf": [
{
"$ref": "#/definitions/McpToolCallAppContext"
},
{
"type": "null"
}
]
},
"arguments": true,
"durationMs": {
"description": "The duration of the MCP tool call in milliseconds.",
@@ -1258,6 +1291,7 @@
"type": "string"
},
"mcpAppResourceUri": {
"description": "Deprecated: use `appContext.resourceUri` instead.",
"type": [
"string",
"null"