liter-llm

One MCP server for chat, embeddings, images, speech, OCR and batch jobs across many LLM providers

By Xberg.io Rust Local · stdio AI and ML

48 popularity score ★ 264 ↓ 958/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.

Or add it by command or config

It needs OPENAI_API_KEY. Replace each <NAME> with your value.

Claude CodeTerminal
claude mcp add liter-llm -e OPENAI_API_KEY=<OPENAI_API_KEY> -- npx -y @xberg-io/liter-llm-cli mcp --config '<ABSOLUTE_PATH_TO_LITER_LLM_PROXY_TOML>'
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "liter-llm": {
      "command": "npx",
      "args": [
        "-y",
        "@xberg-io/liter-llm-cli",
        "mcp",
        "--config",
        "<ABSOLUTE_PATH_TO_LITER_LLM_PROXY_TOML>"
      ],
      "env": {
        "OPENAI_API_KEY": "<OPENAI_API_KEY>"
      }
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "liter-llm": {
      "command": "npx",
      "args": [
        "-y",
        "@xberg-io/liter-llm-cli",
        "mcp",
        "--config",
        "<ABSOLUTE_PATH_TO_LITER_LLM_PROXY_TOML>"
      ],
      "env": {
        "OPENAI_API_KEY": "<OPENAI_API_KEY>"
      }
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "liter-llm": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@xberg-io/liter-llm-cli",
        "mcp",
        "--config",
        "<ABSOLUTE_PATH_TO_LITER_LLM_PROXY_TOML>"
      ],
      "env": {
        "OPENAI_API_KEY": "<OPENAI_API_KEY>"
      }
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.liter-llm]
command = "npx"
args = ["-y", "@xberg-io/liter-llm-cli", "mcp", "--config", "<ABSOLUTE_PATH_TO_LITER_LLM_PROXY_TOML>"]

[mcp_servers.liter-llm.env]
OPENAI_API_KEY = "<OPENAI_API_KEY>"
Gemini CLITerminal
gemini mcp add --scope user -e OPENAI_API_KEY=<OPENAI_API_KEY> liter-llm npx -- -y @xberg-io/liter-llm-cli mcp --config '<ABSOLUTE_PATH_TO_LITER_LLM_PROXY_TOML>'
Local (from source)

Add in one click

Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.

Or add it by command or config

It needs OPENAI_API_KEY. Replace each <NAME> with your value.

FirstTerminal
cargo install --git https://github.com/xberg-io/liter-llm --rev f14fb8862f9cc73e2c4ab38a2876efe77fab8bf4 --locked liter-llm-cli
Claude CodeTerminal
claude mcp add liter-llm -e OPENAI_API_KEY=<OPENAI_API_KEY> -- liter-llm mcp --config '<ABSOLUTE_PATH_TO_LITER_LLM_PROXY_TOML>'
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "liter-llm": {
      "command": "liter-llm",
      "args": [
        "mcp",
        "--config",
        "<ABSOLUTE_PATH_TO_LITER_LLM_PROXY_TOML>"
      ],
      "env": {
        "OPENAI_API_KEY": "<OPENAI_API_KEY>"
      }
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "liter-llm": {
      "command": "liter-llm",
      "args": [
        "mcp",
        "--config",
        "<ABSOLUTE_PATH_TO_LITER_LLM_PROXY_TOML>"
      ],
      "env": {
        "OPENAI_API_KEY": "<OPENAI_API_KEY>"
      }
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "liter-llm": {
      "type": "stdio",
      "command": "liter-llm",
      "args": [
        "mcp",
        "--config",
        "<ABSOLUTE_PATH_TO_LITER_LLM_PROXY_TOML>"
      ],
      "env": {
        "OPENAI_API_KEY": "<OPENAI_API_KEY>"
      }
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.liter-llm]
command = "liter-llm"
args = ["mcp", "--config", "<ABSOLUTE_PATH_TO_LITER_LLM_PROXY_TOML>"]

[mcp_servers.liter-llm.env]
OPENAI_API_KEY = "<OPENAI_API_KEY>"
Gemini CLITerminal
gemini mcp add --scope user -e OPENAI_API_KEY=<OPENAI_API_KEY> liter-llm liter-llm -- mcp --config '<ABSOLUTE_PATH_TO_LITER_LLM_PROXY_TOML>'

Settings 3

OPENAI_API_KEY Required: Key for the provider you call; set the matching one for others, such as ANTHROPIC_API_KEY.
ANTHROPIC_API_KEY Optional: Key for Anthropic models, when you route requests there.
LITER_LLM_MASTER_KEY Optional: Master key presented as a Bearer token in HTTP mode.

What it does

liter-llm is a Rust client library for calling many hosted and local language-model providers through one interface. Its command-line binary also carries an MCP server, started with `liter-llm mcp`, which turns that client into 22 tools an assistant can call: chat completions, embeddings, model listing, image generation, text-to-speech, transcription, moderation, reranking, provider-side search, OCR, provider file uploads, batch jobs and the Responses API.

The server reads the same `liter-llm-proxy.toml` as the project's OpenAI-compatible proxy, so models, aliases, caching, fallbacks and virtual keys defined there apply to tool calls too. It runs over stdio for a local client, or over Streamable HTTP on `POST /mcp` (port 3001 and address 127.0.0.1 by default) to share one server among several users. Besides tools it offers three prompts (summarize, translate, extract) and read-only resources for the configured models, the provider registry and per-model pricing.

In the v2.2.3 code, the file, batch and response tools are refused for anything but the master key context: a virtual key may only call the model-routed tools, and only for the models it lists (crates/liter-llm-proxy/src/mcp/mod.rs). Over stdio the whole server runs with the context set in the `[mcp]` table of the config.

What it needs

RuntimeNode.jsorRust

The liter-llm binary, version 2.2.3 from npm (`npx`, needs Node.js), Homebrew, Scoop, crates.io or a GitHub release; a `liter-llm-proxy.toml` whose `[mcp]` table sets `stdio_trust_local = true` or a `stdio_key_id`, which 2.2.3 needs to start over stdio; and an API key for each provider you call (an OpenAI, Anthropic or other account, billed by that provider). HTTP mode also needs a master or virtual key set in the config.

Limits

Released 2.2.3 exits on stdio start when the config sets neither `mcp.stdio_trust_local = true` nor `mcp.stdio_key_id`, so the docs' bare `liter-llm mcp` Claude Desktop example fails on that version; the trust-by-default fix exists only in a source build at a pinned commit. A `stdio_key_id` must name an existing virtual key or the server will not start. Image and audio tools return empty content when the chosen provider lacks the feature. Every tool returns its result as one JSON text block, with base64 for audio and file content.

Who it suits

Suits developers who already use several model providers and want an assistant to reach them through one configured gateway with aliases, caching and per-key model limits, or a team sharing one HTTP endpoint behind keys. It writes to provider accounts (uploads, deletes files, starts and cancels batches) and spends provider credit, so it fits people who manage those accounts. Someone who only needs one provider may prefer that provider's own tools; anyone on the released CLI must keep a config file in place.

Tools 22

chat
Send messages to a configured model and get a completion back
embed
Turn input text into embedding vectors with a chosen model
list_models
List the models available from the configured providers
generate_image
Create images from a text prompt
speech
Turn text into speech audio, returned as base64
transcribe
Convert base64 audio into text
moderate
Run text through a provider's moderation check
rerank
Order a list of documents by relevance to a query
search
Run a web or document search through a provider model
ocr
Pull text out of an image or document given by URL or base64
create_file
Upload a base64 file to the provider (master key only)
list_files
List files uploaded to the provider
retrieve_file
Get metadata for one uploaded file
delete_file
Remove an uploaded file from the provider
file_content
Download the raw content of an uploaded file
create_batch
Start a batch job from an uploaded input file
list_batches
List batch jobs
retrieve_batch
Get the status of one batch job
cancel_batch
Stop a batch job that is still running
create_response
Create a response through the Responses API
retrieve_response
Fetch a stored response by ID
cancel_response
Stop a response that is still in progress

Similar servers