clef-mcp
Exposes Ollama's /v1/systemone decision endpoint through a decide tool, enabling probability-calibrated judgements over text, JSON data, or images. Supports multiple-choice labels, yes/no probability estimates, and ordered score grading, with batching of up to 64 questions per call against Ollama Cloud or a local Ollama server.
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., "@clef-mcp how likely is this customer to want a refund? "I was charged twice""
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.
clef-mcp
MCP server (stdio) that exposes Ollama's POST /v1/systemone decision endpoint as a single tool, decide. Use it when you need a fast, probability-calibrated judgement about a piece of text, JSON data, or images: pick one label (choice), estimate how likely a yes/no statement is true (noul), or grade on an ordered scale (score). Batch every question about the same state into one call. The model is fixed by the server configuration and cannot be chosen per call.
Configuration
Variable | Default | Description |
|
| Ollama server base URL. |
| none | Bearer token. Required when the host is |
|
| Model name sent with every request. |
|
| Request timeout in milliseconds (positive integer). |
Model names:
clefon Ollama Cloud (https://ollama.com).clef:cloudthrough a local Ollama server that proxies to the cloud. This requires Ollama v0.40.5 or later and a local server signed in to ollama.com (ollama signin).cleffor a locally pulled model.
The API key is never logged or included in error messages or tool output.
Related MCP server: jev-mcp
Claude Code setup
claude mcp add clef -e CLEF_API_KEY=your-key -e CLEF_MODEL=clef -- npx -y @kooda-ai/clef-mcpOr in .mcp.json:
{
"mcpServers": {
"clef": {
"command": "npx",
"args": ["-y", "@kooda-ai/clef-mcp"],
"env": {
"CLEF_BASE_URL": "https://ollama.com",
"CLEF_API_KEY": "your-key",
"CLEF_MODEL": "clef"
}
}
}
}Local Ollama variant (no key):
{
"mcpServers": {
"clef": {
"command": "npx",
"args": ["-y", "@kooda-ai/clef-mcp"],
"env": {
"CLEF_BASE_URL": "http://localhost:11434",
"CLEF_MODEL": "clef:cloud"
}
}
}
}The decide tool
Inputs:
state: non-empty text, or a JSON object or array (sent as JSON text).questions: map of question name to question, 1 to 64 entries. Names match^[A-Za-z0-9_.-]{1,100}$.images(optional): up to 4 raw base64 strings (nodata:URLs).
Question types:
choice:criteriais required, an object of 2-26 label keys mapped to a description ornull.noul:criteriais optional, exactly{"false": "...", "true": "..."}.score:criteriais required, an array of 2-10 level descriptions ordered lowest to highest.
Example call:
{
"state": "Customer: I was charged twice and the checkout page crashes.",
"questions": {
"refund": { "type": "noul", "instructions": "Does the customer ask for a refund?" },
"urgency": {
"type": "score",
"instructions": "How urgent is it?",
"criteria": [
"Routine: no time pressure",
"Soon: a customer is inconvenienced",
"Immediate: a critical service is unavailable"
]
}
}
}Answer semantics:
choice:choice(winning key),probabilitiesper key (sum to 1),confidence(0-1).noul:noulis the probability from 0 to 1 that the statement is true. It is not a boolean and has no confidence field.score:scoreis the probability-weighted mean of the zero-based level index (for example 1.84 on a 0-2 scale, not rounded), pluslegend,probabilitiesper index, andconfidence.
The result also carries usage with input_tokens and output_tokens.
Development
Build from source:
npm install && npm run buildRun the tests:
npm run build && npm test
npm run test:e2e
CLEF_INTEGRATION_BASE_URL=http://localhost:11434 npm run test:integrationnpm test runs the unit and e2e suites; the integration suite is skipped unless CLEF_INTEGRATION_BASE_URL is set (set CLEF_API_KEY and CLEF_MODEL as needed).
Available Tools
1 tooldecideDecideARead-only
Ask an Ollama decision model to answer one or more structured questions about a state, in a single call. Answers are probabilities, never free text, so you can threshold them.
Inputs:
state: what to judge. Non-empty text, or a JSON object or array (sent as JSON text).
questions: map of question name to question. 1 to 64 questions. Names are 1-100 characters of ASCII letters, digits, "_", "." or "-".
images (optional): up to 4 images as raw base64 strings (no data: URLs, no http URLs).
Every question has a type, instructions (text, or a JSON object or array, explaining what to decide) and criteria:
choice: pick exactly one label. criteria is required: an object mapping 2-26 label keys to a description string or null. Answer: choice (the winning key), probabilities (one per key, summing to 1) and confidence (0-1).
noul: a yes/no judgement. criteria is optional: exactly {"false": "...", "true": "..."} describing each side. Answer: noul, the probability from 0 to 1 that the statement is true. It is not a boolean and has no confidence field.
score: place the state on an ordered scale. criteria is required: an array of 2-10 level descriptions ordered from lowest to highest. Answer: score, the probability-weighted mean of the zero-based level index (for example 1.84 on a 0-2 scale; not rounded), legend (index to description), probabilities (per index) and confidence (0-1).
Use it for classification, routing, triage, moderation and rubric grading. Do not use it to generate text.
Inputs: state (required), questions (required), images. Returns: model, usage, answers
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
There is only one tool, so there is nothing to confuse it with. Within the tool, the three question types (choice, noul, score) are clearly delineated with distinct criteria and answer shapes, so an agent can select the right mode without ambiguity.
A single, clear verb name ('decide') that accurately reflects the operation. There are no competing conventions to clash, and the naming reads naturally for the domain.
The server exposes exactly one tool, which is thin by the usual 3-15 guidance, though it is a genuinely single-capability wrapper around a decision model and the batch 'questions' parameter absorbs what would otherwise be many tools. It is borderline rather than mismatched, since no second capability obviously belongs here.
The tool covers the core decision surface well: batch questions, three answer modes, optional images, and probability outputs for thresholding. Minor gaps remain, such as model discovery/selection, health or capability introspection, and any guidance on limits or failure modes, which an agent would have to work around.
Maintenance
Related MCP Connectors
Calibrated judgments for text: yes/no probabilities, picks from your options, or scores.
Deterministic contextual decision arbitration and action routing for autonomous software. Takes current state, context, or intent plus caller-supplied candidate actions, state transitions, routes, refusals, escalations, tools, or models and returns a deterministic ordered candidate field. Also provides persistent machine representations for memory, retrieval, indexing, and downstream coherence measurement.
Typed-question decisions from Jev: classify, moderate, route models and guard tool calls.
Calibrated decisions for agents: choice, yes/no and score questions answered with probabilities.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables AI coding agents to make fast, zero-output-token decisions by evaluating context, diffs, logs, or options through the OpenRouter Decisions API using TypeSafe Jev, returning calibrated probabilities for binary, categorical, or scoring questions.123 npm3MIT
- AlicenseAqualityCmaintenanceProvides agents with fast, typed, calibrated decision tools for classification, scoring, yes/no checks, and gating risky tool calls.5223 npm3MIT
- AlicenseNot gradedqualityBmaintenanceProvides coding agents with typed classification, yes/no checks, scoring, ranking, and question-answering tools that return calibrated probabilities for fast, reliable decisions.686 npm58MIT
- AlicenseAqualityBmaintenanceEnables coding agents to request calibrated probability judgments over typed questions—yes/no, named choices, or ordered scores—about a described situation, returning one probability per option rather than free text. Runs Cloudflare's Clef model locally on Apple Silicon Macs, with images or video frames optionally attached, and answers delivered as a single MCP tool call.183 PyPIMIT