Support conversation history for mcp chat
Hey, I just made a Pull Request!
Support Conversation History for MCP chat
Description
Added conversation history storage for authenticated users with optimized guest user handling. Guest users (user:development/guest) are excluded from database operations to provide a stateless, high-performance experience while authenticated users get full conversation history tracking.
Changes
- Added
isGuestUser()utility function to identify guest users in both backend and frontend - Implemented guest user exclusion in backend router for all conversation endpoints
- Optimized frontend to skip API calls for guest users (no loading spinners, instant response)
- Added conversation history configuration option (
conversationHistory.displayLimit) - Updated README.md with conversation history documentation and guest user behavior
- Added comprehensive unit tests for guest user scenarios
- Created changeset for version bump (minor)
Testing
- ✅ All unit tests pass
- ✅ 10 useConversations tests (added 2 guest user tests)
- ✅ Updated ConversationList tests for guest handling
- ✅ Guest users: No database queries, instant empty state
- ✅ Authenticated users: Full conversation history saved and retrieved
- ✅ Backend validates guest status before all DB operations
- ✅ Frontend skips API calls entirely for guest users
Screenshots
Changed Packages
| Package Name | Package Path | Changeset Bump | Current Version |
|---|---|---|---|
| @backstage-community/plugin-mcp-chat-backend | workspaces/mcp-chat/plugins/mcp-chat-backend | minor | v0.3.0 |
| @backstage-community/plugin-mcp-chat | workspaces/mcp-chat/plugins/mcp-chat | minor | v0.1.1 |
@Lucifergene Not sure why the yarn tsc:full is looking for node_modules directory. do i need to enable the boolean
"tsc:full": "tsc --skipLibCheck false --incremental false",
to
"tsc:full": "tsc --skipLibCheck --incremental false",
Thanks @pshenbagadelip for implementing this feature. It’s something we had planned for our roadmap next year, so it’s great to see this contribution coming in early.
We’ll need some time to review the implementation thoroughly and evaluate how it aligns with the broader ecosystem we’re building. To be transparent, we haven’t fully explored this area yet, so your PR will definitely help us shape our thinking and direction.
Given the scope of this feature, the review and merge process may take some time as we discuss and experiment with a few related aspects. That said, this is likely to be one of the next major features we plan to ship for the plugin.
As a suggestion, for large features like this, it’s always helpful to start with an issue first. That allows us to have an open discussion upfront, share context, and collaborate more effectively before diving into implementation.
Once again, thank you for your effort and enthusiasm here. Please continue sharing ideas and proposing new features, we truly appreciate your contributions and initiative.
Thanks for the inputs on the roadmap, @Lucifergene !
The main reason I contributed this feature is that conversation history felt like a core capability that was missing — especially since it’s essential for any chatbot experience. We’re currently exploring chatbot integrations, and this one looked very promising, which motivated me to contribute.
I’ve outlined three key enhancements I planned to work on for the MCP chat bot:
- Support for LLM providers – already completed
- Support for conversation history – implemented in this PR
- Support for invoking MCP server calls using the logged-in user’s credentials instead of a hardcoded service user token from app-config, since many tools don’t allow actions through a service account
Once these three capabilities are in place, we’ll be in a strong position to adopt this plugin and roll it out to our developer community.
I wasn’t fully aware of the usual process followed in the open-source community, so apologies for creating a direct PR with the feature implementation.
@Lucifergene Not sure why the yarn
tsc:fullis looking for node_modules directory. do i need to enable the boolean
"tsc:full": "tsc --skipLibCheck false --incremental false",to
"tsc:full": "tsc --skipLibCheck --incremental false",
Please don't change this, that's a repo wide convention we prefer to have in place and it will generally help us spot potential problems and/or bugs in advance.
When can we expect this PR to be merged? We’re looking forward to this feature.
Thanks for the contribution! All commits need to be DCO signed before they are reviewed. Please refer to the the DCO section in CONTRIBUTING.md or the DCO status for more info.
@pshenbagadelip We have started to look into this feature. Took some time to complete some of the backlogs. I am going through your implementation and starting a discussion soon. It might take some time as I will be off for couple of weeks in December. We will surely have this feature by January'26.
Meanwhile, any reviews from other maintainers are welcome.