# clef-mcp

Runs the Clef-Flash 9B model locally to score agent choices. Returns strict JSON probability distributions offline without burning cloud tokens.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 7
- Author: HighlyLoadedEgo
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/HighlyLoadedEgo/ClefMCP
- Updated: 2026-10-04
- HTML: https://affpapa.org/en/nevibecode/mcp/clef-mcp

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add clef-mcp -- npx -y clef-mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add clef-mcp -- npx -y clef-mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "clef-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "clef-mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "clef-mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "clef-mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add clef-mcp npx -y clef-mcp
```

## When to use it
- 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
- Use `clef_decide` to score whether to inspect the files or ask the user.
- Run the `incident-triage` prompt on the current deployment logs.
- Evaluate next actions and calculate probability scores for each option.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119231
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47577
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43902

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
