Skip to main content
Glama

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

CLEF_BASE_URL

https://ollama.com

Ollama server base URL.

CLEF_API_KEY

none

Bearer token. Required when the host is ollama.com or *.ollama.com; optional otherwise.

CLEF_MODEL

clef

Model name sent with every request.

CLEF_TIMEOUT_MS

60000

Request timeout in milliseconds (positive integer).

Model names:

  • clef on Ollama Cloud (https://ollama.com).

  • clef:cloud through 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).

  • clef for 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-mcp

Or 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 (no data: URLs).

Question types:

  • choice: criteria is required, an object of 2-26 label keys mapped to a description or null.

  • noul: criteria is optional, exactly {"false": "...", "true": "..."}.

  • score: criteria is 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), probabilities per key (sum to 1), confidence (0-1).

  • noul: noul is the probability from 0 to 1 that the statement is true. It is not a boolean and has no confidence field.

  • score: score is the probability-weighted mean of the zero-based level index (for example 1.84 on a 0-2 scale, not rounded), plus legend, probabilities per index, and confidence.

The result also carries usage with input_tokens and output_tokens.

Development

Build from source:

npm install && npm run build

Run the tests:

npm run build && npm test
npm run test:e2e
CLEF_INTEGRATION_BASE_URL=http://localhost:11434 npm run test:integration

npm 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 tool
decideDecideA
Read-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

    A4.4/5.0

    Scored across 1 tool

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count3/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      1
      23 npm
      3
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      1
      83 PyPI
      MIT