Skip to content

Conversation

@wrenj
Copy link
Collaborator

@wrenj wrenj commented Jan 23, 2026

MCP Inspector Screenshot validating server:

Screenshot 2026-01-23 at 9 09 35 AM

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces an A2UI over MCP sample, including a README, Python server code, and A2UI JSON definition. The changes are generally well-structured, but I've identified a few areas for improvement related to correctness, maintainability, and minor stylistic issues. Specifically, there's an invalid icon name in the A2UI JSON, reliance on a private API in the server, and a suppressed type ignore that could be clarified or resolved.

Comment on lines 197 to 199
"literalString": "local_fire_department"
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The icon name "local_fire_department" is not listed as an allowed enum value in the standard_catalog_definition.json (lines 90-139). Using an undefined icon might lead to rendering issues or an empty icon being displayed. Please choose an icon from the allowed enum values to ensure correct rendering.

sse = SseServerTransport("/messages/")

async def handle_sse(request: Request):
async with sse.connect_sse(request.scope, request.receive, request._send) as streams: # type: ignore[reportPrivateUsage]
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Relying on a private API (request._send) and suppressing the reportPrivateUsage warning can lead to unexpected behavior or breakage in future versions of starlette. It's generally safer to use public APIs or consider contributing a public alternative if the required functionality is not exposed.


from server import main

sys.exit(main()) # type: ignore[call-arg] No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The type: ignore[call-arg] comment suggests a type incompatibility that is being suppressed. It's best practice to either fix the underlying type issue to ensure type safety or provide a more detailed comment explaining why the ignore is necessary and what the expected behavior is, to aid future maintainers.

Comment on lines +69 to +70
# MCP throws an error for "type":"array" so wrapping in an object
# TODO fix this in MCP SDK
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The TODO comment indicates a known issue with the MCP SDK. While the workaround is in place, it would be beneficial to track this issue (e.g., with a link to a bug report or internal ticket) to ensure it's addressed in the SDK itself, improving the robustness and clarity of this code.


server_to_client_json["properties"]["surfaceUpdate"]["properties"]["components"]["items"]["properties"]["component"]["properties"] = standard_catalog_json

return wrap_as_json_array(server_to_client_json)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There is trailing whitespace at the end of this line. Please remove it for consistency and adherence to common Python style guidelines.

Suggested change
return wrap_as_json_array(server_to_client_json)
return wrap_as_json_array(server_to_client_json)

wrenj and others added 5 commits January 23, 2026 09:44
@wrenj wrenj enabled auto-merge (squash) January 23, 2026 18:15
@wrenj wrenj merged commit 85653bd into main Jan 23, 2026
5 checks passed
@wrenj wrenj deleted the mcp branch January 23, 2026 19:14
@github-project-automation github-project-automation bot moved this from Todo to Done in A2UI Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants