Files
codex/codex-rs/app-server-protocol/schema/json/v2/ListMcpServerStatusResponse.json
T
sayan-oai 6fcfa75a9f Preserve MCP registration scope across client operations (#61257)
## 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
2026-11-13 04:51:06 +00:00

299 lines
6.5 KiB
JSON
Generated

{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"McpAuthStatus": {
"enum": [
"unknown",
"unsupported",
"notLoggedIn",
"bearerToken",
"oAuth"
],
"type": "string"
},
"McpServerConnectionStatus": {
"enum": [
"notStarted",
"starting",
"connected",
"authenticationRequired",
"failed",
"cancelled",
"disabled"
],
"type": "string"
},
"McpServerInfo": {
"description": "Presentation metadata advertised by an initialized MCP server.",
"properties": {
"description": {
"type": [
"string",
"null"
]
},
"icons": {
"items": true,
"type": [
"array",
"null"
]
},
"name": {
"type": "string"
},
"title": {
"type": [
"string",
"null"
]
},
"version": {
"type": "string"
},
"websiteUrl": {
"type": [
"string",
"null"
]
}
},
"required": [
"name",
"version"
],
"type": "object"
},
"McpServerStatus": {
"properties": {
"authStatus": {
"$ref": "#/definitions/McpAuthStatus"
},
"environmentId": {
"description": "Environment that contributed this registration; null for a thread-wide server. Older servers omit this field.",
"type": [
"string",
"null"
]
},
"httpOrigin": {
"description": "HTTP origin of the effective configured endpoint, including plugin servers. Excludes credentials, path, query, and fragment; null for non-HTTP transports.",
"type": [
"string",
"null"
]
},
"name": {
"type": "string"
},
"pluginId": {
"type": [
"string",
"null"
]
},
"resourceTemplates": {
"items": {
"$ref": "#/definitions/ResourceTemplate"
},
"type": "array"
},
"resources": {
"items": {
"$ref": "#/definitions/Resource"
},
"type": "array"
},
"runtimeStatus": {
"anyOf": [
{
"$ref": "#/definitions/McpServerConnectionStatus"
},
{
"type": "null"
}
],
"description": "Current thread-runtime connection state; null when unavailable or the configuration changed."
},
"serverCapabilities": {
"description": "Capabilities advertised by the initialized MCP server; null when unavailable."
},
"serverInfo": {
"anyOf": [
{
"$ref": "#/definitions/McpServerInfo"
},
{
"type": "null"
}
]
},
"toolListMeta": {
"description": "Opaque `_meta` from the first page of the corresponding MCP tool catalog. Null when unavailable."
},
"tools": {
"additionalProperties": {
"$ref": "#/definitions/Tool"
},
"type": "object"
},
"toolsError": {
"description": "Tool discovery failed and no catalog was returned. Null when a catalog is returned, including cached or empty catalogs.",
"type": [
"string",
"null"
]
}
},
"required": [
"authStatus",
"name",
"resourceTemplates",
"resources",
"tools"
],
"type": "object"
},
"Resource": {
"description": "A known resource that the server is capable of reading.",
"properties": {
"_meta": true,
"annotations": true,
"description": {
"type": [
"string",
"null"
]
},
"icons": {
"items": true,
"type": [
"array",
"null"
]
},
"mimeType": {
"type": [
"string",
"null"
]
},
"name": {
"type": "string"
},
"size": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"title": {
"type": [
"string",
"null"
]
},
"uri": {
"type": "string"
}
},
"required": [
"name",
"uri"
],
"type": "object"
},
"ResourceTemplate": {
"description": "A template description for resources available on the server.",
"properties": {
"annotations": true,
"description": {
"type": [
"string",
"null"
]
},
"mimeType": {
"type": [
"string",
"null"
]
},
"name": {
"type": "string"
},
"title": {
"type": [
"string",
"null"
]
},
"uriTemplate": {
"type": "string"
}
},
"required": [
"name",
"uriTemplate"
],
"type": "object"
},
"Tool": {
"description": "Definition for a tool the client can call.",
"properties": {
"_meta": true,
"annotations": true,
"description": {
"type": [
"string",
"null"
]
},
"icons": {
"items": true,
"type": [
"array",
"null"
]
},
"inputSchema": true,
"name": {
"type": "string"
},
"outputSchema": true,
"title": {
"type": [
"string",
"null"
]
}
},
"required": [
"inputSchema",
"name"
],
"type": "object"
}
},
"properties": {
"data": {
"items": {
"$ref": "#/definitions/McpServerStatus"
},
"type": "array"
},
"nextCursor": {
"description": "Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.",
"type": [
"string",
"null"
]
}
},
"required": [
"data"
],
"title": "ListMcpServerStatusResponse",
"type": "object"
}