Skip to content

Polish simple shiny chat with mcp#418

Open
amylin1249 wants to merge 7 commits into
mainfrom
polish-simple-shiny-chat-with-mcp
Open

Polish simple shiny chat with mcp#418
amylin1249 wants to merge 7 commits into
mainfrom
polish-simple-shiny-chat-with-mcp

Conversation

@amylin1249

@amylin1249 amylin1249 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Fixes #407 (can be reviewed commit by commit)

  • Rewrote title, description, and README; added CONTRIBUTING.md and updated app screenshot in README
  • Fixed MCP server registration (a bug was previously introduced)
  • Forward only the viewer's own key to MCP servers (never the app's), and only to servers on this same Connect server, so a Connect key can't leak to an unrelated host entered in the sidebar; dropped the unused X-MCP-Authorization header
  • Made failures visible instead of silent or misleading
  • UI: Restored the white background behind chat messages so text stays readable over the gradient; the setup screen shows only the step still unconfigured, the sidebar shows who you're signed in as (so it's clear tools run with their permissions), and the info modal shows the provider/model cleanly
  • Apply the assistant's system prompt on AWS Bedrock too (it was only applied to other providers), and made LLM-provider selection unambiguous
  • Pinned dependencies, dropped the unused nest-asyncio, and reconciled to Python 3.11

Most notable change: The app had a bug where it could no longer connect to any MCP server. Routing auth through a pre-built httpx client fixed it, so it should be working again.

Tested by manually deploying the app.

@github-actions

Copy link
Copy Markdown
Contributor

Extension release summary

🚀 Will release on merge

  • simple-shiny-chat-with-mcp: 0.0.60.0.7

See the contributing guide for details.

@amylin1249 amylin1249 marked this pull request as ready for review July 10, 2026 16:12
@amylin1249 amylin1249 requested review from dotNomad, karawoo and m-- July 10, 2026 16:16
@amylin1249 amylin1249 force-pushed the polish-simple-shiny-chat-with-mcp branch from 2cd4041 to 8a34b49 Compare July 10, 2026 16:31
@amylin1249 amylin1249 force-pushed the polish-simple-shiny-chat-with-mcp branch 2 times, most recently from 295425a to afa6057 Compare July 13, 2026 16:49
…andling and system prompt

Duplicate registrations raise in chatlas (a server-name collision in add_session, or a tool-name overlap) and are caught by the except, so a successful register always adds exactly one new session and the new-server diff is never empty. Drop the unreachable empty-diff guard and keep the list-comprehension form. Also strip indentation from the system prompt string.
@amylin1249 amylin1249 force-pushed the polish-simple-shiny-chat-with-mcp branch from afa6057 to 6c8a3dd Compare July 13, 2026 16:50
Comment on lines +302 to +306
mcp_http_client = (
httpx.AsyncClient(headers={"Authorization": f"Key {visitor_api_key}"})
if visitor_api_key
else None
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If I'm following correctly, passing http_client replaces the client mcp would build itself, which uses httpx.Timeout(30, read=300) and follow_redirects=True. A bare AsyncClient defaults to a 5s timeout and no redirects, so a Connect-hosted tool call over 5s raises ReadTimeout, and a redirecting URL (e.g., trailing slash) fails to register. Should this match mcp's defaults?

Comment on lines +427 to +428
if httpx.URL(url).host == connect_host:
transport_kwargs["http_client"] = mcp_http_client

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this compare the full origin (scheme + host + port) rather than just the host?

else None
)
if mcp_http_client is not None:
session.on_ended(mcp_http_client.aclose)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this also call chat.cleanup_mcp_tools() before closing the client?

@amylin1249

Copy link
Copy Markdown
Contributor Author

Fixed all three as suggested. On the session cleanup, I also wrapped it in try/finally so that the client still closes even if cleanup_mcp_tools() errors.

@amylin1249 amylin1249 requested a review from karawoo July 14, 2026 17:00
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.

Polish simple-shiny-chat-with-mcp

2 participants