# LibreChat MCP

> LibreChat MCP connects your self-hosted AI instances to any agent client. It lets you manage custom agents, list all available models, and generate chat completions using an OpenAI-compatible interface for your private LLM setups.

## Overview
- **Category:** productivity
- **Price:** Free
- **Tags:** llm-orchestration, chat-interface, self-hosted, model-management, ai-agents, unified-api

## Description

Connecting your own LibreChat environment through this MCP gives your AI client direct control over your private language model ecosystem. Instead of relying on a single provider's features, you can treat your self-hosted agents like any other tool right inside Claude or Cursor. You first use the `login` tool to authenticate with your credentials and grab necessary access tokens. Once authenticated, you can list everything available using `list_models`. After that, you send requests via `chat_completions` to run chats against specific agents. Need structured data? The `open_responses` tool handles that too. This makes building complex agent workflows simple, letting your AI client talk directly to the models you set up yourself. It’s a solid way to centralize access to multiple private LLMs through one secure interface on Vinkius.

## Tools

### chat_completions
Creates a chat completion using the Agents API, allowing you to send prompts and get model responses.

### list_models
Retrieves a list of all available models and agents configured in your LibreChat setup.

### login
Authenticates you with your credentials, retrieving necessary access and refresh tokens for the session.

### open_responses
Generates a structured AI output using the Open Responses API specification.

## Prompt Examples

**Prompt:** 
```
List all available agents in my LibreChat instance.
```

**Response:** 
```
I've retrieved the available agents. You have access to: 'Research-Assistant' (ID: agent_123), 'Code-Interpreter' (ID: agent_456), and 'General-Chat' (ID: agent_789).
```

**Prompt:** 
```
Login to LibreChat using my credentials.
```

**Response:** 
```
Authentication successful. I have obtained the access and refresh tokens for your session. You can now proceed with querying models or creating completions.
```

**Prompt:** 
```
Ask agent_123 to summarize the latest trends in AI.
```

**Response:** 
```
Sending request to agent_123... The agent responded: 'The current trends in AI include the rise of multi-modal models, autonomous agentic workflows, and increased focus on efficient small language models (SLMs)...'
```

## Capabilities

### List Available Models
You can ask the MCP for a full list of every agent and model configured in your LibreChat instance.

### Run Chat Completions
The MCP sends messages to specific agents, generating responses that mimic standard chat completion APIs.

### Generate Structured Responses
You prompt the agent for output and receive a highly structured response using the Open Responses API format.

### Manage Authentication
The MCP allows you to log in directly with your email and password, obtaining required access tokens without needing static API keys.

## Use Cases

### Building an internal research assistant
A researcher needs their agent client to talk to five different specialized models. Instead of configuring five separate API endpoints, they connect the LibreChat MCP, run `list_models` to verify all agents are online, and then use `chat_completions` to route queries dynamically based on the prompt topic.

### Automating compliance reporting
A DevOps team needs an agent to summarize operational data into a strict JSON format. They connect via LibreChat MCP and use `open_responses`, forcing the model output into a predictable, machine-readable structure that can be automatically ingested by another system.

### Integrating legacy LLMs
A developer has an older, specialized agent running on custom hardware. They connect it through LibreChat MCP and expose its functionality via `chat_completions`, allowing modern tools like Cursor to interact with the old system without code changes.

### Testing new agents quickly
A power user wants to test an experimental agent before deploying it widely. They first use `login` for quick authentication, then run `list_models` to find the specific ID, and finally execute a few test prompts using `chat_completions`.

## Benefits

- You get centralized control over multiple private LLMs. Instead of managing separate API keys for every model, you connect once to the LibreChat MCP and gain access to everything.
- The `chat_completions` tool lets you run complex chats against agents using a standard OpenAI-compatible interface, making integration painless for your developers.
- Authentication is easier with `login`. You can log in directly using credentials (email/password) instead of relying solely on static API keys.
- Structured data output is guaranteed via the `open_responses` tool. If you need JSON or a specific schema from an agent, this ensures your response format is consistent every time.
- The `list_models` capability instantly shows you what agents are available, saving you the headache of guessing which IDs to use in your workflows.

## How It Works

The bottom line is, it gives your AI client programmatic access to run and manage every model in your self-hosted LibreChat environment.

1. Subscribe to the LibreChat MCP and provide your Base URL. If you don't have an API key, use the `login` tool with your email and password.
2. Use `list_models` to confirm that all desired agents are visible to your AI client.
3. Send a prompt using either `chat_completions` or `open_responses`, targeting the specific agent ID you need.

## Frequently Asked Questions

**How do I get started with the LibreChat MCP?**
You start by subscribing to the MCP and running the `login` tool using your credentials. This authenticates you and gives your agent client the necessary tokens for subsequent calls.

**Can I use chat_completions with agents that aren't OpenAI-compatible?**
Yes, that is the point of this MCP. It provides an OpenAI-compatible interface layer over your self-hosted LibreChat environment, making diverse models appear uniform to your client.

**Is there a way to check which agents are active in my LibreChat instance?**
Use the `list_models` tool. It provides an immediate overview of all available agents and model configurations, saving you from guessing IDs.

**What if I need the output data to be perfectly formatted JSON?**
For guaranteed structure, use the `open_responses` tool. This API is specifically designed to force your agent's response into a predictable format that downstream systems can read.

**Does this MCP require me to modify my core AI client code?**
No. You connect the LibreChat MCP through your existing compatible client (Claude, Cursor, etc.). The tool handles the complex routing and API translation for you.