WEIR

LibreChat MCP Server Setup: librechat.yaml, Keys and OAuth

Configure LibreChat MCP servers in librechat.yaml: the streamable-http entry, shared or per-user keys, the OAuth callback rule and the requiresOAuth trap.


Published · Updated · 6 min read

Cover image: X research inside LibreChat

LibreChat MCP servers live under mcpServers in librechat.yaml: a remote server needs type: streamable-http, a url, and a key or OAuth.

This guide adds Weir, so your LibreChat chats and agents can search X (Twitter) and read posts, threads and profiles. Weir only reads, so it never posts as you. We run Weir.

mcpServers:
  weir:
    type: streamable-http
    url: https://api.weirapp.io/mcp
    requiresOAuth: false
    headers:
      Authorization: "Bearer ${WEIR_API_KEY}"

LibreChat MCP configuration: add Weir in five steps

You need access to LibreChat's librechat.yaml and .env files, and a free Weir account.

We read LibreChat v0.8.8, tagged 1 October 2026: its docs and its source.

  1. Create a keyIn your Weir dashboard, open API keys and create one. It starts with weir_live_ and shows once.
  2. Add it to .envAdd the line WEIR_API_KEY=weir_live_... to the .env file LibreChat reads.
  3. Add the serverPaste the YAML above under mcpServers in librechat.yaml.
  4. Restart LibreChatIt reads librechat.yaml only when it starts.
  5. Pick Weir in a chatChoose a model that can call tools, open the MCP Servers menu in the message box and select Weir.

Why requiresOAuth: false? At startup, LibreChat checks each remote server for sign-in, and it checks without your headers. Weir answers a request with no key like this:

HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer resource_metadata="https://api.weirapp.io/.well-known/
  oauth-protected-resource/mcp", scope="read:social usage:read monitors:read"

LibreChat then treats Weir as an OAuth server and prompts users to sign in. Its docs name this exact case. An apiKey block (source: admin, key: "${WEIR_API_KEY}", authorization_type: bearer) skips the check by itself.

Shared key, per-user keys or OAuth?

Use a shared key for a small team, per-user keys when each person should pay, and OAuth when users would rather sign in than paste.

Route Who pays Callback rule
${WEIR_API_KEY} Your account, always None
{{WEIR_API_KEY}} Each user's account None
OAuth sign-in Whoever signs in HTTPS or localhost

The braces decide where a value comes from. ${VAR} reads LibreChat's environment. {{VAR}} reads a value the user typed in, declared under customUserVars:

mcpServers:
  weir:
    type: streamable-http
    url: https://api.weirapp.io/mcp
    requiresOAuth: false
    headers:
      Authorization: "Bearer {{WEIR_API_KEY}}"
    customUserVars:
      WEIR_API_KEY:
        title: Weir API key
        description: Create one under API keys at weirapp.io

Each user then saves their key in the MCP Settings panel on the right. LibreChat stores it per user, so nobody sees anyone else's.

Placeholders like {{LIBRECHAT_USER_ID}} fill in the signed-in user's profile. Weir doesn't need them.

Does LibreChat MCP support OAuth?

Yes. Drop the key, set requiresOAuth: true, and LibreChat registers itself with Weir through dynamic client registration.

  • The callback is fixed. It's DOMAIN_SERVER plus /api/mcp/weir/oauth/callback, where weir is your server key.
  • Weir checks that address. It accepts HTTPS, or plain http on localhost. LibreChat's default http://localhost:3080 passes.
  • A LAN address fails. With http://192.168.1.20:3080, Weir refuses with invalid_redirect_uri. Serve LibreChat over HTTPS, or use a key.
  • Each person signs in with their own account. LibreChat keeps one token per user and refreshes it. The link shows as "LibreChat MCP Client (MCP)" under API keys in that person's Weir dashboard.

How to use LibreChat MCP tools in chat and agents

In a chat, all of Weir's tools go to the model once you select it. In an agent, you choose tools one by one.

  • Agents: open Add tools in the Agent Builder, choose MCP, pick Weir, then expand it to switch single tools on or off.
  • Newer menus: LibreChat's docs already describe a + palette in the message box. That's on the main branch, after v0.8.8.
  • Tool names: the model sees search_x_mcp_weir. LibreChat adds _mcp_ and the server key.
  • Agent-only servers: chatMenu: false hides Weir from plain chat, while saved agents keep it.

Weir offers more than 40 tools. A key created without Reddit lists no Reddit tools, which keeps an X agent's list short.

Can LibreChat search X (Twitter)? A worked example

Yes, through Weir. Select it and ask:

What has @LibreChatAI posted about MCP? Skip replies and reposts.

The model should call search_x_mcp_weir. We ran that call through Weir's MCP server on 24 October 2026:

→ search_x {"fromUsers": ["LibreChatAI"], "query": "MCP -filter:nativeretweets",
            "onlyOriginal": true, "limit": 1}
← 1 post · 2 credits (1 + 1 × 1) · nextCursor set
  2026-06-01  9 likes  704 views  "LibreChat v0.8.6 is out"

The newest match is a release post that lists "MCP upgrades" among its highlights. LibreChat passes the model Weir's JSON, then a line like "Charged 2 credits; 594 credits left."

2credits for our 1-post search
11credits for a 10-post search
0credits for get_usage
5,000free Weir credits every month

Weir bills 1 credit per call plus 1 per X post, and failed calls are free. Packs start at $5 for 25,000 credits and never expire, as of October 2026. See every rate on our pricing page.

What we haven't tested

We didn't install LibreChat. This guide comes from its v0.8.8 docs and source, plus a no-key request and a real call to Weir's MCP server.

  • LibreChat's sign-in against Weir. Its registration matches what Weir accepts, but we haven't clicked through it.
  • The YAML blocks. They parse, and we checked each key against v0.8.8's config schema by hand. We haven't loaded them into a live LibreChat.

If it doesn't work

  • Users get a sign-in prompt although you set a key. Add requiresOAuth: false and restart.
  • Weir never connects. Check type: streamable-http, then check that mcpSettings.allowedDomains, if set, lists api.weirapp.io.
  • 401 with a key. The header must read Bearer weir_live_.... Check the key with Weir's free GET /v1/whoami.
  • Sign-in stops at invalid_redirect_uri. Your DOMAIN_SERVER is plain http on a network address. Switch to a key.
  • A tool returns 402. Your Weir credits ran out, and retrying won't help.

When not to use Weir

  • You want to stay fully offline. Weir is a remote service, so each call goes over the internet.
  • The model has to post or DM. Weir is read-only.
  • Price per post matters most. TwitterAPI.io lists $0.15 per 1,000 tweets as of October 2026, less than our $5 pack.
  • You need a guarantee. Weir isn't licensed by X or affiliated with it, so access can change.

FAQ

Where do LibreChat MCP servers go in librechat.yaml?

Under the top-level mcpServers key, one entry per server. The entry's name is the server key, used in tool names and the sign-in callback. Restart after edits. Servers added in the MCP Settings panel need no restart.

Can users add their own MCP servers in LibreChat?

Yes, if an admin allows it under interface.mcpServers. They click + in the MCP Settings panel. Servers made there resolve only customUserVars, never ${VAR} or {{LIBRECHAT_USER_*}}, LibreChat's docs say.

What are LibreChat MCP apps?

LibreChat's docs describe MCP Apps: small views a server sends with a tool result, turned on with mcpSettings.apps. That setting isn't in v0.8.8's config schema, so expect it in a later release. Weir returns plain JSON, so it has no app to show.

Can LibreChat post to X through Weir?

No. Weir only reads public X data, so nothing can post, like or follow through it.

Sources

All checked on 24 October 2026: