Expose HTTP origins in MCP server status (#47159)

## What changed

Add nullable `httpOrigin` to `McpServerStatus`, derived from the effective configured endpoint for both configured and plugin-provided servers. Return only the HTTP(S) origin, excluding credentials, path, query, and fragment; return `null` for stdio transports, invalid URLs, and non-HTTP(S) schemes. Update the generated protocol schemas and TypeScript and Python types.

## Testing

Extend status integration tests to cover configured and plugin-provided HTTP servers, verify that endpoint paths and query parameters are omitted, and assert `null` for a stdio server. Update protocol tests to check null serialization and compatibility with older inventory responses.

GitOrigin-RevId: 033ebdeefe829e3a48b2d4ab7d8866dac4cda5c5
This commit is contained in:
Alex Kotliarskyi
2026-09-22 02:24:25 +00:00
committed by copyberry
parent 9f22ba8039
commit b23324986d
15 changed files with 114 additions and 7 deletions
@@ -8413,6 +8413,13 @@ class McpServerStatus(BaseModel):
populate_by_name=True,
)
auth_status: Annotated[McpAuthStatus, Field(alias="authStatus")]
http_origin: Annotated[
str | None,
Field(
alias="httpOrigin",
description="HTTP origin of the effective configured endpoint, including plugin servers. Excludes credentials, path, query, and fragment; null for non-HTTP transports.",
),
] = None
name: str
plugin_id: Annotated[str | None, Field(alias="pluginId")] = None
resource_templates: Annotated[list[ResourceTemplate], Field(alias="resourceTemplates")]