MCP Llama Swap MCP Server

Running local LLMs means choosing between a strong reasoning model and a fast coding model. You can't load both on a single machine. Manually

Local serverstdioPython

What is the MCP Llama Swap MCP server?

Running local LLMs means choosing between a strong reasoning model and a fast coding model. You can't load both on a single machine. Manually swapping models kills your conversation context and flow. The mcp llama swap mcp server wraps that behind the Model Context Protocol, so an assistant can use it through 5 defined tools rather than through you.

Adding it to your client

mcp-llama-swap on PyPI is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Its toolset

Everything the assistant can do here goes through one of these:

  • list_models — Lists all configured models with load status and current mode
  • get_current_model — Returns the alias of the currently loaded model
  • swap_model — Unloads current model, loads the specified one, waits for health check
  • create_model_config — Generates a new launchd plist (macOS) or systemd unit (Linux) for a model
  • Prerequisites — The Prerequisites tool exposed by this server

Configuration

You will need 4 environment variables: LLAMA_SWAP_CONFIG, ANTHROPIC_BASE_URL, ANTHROPIC_API_KEY, ANTHROPIC_MODEL. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

  • macOS with launchctl, or Linux with systemd - llama-server (llama.cpp) installed - Model configurations as service files (launchd plists or systemd units) - Python 3.10+ - Claude Code CLI pointed at a LiteLLM proxy

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the mcp llama swap mcp server does with a few real requests.

When to reach for it

This sits in the developer tooling group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. MCP Llama Swap's toolset — list_models, get_current_model, swap_model and 2 more — is a fair guide to whether it matches your workflow. It is maintained by oussama-kh; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Available tools

ToolWhat it does
list_modelsLists all configured models with load status and current mode
get_current_modelReturns the alias of the currently loaded model
swap_modelUnloads current model, loads the specified one, waits for health check
create_model_configGenerates a new launchd plist (macOS) or systemd unit (Linux) for a model
PrerequisitesThe Prerequisites tool exposed by this server.

How to install the MCP Llama Swap MCP server

{
  "mcpServers": {
    "llama-swap": {
      "command": "uvx",
      "args": ["mcp-llama-swap"],
      "env": {
        "LLAMA_SWAP_CONFIG": "your-value",
        "ANTHROPIC_BASE_URL": "your-value",
        "ANTHROPIC_API_KEY": "your-value",
        "ANTHROPIC_MODEL": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

  • macOS with launchctl, or Linux with systemd - llama-server (llama.cpp) installed - Model configurations as service files (launchd plists or systemd units) - Python 3.10+ - Claude Code CLI pointed at a LiteLLM proxy
VariableDescriptionRequired
LLAMA_SWAP_CONFIGConfiguration value read at startup.Optional
ANTHROPIC_BASE_URLEndpoint or connection string the server talks to.Yes
ANTHROPIC_API_KEYCredential the server authenticates with.Yes
ANTHROPIC_MODELConfiguration value read at startup.Optional

Example prompts to try

  • Use MCP Llama Swap to list models.
  • Use MCP Llama Swap to get current model.
  • Use MCP Llama Swap to swap model.

Frequently asked questions

It connects MCP Llama Swap to MCP-compatible AI assistants such as Claude and Cursor, exposing 5 tools (list_models, get_current_model, swap_model, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with MCP Llama Swap directly.