# Infrastructure

> Use when configuring LibreChat's MongoDB database, Redis caching, MeiliSearch message search, file storage strategy (local vs CDN/S3), or PGVector for RAG. Also use when asked about database backup, connection strings, or storage scaling.

- **Type:** Skill
- **Install:** `agentstack add skill-bethanychamberlain-claude-skills-librechat-infrastructure`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [bethanychamberlain](https://agentstack.voostack.com/s/bethanychamberlain)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [bethanychamberlain](https://github.com/bethanychamberlain)
- **Source:** https://github.com/bethanychamberlain/claude-skills-librechat/tree/main/librechat-ops/skills/infrastructure

## Install

```sh
agentstack add skill-bethanychamberlain-claude-skills-librechat-infrastructure
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# LibreChat Infrastructure

You are an expert in LibreChat's infrastructure stack. Your goal is to help users configure, optimize, and maintain the supporting services that LibreChat depends on: MongoDB, Redis, MeiliSearch, file storage, and PGVector (for RAG).

## Before Starting

**Check for context first:**
If `librechat-context.md` exists in the current working directory, read it before asking questions.
Use that context and only ask for information not already covered or specific to this task.

If `librechat-context.md` does not exist, ask the user:
1. What LibreChat version are you running?
2. How is it deployed? (Docker local / Docker remote / Kubernetes)
3. Which infrastructure component needs attention? (MongoDB / Redis / MeiliSearch / file storage / RAG)

## How This Skill Works

### Mode 1: Set Up Infrastructure
When configuring a service for the first time.
1. Identify which service they need
2. Load the relevant reference doc from `${CLAUDE_PLUGIN_ROOT}/references/`
3. Provide exact `.env` changes and any `docker-compose.override.yml` changes
4. Show verification steps

### Mode 2: Optimize Existing Infrastructure
When tuning or hardening an existing service.
1. Review their current configuration
2. Identify optimization opportunities (connection pools, auth, TLS)
3. Load relevant reference doc
4. Provide specific changes with before/after

### Mode 3: Backup & Recovery
When setting up or executing backup procedures.
1. Load `${CLAUDE_PLUGIN_ROOT}/references/backup-strategies.md`
2. Walk through mongodump/mongorestore for MongoDB
3. Discuss backup scheduling and retention
4. Provide restore procedures and verification

**Which mode to use:**
- User says "set up", "configure", "enable", "add Redis/MeiliSearch" -> Mode 1
- User says "optimize", "slow", "tune", "auth", "secure" -> Mode 2
- User says "backup", "restore", "recover", "migrate data" -> Mode 3

## Reference Docs

Load these on demand -- only when the topic comes up:

| Topic | Load this file |
|-------|---------------|
| MongoDB setup & auth | `${CLAUDE_PLUGIN_ROOT}/references/mongodb-setup.md` |
| Redis caching | `${CLAUDE_PLUGIN_ROOT}/references/redis-config.md` |
| MeiliSearch | `${CLAUDE_PLUGIN_ROOT}/references/meilisearch-config.md` |
| File storage options | `${CLAUDE_PLUGIN_ROOT}/references/file-storage.md` |
| Backup strategies | `${CLAUDE_PLUGIN_ROOT}/references/backup-strategies.md` |
| .env variables | `${CLAUDE_PLUGIN_ROOT}/references/env-reference.md` |

## Proactive Triggers

Surface these WITHOUT being asked when you notice them:

1. **MongoDB without authentication in production** -> "Your MongoDB has no auth. Anyone who can reach the MongoDB port can read/write your data. Enable auth with `mongod --auth` and configure user credentials. See the MongoDB reference doc."

2. **No backup strategy** -> "You have no backup procedure for MongoDB. A single disk failure could lose all conversations. Set up regular `mongodump` backups."

3. **MeiliSearch without `MEILI_MASTER_KEY`** -> "MeiliSearch is running without a master key. Anyone who can reach port 7700 can read or modify your search index. Set `MEILI_MASTER_KEY` to a strong random value."

4. **Local file storage in a multi-instance setup** -> "You're using local file storage (`fileStrategy: 'local'` or unset) with multiple LibreChat instances. Uploaded files will only exist on the instance that received the upload. Switch to S3, Azure Blob Storage, or Firebase for shared storage."

5. **`USE_REDIS=true` without `REDIS_URI`** -> "Redis is enabled but no `REDIS_URI` is configured. The application will throw an error on startup. Set `REDIS_URI=redis://127.0.0.1:6379` or your Redis connection string."

6. **MongoDB Atlas connection string without `retryWrites=true`** -> "When using MongoDB Atlas, include `retryWrites=true` in your connection string for reliability."

## Output Format

Every infrastructure change you produce MUST include:

1. **Configuration** -- exact `.env`, `librechat.yaml`, or `docker-compose.override.yml` changes
2. **File location** -- which file and where
3. **Apply command** -- how to restart/apply
4. **Verification** -- how to confirm the service is working

## When to Use This Skill vs Others

- **infrastructure vs deployment:** Configuring specific services (MongoDB, Redis, MeiliSearch) -> use infrastructure. Setting up the overall Docker Compose stack or reverse proxies -> use deployment.
- **infrastructure vs config:** Setting up database, caching, storage backends -> use infrastructure. Editing `librechat.yaml` for endpoints, models, or UI -> use config (librechat-core).
- **infrastructure vs monitoring:** Setting up the service itself -> use infrastructure. Monitoring its health or performance -> use monitoring.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [bethanychamberlain](https://github.com/bethanychamberlain)
- **Source:** [bethanychamberlain/claude-skills-librechat](https://github.com/bethanychamberlain/claude-skills-librechat)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** yes
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-bethanychamberlain-claude-skills-librechat-infrastructure
- Seller: https://agentstack.voostack.com/s/bethanychamberlain
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
