community-plugins icon indicating copy to clipboard operation
community-plugins copied to clipboard

Support conversation history for mcp chat

Open pshenbagadelip opened this issue 2 months ago • 7 comments

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

Screenshot 2025-11-03 at 4 38 08 PM Screenshot 2025-11-03 at 4 38 24 PM
  • [x] A changeset describing the change and affected packages. (more info)
  • [x] Added or updated documentation
  • [x] Tests for new functionality and regression tests for bug fixes
  • [x] Screenshots attached (for UI changes)
  • [x] All your commits have a Signed-off-by line in the message. (more info)

pshenbagadelip avatar Nov 03 '25 11:11 pshenbagadelip

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

backstage-goalie[bot] avatar Nov 03 '25 11:11 backstage-goalie[bot]

@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",

pshenbagadelip avatar Nov 03 '25 12:11 pshenbagadelip

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.

Lucifergene avatar Nov 04 '25 08:11 Lucifergene

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:

  1. Support for LLM providers – already completed
  2. Support for conversation history – implemented in this PR
  3. 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.

pshenbagadelip avatar Nov 04 '25 14:11 pshenbagadelip

@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",

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.

awanlin avatar Nov 07 '25 18:11 awanlin

When can we expect this PR to be merged? We’re looking forward to this feature.

naveenar27 avatar Nov 17 '25 03:11 naveenar27

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.

backstage-goalie[bot] avatar Nov 25 '25 13:11 backstage-goalie[bot]

@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.

Lucifergene avatar Nov 26 '25 21:11 Lucifergene