mirror of
https://github.com/openai/codex.git
synced 2026-09-14 11:57:03 +00:00
Expose advertised MCP server capabilities in status responses (#44826)
## What changed Add `serverCapabilities` to `mcpServerStatus/list` responses in both `full` and `toolsAndAuthOnly` modes, including thread-scoped reads. Return the initialized server's capabilities object, including its `extensions` map, or `null` when unavailable. Capture capabilities during initialization so they remain available when tool discovery fails. Clear them on each new connection attempt and keep them independent of shared tool caches. Update the protocol schemas, generated TypeScript and Python types, and documentation. ## Testing Add coverage for extension capabilities surviving tool-discovery failures in both detail modes. Extend existing tests to check advertised extensions, absent capabilities after initialization failure, and serialization of unavailable capabilities as `null`. GitOrigin-RevId: 8e9d67c10fac3a54e82bef8be5d99caaf82597d1
This commit is contained in:
@@ -8340,6 +8340,13 @@ class McpServerStatus(BaseModel):
|
||||
description="Current thread-runtime connection state; null when unavailable or the configuration changed.",
|
||||
),
|
||||
] = None
|
||||
server_capabilities: Annotated[
|
||||
Any | None,
|
||||
Field(
|
||||
alias="serverCapabilities",
|
||||
description="Capabilities advertised by the initialized MCP server; null when unavailable.",
|
||||
),
|
||||
] = None
|
||||
server_info: Annotated[McpServerInfo | None, Field(alias="serverInfo")] = None
|
||||
tools: dict[str, Tool]
|
||||
tools_error: Annotated[
|
||||
|
||||
Reference in New Issue
Block a user