clef-mcp — Claude Code MCP server: what it does, how to install
Runs the Clef-Flash 9B model locally to score agent choices. Returns strict JSON probability distributions offline without burning cloud tokens.
claude mcp add clef-mcp -- npx -y clef-mcpWhat clef-mcp does
The server exposes Cloudflare's Clef-Flash 9B decision model via a single clef_decide tool. Agents supply task context and typed questions without requesting lengthy paragraphs. The engine outputs probabilities across candidate answers in one forward pass. Latency stays low.
Work happens on-device inside llama.cpp without external network calls. You can score up to 64 questions in a single request across discrete choices, scales, or binary checks. The state payload is read purely as data. Skipping the initial model download of roughly 6 GB leads straight to a MODEL_NOT_INSTALLED error.
What it helps with
- Select the next agent action when diagnosing test failures
- Score confidence levels before executing risky code edits
- Route incoming issue tickets into team categories by urgency
- Classify incident severity directly on the local machine
Example prompts for the agent
- Use
clef_decideto score whether to inspect the files or ask the user. - Run the
incident-triageprompt on the current deployment logs. - Evaluate next actions and calculate probability scores for each option.
How to install clef-mcp
Platform CLI
claude mcp add clef-mcp -- npx -y clef-mcpPlatform CLI
codex mcp add clef-mcp -- npx -y clef-mcpConfig file
{
"mcpServers": {
"clef-mcp": {
"command": "npx",
"args": [
"-y",
"clef-mcp"
]
}
}
}Config file
{
"servers": {
"clef-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"clef-mcp"
]
}
}
}Platform CLI
gemini mcp add clef-mcp npx -y clef-mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about clef-mcp
How do I install clef-mcp in Claude Code?
Run claude mcp add clef-mcp -- npx -y clef-mcp in your terminal. Ensure you run npx clef-mcp install beforehand to download runtime binaries and model weights.
What does the clef_decide tool return?
It outputs a structured JSON object containing probability distributions for each asked question. The model evaluates options in a single pass without prose.
Does clef-mcp require internet access during execution?
Inference runs completely offline on your hardware using llama.cpp. A network connection is needed only during initial setup to download the 6 GB model file.