Dev.to AI πŸ€– Ai πŸ‘ 0 πŸ“– 5 min read

How to Build Your Own Team ChatGPT With LibreChat, Claude and MCP (Pay per Token, Not per Seat)

Most companies buy AI as seats. ChatGPT Business is $20 per user per month on annual billing and $25 on monthly billing, and OpenAI says more than 9 million paying business users now rely on ChatGPT for work. For a 200-p

How to Build Your Own Team ChatGPT With LibreChat, Claude and MCP (Pay per Token, Not per Seat)

Most companies buy AI as seats. ChatGPT Business is $20 per user per month on annual billing and $25 on monthly billing, and OpenAI says more than 9 million paying business users now rely on ChatGPT for work. For a 200-person company that is $48,000 to $60,000 a year, whether people use it or not.

This guide builds the alternative that a lot of engineering teams are moving to: your own "team ChatGPT" on LibreChat (open source, MIT, about 46.6K GitHub stars), with Claude as the model, MCP connectors for Google Drive and Gmail, shared skills and agents, company SSO, and per-user spend caps. It runs in your own cloud account and you pay per token instead of per seat.

A team using a self-hosted team ChatGPT built on LibreChat and Claude

Everything below comes from the current LibreChat example config (librechat.yaml version 1.3.18) and docs. Check the docs for your release before you copy anything into production.

What you are building

Browser (SSO login)
   |
LibreChat (web + API)  ->  MongoDB (users, chats, balances)
   |                   ->  Meilisearch (chat search)
   |                   ->  RAG API + pgvector (file search)
   |
   +-> Anthropic API (Claude Sonnet 5.5 / Haiku 5.5)
   +-> MCP servers (Google Workspace: Drive, Gmail, Calendar)

Prerequisites

  • A Linux VM with Docker and Docker Compose (start with 2 vCPU and 8 GB RAM for a pilot)
  • A domain and TLS (any reverse proxy or a cloud load balancer)
  • An Anthropic API key
  • Optional: an OpenID Connect app in Google Workspace, Okta or Microsoft Entra ID for SSO

Step 1: Clone and configure

git clone https://github.com/danny-avila/LibreChat.git
cd LibreChat
cp .env.example .env
cp librechat.example.yaml librechat.yaml
cp docker-compose.override.yml.example docker-compose.override.yml

In docker-compose.override.yml, uncomment the block that mounts your config into the API container:

services:
  api:
    volumes:
    - type: bind
      source: ./librechat.yaml
      target: /app/librechat.yaml

Step 2: Point it at Claude

In .env, set a company-owned key (the default user_provided asks each user for their own key, which is not what you want for a team):

ANTHROPIC_API_KEY=sk-ant-your-company-key
ANTHROPIC_MODELS=claude-sonnet-5-5,claude-haiku-5-5

Why two models: on Anthropic's current price list, Sonnet 5.5 is $2 / $10 per million input / output tokens and Haiku 5.5 is $0.10 / $0.50 for prompts up to 100K tokens. Offer Haiku for quick rewrites and summaries, and keep Sonnet for real reasoning. That one choice can cut the token bill roughly in half.

Step 3: Turn on spend caps before anyone logs in

Per-token pricing has one risk: a single power user running long agent sessions. LibreChat has a built-in token balance. In librechat.yaml:

version: 1.3.18

balance:
  enabled: true
  startBalance: 15000000       # 1,000,000 credits = $1, so about $15
  autoRefillEnabled: true
  refillIntervalValue: 30
  refillIntervalUnit: 'days'
  refillAmount: 15000000

LibreChat counts 1,000 credits as $0.001, so 15,000,000 credits is roughly $15 of model usage per person per month, still under a $20 to $25 seat. Tune the numbers after the first two weeks of real usage. The point is that no single account can surprise you.

Step 4: Company SSO

Use OpenID Connect so people sign in with their work account and leave when they leave. In .env:

ALLOW_SOCIAL_LOGIN=true
OPENID_CLIENT_ID=your-client-id
OPENID_CLIENT_SECRET=your-client-secret
OPENID_ISSUER=https://your-idp.example.com
OPENID_SESSION_SECRET=a-long-random-string
OPENID_SCOPE="openid profile email"
OPENID_CALLBACK_URL=/oauth/openid/callback

Once SSO works, set ALLOW_REGISTRATION=false so nobody can create a local account around it.

Step 5: MCP connectors for Drive and Gmail

This is what turns a chat window into a work tool. LibreChat speaks the Model Context Protocol and supports stdio, sse, websocket and streamable-http servers. Each user's connection and OAuth tokens are kept per user and never shared.

For Google Workspace, one option is the open-source google_workspace_mcp server (MIT), which covers Gmail, Drive, Calendar, Docs, Sheets and more, runs over streamable HTTP and supports OAuth 2.1 for multiple users. Run it next to LibreChat and register it:

mcpServers:
  google-workspace:
    type: streamable-http
    url: http://workspace-mcp:8000/mcp
    requiresOAuth: true
    timeout: 60000

When someone first uses a Drive or Gmail tool, LibreChat asks them to sign in with their own Google account, so the assistant only sees what that person can already see.

You can also pass the signed-in user to your own internal MCP servers with placeholders:

  internal-crm:
    type: streamable-http
    url: https://crm-mcp.internal.example.com/mcp
    headers:
      X-User-Email: '{{LIBRECHAT_USER_EMAIL}}'
      X-API-Key: '${CRM_MCP_KEY}'

Step 6: Shared skills and agents

Two features make the tool feel like it belongs to your company.

Skills. LibreChat can mirror a GitHub repo of SKILL.md files, so your team keeps prompts and procedures (brand voice, proposal format, support macros) in version control:

skillSync:
  github:
    enabled: true
    intervalMinutes: 60
    runOnStartup: true
    sources:
      - id: company-skills
        owner: your-org
        repo: ai-skills
        ref: main
        paths:
          - skills
        skillDiscoveryDepth: 2
        token: '${GITHUB_SKILLS_TOKEN}'

Agents. In the Agent Builder, create agents for real jobs, add MCP tools from the Tool Library, and share them with a group. Three that pay off quickly:

  1. Proposal drafter: reads the client folder in Drive, writes the first draft in your format.
  2. Policy answerer: answers HR and IT questions from your handbook files, with sources.
  3. Inbox triage: summarises unread threads and drafts replies for a human to send.

Step 7: Start it and set roles

docker compose up -d

Use the admin panel to manage users, groups and roles: who can create agents, who can add MCP servers, and which groups see which agents.

What it costs

Assume 200 people, 25 messages each per working day, 4,000 input and 600 output tokens per message:

Setup Monthly cost
ChatGPT Business, 200 seats $4,000 to $5,000
LibreChat + Sonnet 5.5 only (+ ~$300 hosting) about $1,770
LibreChat + half Haiku 5.5 (+ ~$300 hosting) about $1,070

These are estimates from the stated assumptions, not quotes. Run them with your own usage numbers.

When not to do this

  • Under about 50 daily users, the seat plan is cheaper than the engineering time.
  • If nobody on the team can own upgrades, backups and connector issues, do not self-host.
  • If the only reason is cost, check the numbers twice. The strongest reasons are data in your own cloud, multiple model vendors, and connecting internal systems.

Need it built?

Axionry is an AI product development studio. We build private team assistants like this, with your SSO, your connectors and Claude or open-weights models, in a couple of weeks. Here is the product page: axionry.com/build/private-chatgpt.

Sources

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.