llama-diffusion-mcp
Click on "Deploy 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-mcp.git llama-diffusion-mcp -hf unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M -ngl 99 -n 128000
🔌 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-mcp.git",
"llama-diffusion-mcp",
"-hf", "unsloth/diffusiongemma-26B-A4B-it-GGUF:Q4_K_M",
"-ngl", "99",
"-n", "128000"
],
"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.
Available Tools
1 toolgenerate_diffusion_textA
Generates text using a diffusion-based LLM. This is a one-shot process.
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | The exact prompt or instruction to send to the model. |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description mentions it's a one-shot process using a diffusion-based LLM, adding context beyond the name, but does not disclose other behavioral traits like speed or limitations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is very concise with two sentences, no unnecessary words, and front-loads the key information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the single parameter, no siblings, and presence of output schema, the description adequately covers the purpose and basic behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description does not add meaning beyond the input schema, which already describes the prompt parameter well. With 100% schema coverage, baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool generates text using a diffusion-based LLM, which is specific and unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool vs alternatives, but the description implies it's for one-shot text generation with a diffusion model.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v0.1.0- First observed
generate_diffusion_text
TDQS
Scored across 1 tool
With only one tool, there is no ambiguity. An agent can clearly identify the sole purpose of generating diffusion text.
Although only one tool exists, its name 'generate_diffusion_text' follows a clear verb_noun pattern, which is consistent and predictable.
A single tool is appropriate for a very narrow scope like one-shot text generation, but it borders on being too thin for a more general-purpose diffusion server.
The tool covers the entire stated purpose of generating diffusion-based text. There are no obvious missing operations given the 'one-shot' description.
Maintenance
Related MCP Connectors
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
- QuallaaOAuthcom.quallaa
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Real-time chat hub for AI agents — Claude Code, Cursor, Cline, Codex over MCP or REST.
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
Related MCP Servers
- AlicenseCqualityDmaintenanceBridges Claude Desktop with local LLM instances running via llama-server, enabling full conversation support with complete parameter control and health monitoring. Allows users to chat with their local models directly through Claude Desktop with configurable sampling parameters.310 npm9Creative Commons Zero v1.0 Universal
- AlicenseAqualityAmaintenanceEnables high-quality image generation using FLUX.1-dev through Claude Desktop or CLI, with automatic model unloading to save VRAM and memory-efficient bfloat16 processing.5MIT
- FlicenseNot gradedqualityDmaintenanceBridges Claude Desktop to local and remote ComfyUI instances, enabling health checks, model listing, workflow queuing, status polling, and output retrieval.-
- AlicenseAqualityDmaintenanceEnables hot-swapping llama.cpp models in a running Claude Code session via launchctl or systemd, preserving conversation context across model changes.45Apache 2.0