Clef MCP logo

Clef MCP

Runs Cloudflare’s Clef-Flash model locally to return structured, probability-based decisions over MCP.

Install Clef MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "clef-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "clef-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Install not yet sandbox-tested— the server itself is confirmed live (we called its tools/list endpoint). The stdio install command is a separate, ongoing check.

Overview

clef-mcp MCP server runs Cloudflare’s Clef-Flash decision model locally and exposes structured judgments through the `clef_decide` MCP tool. Inputs contain factual state plus typed choice, score, or yes/no questions, and outputs provide strict JSON distributions instead of generated prose. It also classifies JSONL or CSV records with reusable YAML profiles through its CLI, including threshold-based review results. Reach for it when an agent or batch workflow needs offline classification, explicit uncertainty, and deterministic single-pass scoring.

Use cases

  • Classify support tickets into routing labels
  • Evaluate production or operational situations locally
  • Route uncertain records for human review
  • Batch-process JSONL and CSV datasets
  • Add structured decisions to coding-agent workflows

Key features

  • Local offline Clef-Flash inference
  • MCP decisions with probability distributions
  • Choice, score, and yes/no question types
  • JSONL and CSV classification with YAML profiles
  • Threshold-based needs-review results
  • Batching of up to 64 MCP questions

Tools1

What Clef MCP lets your agent do. Expand a tool for its parameters.

Verified live~681 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

6/6 checks healthy over the last 20d

What it can do

From the 1 tool this server returned when we ran it; 1 declare their own safety hints.

Read-only tools · 1
Network at startup3 connections
Files written at startupNone
Install scriptsNone
npm provenanceSigned build
Package age15 days
Maintainers1

Observed 2026-10-19 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 3d ago via OSV.dev · clef-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars8Stargazers on the source repository.
npm downloads1.1kPackage downloads in the last 30 days.
Last commit1d agoMost recent push to the default branch.
Tools exposed1Callable tools this server registers over MCP.
Directory activity5 viewsConfig copies, upvotes, and views on AllMCPs.

How Clef MCP works

What clef-mcp does

clef-mcp runs the Clef-Flash 9B model from Cloudflare on the local machine. Its MCP interface is centered on clef_decide, which evaluates a compact factual state against one or more typed questions. The supported question forms are:

  • choice for selecting among named options and descriptions
  • score for selecting a level from an ordered scale
  • noul for yes/no judgments

Each question returns a probability distribution over its permitted answers. Responses can also include model-reported confidence and usage measurements such as input tokens, output tokens, and latency. The result contains no generated explanation or sampled prose.

The package also provides a command-line classification workflow. A YAML profile defines the classification instruction, mutually exclusive labels, selected input fields, optional examples, and review thresholds. JSONL and CSV records can be classified in batches, with results written as JSONL. Classification can retain suggestions while marking uncertain rows as needs_review.

How it works

The MCP process communicates over stdio and loads the selected local model for inference. The model download and runtime setup happen through the installation command; later inference runs work offline. Multiple related MCP questions can be sent together, up to 64 in one call and one forward pass. The optional model setting can override the default model selection. options.temperature has no effect because scoring does not sample.

For dataset jobs, the model loads once for the batch rather than requiring a separate daemon. A row is accepted only when its winning probability, probability margin, and optional confidence satisfy the profile policy. Ties and missing confidence can require review. Invalid JSONL records become error rows while runtime failures stop the run.

Setup and configuration

Node.js 20 or newer is required, with enough memory for the selected checkpoint; 16 GB is recommended for the Q4_K_M model. Install the package globally and download its model and runtime files with:

Terminal
npm install -g clef-mcp
clef-mcp install

Start the MCP process with clef-mcp, then run clef-mcp setup to register it with a supported client before restarting that client. npx -y clef-mcp is an alternative to a global installation, and npx -y clef-mcp install --setup combines installation with client registration.

A profile may select a model explicitly. Otherwise, model selection follows CLI override, profile configuration, CLEF_MODEL, and then the default clef-flash identifier. Profiles require a schema version, name, instructions, and two to 100 labels. Input fields and record IDs are optional.

Tools and capabilities

  • Evaluate structured choices, ordered scores, and yes/no questions through clef_decide.
  • Return probability distributions, confidence when available, and inference usage data.
  • Process JSONL or CSV files using YAML classification profiles.
  • Apply minimum probability, margin, and confidence policies to route uncertain records for review.
  • Resume committed file-output batches after interruption when the input, profile, model, runtime, and format still match.
  • Run inference locally without sending records to a remote service.

Limitations and notes

Probability thresholds are routing rules, not calibrated accuracy guarantees; they should be checked against representative labeled data before automation. An agent should only act on an argmax when the distribution is decisive, such as a top probability of at least 0.8, and destructive or security-related actions should also require high confidence and appropriate review.

The model download is approximately 6 GB. Profiles, logical records, selected fields, and examples have size limits, and the model has a 16,000-token context limit. Resume mode requires regular file input and an output path; stdin and stdout cannot be resumed. Classification evaluates records but does not authorize or execute actions.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Clef MCP

clef-mcp is an MCP server that connects AI agents to Cloudflare’s locally running Clef-Flash decision model. Its main tool, `clef_decide`, evaluates choice, ordered-score, and yes/no questions and returns strict JSON probability distributions, confidence when available, and inference usage metrics without generating prose.

Install it with `npm install -g clef-mcp`, then run `clef-mcp install` to obtain the model and runtime files. Node.js 20 or newer is required. You can use `npx -y clef-mcp` instead of a global installation.

Run `clef-mcp setup`, register the server with the client, and restart the client. The server communicates over stdio. `npx -y clef-mcp install --setup` combines model installation and client registration.

Yes. Use `clef-mcp classify` with a YAML profile that defines the instruction, labels, input fields, and review thresholds. The command accepts JSONL or CSV, can read stdin, and writes classification results with suggestions, probabilities, and review reasons.

Yes. Clef-Flash runs on the local machine, and inference runs offline after the model and runtime files have been installed. The default model download is approximately 6 GB.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewClef MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/clef-mcp?style=directory)](https://allmcps.com/mcp/clef-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/clef-mcp"><img src="https://allmcps.com/api/badge/clef-mcp?style=directory" alt="Clef MCP on AllMCPs" /></a>