Successfully implemented the NextSteps feature for dynamic interaction in the Anthropic Streaming Chat with MCP application. This feature allows MCP servers to propose follow-up actions that can be automatically executed after a countdown or manually selected by users.
- Added
NextStepProposal
interface for individual action proposals - Added
NextStepsOutput
interface for the complete NextSteps data structure - Integrated with existing MCP tool result format
- Visual Design: Pill-shaped buttons with progress indicators
- Auto-Execution: Countdown timer with automatic proposal execution
- Manual Selection: Click-to-execute for manual proposals
- User Interaction: Hover/click cancels auto-execution
- Progress Indicators:
- Animated progress bars for countdown (blue)
- Static progress bars for priority indication (gray)
- Mobile Responsive: Stacks vertically on small screens
- Enhanced
mcp_tool_result
handling to detect NextSteps output - Renders NextSteps component when
output.nextSteps
is found - Maintains existing HTML output functionality
- Passes message sending callback for proposal execution
- Added
autoExecuteNextSteps
boolean to AppConfig interface - Integrated with localStorage persistence
- Defaults to
true
(enabled)
- Added toggle switch for NextSteps auto-execution
- Clear description of functionality
- Persisted in localStorage as
auto_execute_next_steps
- Modified
fireSend
function to accept optional string parameter - Passes NextSteps callbacks to MessageComponent
- Supports NextSteps execution during live streaming
- Maintains existing input handling for manual messages
- Comprehensive CSS for NextSteps components
- Progress bar animations and transitions
- Mobile-responsive design
- Consistent with existing design system
- NextSteps detected via
output.nextSteps
in MCP tool results - JSON parsing with graceful error handling
- Maintains compatibility with existing HTML output
- Global toggle in settings (default: enabled)
- Per-result
type
field overrides global setting - User interaction cancels auto-execution
- Progress bars show countdown for auto-execution
- Static progress bars indicate priority for manual proposals
- Color coding: blue for countdown, gray for priority
- Pills appear within assistant messages
- Integrated with existing message rendering system
- Maintains message persistence and history
- Hover over NextSteps cancels auto-execution
- Click on any proposal cancels auto-execution
- Typing in chat input cancels auto-execution
- Visual feedback when cancelled
- MCP server returns tool result with
output.nextSteps
- Message component detects NextSteps during rendering
- NextSteps component manages countdown and user interaction
- Proposal execution triggers message sending via callback
- New user message added to chat history
- NextSteps component manages local countdown state
- User interaction state prevents auto-execution
- Global setting stored in localStorage
- No additional global state required
- Malformed NextSteps data falls back to raw display
- JSON parsing errors logged to console
- Missing required fields handled gracefully
- Client continues normal operation on errors
/frontend/components/NextSteps.tsx
- Main NextSteps component/NextSteps-README.md
- Feature documentation and MCP server spec/NextSteps-Examples.md
- Implementation examples for MCP servers/IMPLEMENTATION-SUMMARY.md
- This summary document
/shared/types.ts
- Added NextSteps type definitions/frontend/components/App.tsx
- Added autoExecuteNextSteps config/frontend/components/Message.tsx
- Added NextSteps detection and rendering/frontend/components/Settings.tsx
- Added auto-execution toggle/frontend/components/StreamingChat.tsx
- Modified fireSend for NextSteps/frontend/style.css
- Added NextSteps styling/README.md
- Updated feature list and documentation
- Create MCP tool that returns NextSteps with
type: "auto"
- Verify countdown timer appears and executes automatically
- Test user interaction cancellation (hover, click)
- Create NextSteps with
type: "manual"
and verify manual execution - Test priority display for manual proposals
- Verify global setting toggle in Settings
- Test mobile responsiveness
{ "output": { "nextSteps": { "type": "auto", "countdown": 5, "proposals": [ { "id": "test_action", "title": "Test Action", "description": "This is a test NextSteps proposal", "action": { "type": "send_message", "content": "NextSteps test completed successfully!" } } ] } } }
- Additional Action Types: File downloads, API calls, direct tool execution
- Conditional Logic: Proposals based on user context or chat history
- Scheduling: Delayed execution beyond immediate countdown
- Branching Workflows: Multiple workflow paths with decision points
- Templates: Reusable NextSteps patterns for common use cases
- Visual Enhancements: More sophisticated progress indicators
- Sound Notifications: Audio cues for countdown completion
- Keyboard Navigation: Arrow keys to select proposals
- Batch Operations: Multiple proposals executed in sequence
- History Integration: Ability to retry/branch from previous NextSteps
Implemented as output.nextSteps
field in MCP tool results, similar to existing HTML renderer pattern.
Global toggle in settings with per-result type
override. User interaction cancels auto-execution.
Progress bars show countdown (animated) or priority (static) with appropriate visual cues.
Pills appear within assistant messages, maintaining existing message persistence.
Hover, click, or typing cancels auto-execution with visual feedback.
The NextSteps feature has been successfully implemented according to all specified requirements. The implementation provides a robust, user-friendly interface for dynamic chat interactions while maintaining the existing application architecture and user experience. MCP server developers can now create engaging, guided workflows that enhance user productivity and provide intelligent automation options.
The feature is ready for production use and provides a solid foundation for future enhancements and workflow automation capabilities.