Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(mcp): enable cli mode for librechat (#61688)

Chris Volzer66ac7817beb0
diff --git a/services/mcp/src/lib/client-detection.ts b/services/mcp/src/lib/client-detection.ts
index eff97f7e1963..a6383cd6707a 100644
--- a/services/mcp/src/lib/client-detection.ts
+++ b/services/mcp/src/lib/client-detection.ts
@@ -59,6 +59,9 @@ export const CODING_AGENT_CLIENT_NAME_FRAGMENTS = [
'aider',
'copilot',
'gemini-cli',
+ // LibreChat is a general MCP client, but benefits from the same CLI-shaped
+ // single-exec mode as coding agents.
+ 'librechat',
// Notion AI ships its own `notion-mcp-client` (not a coding agent per se,
// but an LLM-driven consumer that benefits from the same single-exec mode
// and formatted-text rendering as coding agents).
diff --git a/services/mcp/tests/unit/client-detection.test.ts b/services/mcp/tests/unit/client-detection.test.ts
index a8b9c5d19bfa..00e9ef649c89 100644
--- a/services/mcp/tests/unit/client-detection.test.ts
+++ b/services/mcp/tests/unit/client-detection.test.ts
@@ -25,6 +25,7 @@ describe('isCodingAgentClient', () => {
['zed'],
['aider'],
['copilot'],
+ ['librechat'],
['notion'],
])('returns true for %s', (clientName) => {
expect(isCodingAgentClient(clientName)).toBe(true)
@@ -43,6 +44,9 @@ describe('isCodingAgentClient', () => {
['GitHub Copilot Chat'],
['zed-editor'],
['Codex CLI'],
+ ['LibreChat'],
+ ['libre-chat'],
+ ['LibreChat/1.2.3'],
['notion-mcp-client'],
['Notion'],
])('returns true for variant %s (case-insensitive substring match)', (clientName) => {
@@ -170,6 +174,8 @@ describe('MCPClientProfile', () => {
['aider'],
['github.copilot'],
['GitHub Copilot Chat'],
+ ['LibreChat'],
+ ['libre-chat'],
['notion-mcp-client'],
])('returns true for %s', (clientName) => {
expect(new MCPClientProfile({ clientName }).isCodingAgent()).toBe(true)
diff --git a/services/mcp/tests/unit/protocol-types.test.ts b/services/mcp/tests/unit/protocol-types.test.ts
index 96aacad755a1..8068a0ebb9c3 100644
--- a/services/mcp/tests/unit/protocol-types.test.ts
+++ b/services/mcp/tests/unit/protocol-types.test.ts
@@ -38,6 +38,14 @@ describe('resolveMode', () => {
expect(result).toEqual({ mode: 'cli', useSingleExec: true })
})
+ it('LibreChat activates single exec', () => {
+ const result = resolveMode({
+ ...base,
+ clientProfile: profile({ clientName: 'LibreChat' }),
+ })
+ expect(result).toEqual({ mode: 'cli', useSingleExec: true })
+ })
+
it('non-coding agent does NOT activate single exec', () => {
const result = resolveMode({
...base,