llama-diffusion-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@llama-diffusion-mcpChat with diffusion about the meaning of dreams"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Llama Diffusion MCP Bridge
A robust, bidirectional Model Context Protocol (MCP) server that allows Large Language Models (like Claude) to seamlessly interact with diffusion-based LLMs (e.g., DiffusionGemma, LLaDA, RND1) via llama-diffusion-cli.
✨ Features
Bidirectional Interactive Chat: Spawns and manages a persistent background instance of
llama-diffusion-clito maintain conversation context and avoid reloading heavy GGUF weights on every turn.Graceful Lifecycle Management: Includes tools for the LLM to cleanly terminate (
/exit) and restart the background process when you ask to start a new chat session.Zero-Setup Execution: Configured with
uvandpyproject.tomlso it can be run directly from the repository without manually managing virtual environments.Fully Configurable: Supports all standard
llama.cppdiffusion parameters (steps, algorithms, temperature, batch sizing) directly through initialization arguments.
Related MCP server: FLUX MCP Server
🛠️ Prerequisites
Python 3.10+
uv (Recommended package manager)
llama-diffusion-cli: Must be compiled from the
llama.cpprepository.
🚀 Quick Start & Installation
uv run --with git+https://github.com/hkbu-kennycheng/llama-diffusion-cli-mcp.git llama-diffusion-mcp -- -m /path/to/your/model.gguf
🔌 Connecting to Claude Desktop
To use this bridge with Claude Desktop (or any other MCP Client), add the server to your configuration file.
Path:
Mac:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Example Configuration (LLaDA 8B)
{
"mcpServers": {
"llama-diffusion-chat": {
"command": "uv",
"args": [
"run",
"--with", "git+https://github.com/hkbu-kennycheng/llama-diffusion-cli-mcp.git",
"llama-diffusion-mcp",
"-m", "/absolute/path/to/llada-8b.gguf",
"-i",
"-ub", "512",
"--diffusion-steps", "256",
"--mcp-prompt-marker", "> "
],
"env": {
"LLAMA_DIFFUSION_CLI_PATH": "/absolute/path/to/llama.cpp/build/bin/llama-diffusion-cli"
}
}
}
}
Note: Restart Claude Desktop after updating the config.
⚙️ Configuration Options
The MCP server accepts standard llama-diffusion-cli arguments:
Argument | Description |
| (Required) Path to the GGUF model file. |
| Run in interactive mode (Highly recommended for this bridge). |
| Context size. |
| Maximum sequence length (ubatch size). |
| Number of diffusion steps (e.g., 256). |
| Algorithm for token selection (0-4). |
| Temperature for sampling. |
Advanced MCP Settings
Argument | Description |
| The string the CLI prints when waiting for input (Default: |
| Environment variable pointing to your CLI executable. Defaults to |
🛠️ Exposed MCP Tools
Once connected, your LLM will have access to the following tools:
chat_with_diffusion(prompt: str)Sends a message to the persistently running Diffusion LLM and returns the generated text.restart_chat_session()Gracefully exits the current chat process using the/exitcommand and spins up a fresh session. The LLM will use this if you ask it to clear context or start over.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/hkbu-kennycheng/llama-diffusion-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server