Skip to content

feat(web-ui): UI polish + MCP OAuth handling#643

Merged
yaozheng-fang merged 4 commits into
mainfrom
feat/web-ui-polish-mcp-oauth
Jul 7, 2026
Merged

feat(web-ui): UI polish + MCP OAuth handling#643
yaozheng-fang merged 4 commits into
mainfrom
feat/web-ui-polish-mcp-oauth

Conversation

@yaozheng-fang

Copy link
Copy Markdown
Collaborator

Frontend polish on top of the web-ui studio, plus MCP/tool OAuth support.

UI polish

  • Layout: gray canvas with the main panel floating as a rounded card; sidebar sits transparent on the canvas; login page framed; lighter gray backdrop; shadows removed.
  • Moved the account block to the sidebar footer (out of the navbar top-right); popover opens upward.
  • Hide the actions/timestamp row while a turn is thinking/streaming; reveal only when the reply is done. Show a muted fallback ("本次没有返回可显示的内容") when a finalized turn has no visible content.
  • Login: reserve the hint line so an invalid username no longer shifts the input.
  • Session-list rows get spacing (hover backgrounds no longer touch).
  • Default agent selection prefers a servable conversational agent (web_search_agent / web_demo) instead of a non-loadable numbered example.

MCP / tool OAuth

Full handling of ADK's adk_request_credential flow:

  • blocks.ts: parse the credential-request functionCall into a dedicated auth block (callId, authUri, authConfig); resolve it on the credential response; skip empty function-response user turns on replay.
  • Blocks.tsx: an OAuth card ("该工具需要授权" + 去授权 button, with authorizing/done/error states).
  • client.ts: runSSE accepts functionResponses to resume a long-running call.
  • App.tsx: onAuth opens the authorize URL in a popup, captures the callback (same-origin poll + postMessage, with a paste-URL fallback), sets oauth2.authResponseUri, and posts the credential back — the resumed run streams into the same turn.

Example

  • examples/web_search_agent/: a servable non-a2ui agent with the built-in web_search tool.

Notes: the committed veadk/webui bundle is rebuilt from this source. Excludes the web_fetch tool (that's in #586). MCP-OAuth was validated for event parsing/rendering/build; a live token exchange still needs a real MCP-OAuth tool to test against.

🤖 Generated with Claude Code

- Layout: gray canvas + floating rounded main panel; sidebar transparent on
  canvas (login page framed); lighter gray backdrop; no shadows.
- Account block moved to the sidebar footer (out of the navbar top-right).
- Hide the actions/timestamp row while a turn is thinking/streaming; show a
  fallback note when a finalized turn has no visible content.
- Login: reserve the hint line so an invalid username no longer shifts the input.
- Session list items get spacing between rows.
- Default agent selection prefers a servable conversational agent (web_search_agent
  / web_demo) instead of a non-loadable numbered example.
- MCP / tool OAuth: parse the `adk_request_credential` event into an auth card,
  open the authorize URL, capture the callback, and resume the run via a
  function response (blocks.ts + Blocks.tsx AuthCard + client runSSE resume + App).
- examples/web_search_agent: a servable non-a2ui agent with the web_search tool.
- collapse the authorization card to a compact "已授权 · <toolset>" row the
  moment the callback returns, instead of holding "等待授权…" until the whole
  reply finishes streaming
- amber shield while pending, green once authorized; card names the toolset
  and the identity provider it will redirect to; wider layout
- auto-capture the OAuth popup callback at the app entry (postMessage to the
  opener + close) so the user never pastes the callback URL
- hide a turn's actions/timestamp row while it is awaiting authorization
- add examples/mcp_oauth_agent: an MCP tool guarded by ADK-native OIDC OAuth
  (OpenIdConnectWithConfig + client credentials on McpToolset), fully
  env-driven, with a README
…d origin

Default OIDC_REDIRECT_URI to http://localhost:8000/ (where `veadk frontend`
serves the UI) instead of the Vite dev port; note the :5173 dev alternative in
the agent docstring and README.
@yaozheng-fang yaozheng-fang merged commit 09cbe5b into main Jul 7, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants