Sharing live Java app state between the model and UI via MCP Apps
Sea-Faithlessness-67 · reddit · 2026-08-19
The author experiments with MCP Apps using Spring Boot, Spring AI and webforJ: a routed Java view is exposed as both an MCP tool and a UI resource, so the model operates on the live application the user is looking at — not a disposable generated interface.
Key points:
- Within the same MCP session, later tool calls can mutate the rendered view's state (e.g. switch an invoice page to an aging chart).
- It's bidirectional: user interactions like row selection or filter changes update the model context without extra chat messages.
- Full loop: prompt → MCP tool → Java view → user interaction → model context.
The author (disclosing they work on webforJ) asks whether sharing one live application state between human UI and model beats generating a separate UI per turn.
More from coding & agent
- Rust's rise was inevitable: code is math — Aizkmusic · 2026-08-19
- How to track chats across multiple AI coding tools — shekitup · 2026-08-19
- Grok Build v1.0.6: Cleaner Agent Architecture and Reliability Improvements — XFreeze · 2026-08-19
- Prompt to make any agent concise and efficient — billyjhowell · 2026-08-19
- App Store Connect CLI 4.5.0: Check App Store Search Rankings — rudrank · 2026-08-19
- Why Grok's single-thread design forces decisions instead of procrastination — billyjhowell · 2026-08-19