feat(mcp): migrate backend from Hermes to LibreChat#27
Open
itsablabla wants to merge 4 commits intomainfrom
Open
feat(mcp): migrate backend from Hermes to LibreChat#27itsablabla wants to merge 4 commits intomainfrom
itsablabla wants to merge 4 commits intomainfrom
Conversation
- PHP proxy now calls LibreChat's OpenAI-compatible API at /api/agents/v1/chat/completions - Model changed from 'hermes-agent' to 'agent_jada_nextcloud' (LibreChat agent with 118 MCP tools) - Default URL changed to http://LibreChat:3080 (Docker DNS on nextcloud-aio network) - Vue SSE parser handles standard OpenAI delta.tool_calls format (LibreChat) - Tool names stripped of _mcp_serverName suffix for display (e.g. nc_webdav_list_directory_mcp_nextcloud → nc_webdav_list_directory) - Backward compat: legacy hermes.tool.progress events still parsed - Version bumped to 0.4.0 - Updated info.xml description to reflect LibreChat architecture
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Fixes Devin Review finding: /_mcp_[^_]+$/ fails for server names containing underscores (e.g. my_server). Changed to /_mcp_.+$/ which greedily matches everything after the _mcp_ delimiter.
- getSkills(): return empty list (LibreChat has no skills endpoint) - getModels(): proxy to LibreChat's /api/agents/v1/models - getConfig(): return stub with engine info (config managed via LibreChat admin UI) - getSessions(): return empty list (LibreChat manages sessions internally) Fixes Devin Review finding: these 4 methods still used Hermes-specific /api/v1/* paths that don't exist on LibreChat.
- AdminSettings.php: default URL http://localhost:18789 → http://LibreChat:3080 - SettingsController.php: same default URL update - templates/admin.php: placeholder URL + heading updated to LibreChat Fixes Devin Review finding: admin UI showed stale Hermes defaults.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the custom Hermes Agent backend with LibreChat as the headless API backend. LibreChat provides native MCP support (118 Nextcloud tools via Streamable HTTP), multi-model switching, built-in context compression, and an agent framework — eliminating the custom agent loop, context overflow bugs, and per-tool middleware that required constant patching.
What changed
PHP Proxy (
OpenClawService.php+AgentController.php)http://localhost:18789(Hermes) →http://LibreChat:3080(Docker DNS onnextcloud-aionetwork)/v1/chat/completions→/api/agents/v1/chat/completions(LibreChat's OpenAI-compatible agents endpoint)hermes-agent→agent_jada_nextcloud(LibreChat agent configured with Gemini 2.5 Flash + 118 MCP tools)/api/agents/v1/modelsand reportsengine: librechatVue Frontend (
ChatView.vue)delta.tool_callsformat (LibreChat sends tool calls this way instead of Hermes's customevent: hermes.tool.progress)_mcp_serverNamesuffix for display (e.g.,nc_webdav_list_directory_mcp_nextcloud→nc_webdav_list_directory)hermes.tool.progressevents still parsedMetadata
info.xmldescription updated to reflect LibreChat architectureInfrastructure (already deployed on server)
nextcloud-aioDocker network (DNS name:LibreChat)agent_jada_nextcloudcreated in MongoDB withsys__all__sys_mcp_nextcloud(all 118 tools)http://nextcloud-mcp-server:8000/mcp(Streamable HTTP)librechat_defaultnetwork (external API access)Review & Testing Checklist for Human
_mcp_nextcloudsuffix)Notes
openclaw_token), not hardcoded in PHPtoolName_mcp_serverName(server name LAST, not first) — this was the root cause of the MCP tool parsing bug in the previous sessionsys__all__sys_mcp_nextcloudtool reference tells LibreChat to load ALL tools from thenextcloudMCP server, instead of listing each of the 118 tools individuallyLink to Devin session: https://app.devin.ai/sessions/f4e16f12bfa34fc6bdc3d73a833a5d91
Requested by: @itsablabla