mcp-laya
A safe-by-default, read-only local inference server that gives an agent fast, typed System-1 decisions (classify, score, yes/no) over any text or JSON state — offline, in ~33 ms, with calibrated confidence and no text generation.
decide— answer multiple typed questions (choice / score / noul) about a state in a single forward pass, returning calibrated confidences, probabilities and routing metadata.classify— assign the single best category fromlabelsor a richercriteriamap, with probability over all labels.score— rate a state on an ordered scale (e.g. urgency) with expected score and per-level probabilities.check— yes/no/unknown gate for agent control flow ("is this a refund request?", "is this a security incident?").triage— run ready-made decision sets via presets:triage,email,moderation,guard.detect_language— sub-millisecond script/language detection with no model pass.explain_routing— show which checkpoint would answer, without running inference.list_models— inspect available checkpoints, default model, device and offline status.
Runs entirely locally (offline by default, downloads opt-in), with a model allowlist, input caps, redacted logging and read-only tool annotations.
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., "@mcp-laya classify this support request as billing, technical, or sales"
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.
mcp-laya
A safe-by-default Model Context Protocol server for Laya — a fast, non-autoregressive System-1 decision engine. It gives an agent a thinking primitive: typed decisions — classify, score, yes/no — over any state (text, an email, a ticket, a JSON object), in a single local forward pass (~33 ms), across 100+ languages, with no text generation — nothing to parse and nothing to hallucinate, and a calibrated confidence on every answer.
Instead of burning a slow, costly LLM round-trip on "which team should handle this? is it urgent? is this a refund request?", the agent calls a typed tool that answers locally, in milliseconds, offline. It's the safest server in the suite — laya only reads a state and returns a decision; it changes nothing.
Part of the dockndevai MCP server suite — one governance model across all of them. (This is the first Python server in the suite; the rest are Node/TS.)
What it gives an agent
Tool | For |
| answer several typed questions (choice/score/noul) in one pass — the full engine |
| assign the single best category (one |
| rate on an ordinal scale, e.g. urgency (one |
| a yes/no/unknown gate for control flow (one |
| a ready-made decision set via a laya preset (triage / email / moderation / guard) |
| script + language of a text (sub-ms, no model) |
| which checkpoint would answer, without running inference |
| the checkpoints available, default, device, offline status |
Three checkpoints, auto-routed per request: english (ModernBERT-large), multilingual (mmBERT, 100+ languages), typed-decisions.
Related MCP server: jev-code
Install
pipx install mcp-laya # or: pip install mcp-layaPython 3.10+. laya pulls in torch; the model checkpoints download once from Hugging Face (see below), after which it runs fully offline.
First run: fetch the model once
Downloads are off by default (nothing leaves your machine at runtime). Pre-fetch the checkpoints one time with network access:
LAYA_ALLOW_DOWNLOAD=true python -c "import laya; laya.Router(preload=True)"Then run the server offline.
Configure
{
"mcpServers": {
"laya": {
"command": "mcp-laya",
"env": { "LAYA_DEFAULT_MODEL": "auto" }
}
}
}See docs/CLIENTS.md for Claude Code / Cursor / Codex / VS Code / Windsurf, and .env.example for every variable.
Example
Ask your agent to "use laya to classify this ticket's department and whether it's a churn risk":
// classify(state, criteria={billing, technical, sales, other})
{ "choice": "billing", "confidence": 0.95, "probabilities": { "billing": 0.95, ... } }
// check(state, "Does the user threaten to cancel?")
{ "answer": "yes", "probability_yes": 0.91, "confidence": 0.91 }Safe by default
laya is read-only inference, so the guardrails (in src/mcp_laya/security.py) are about privacy and resource control, not write-gating:
Offline by default — the model runs locally; nothing is sent anywhere. The one exception, the first-time checkpoint download, is disabled unless
LAYA_ALLOW_DOWNLOAD=true.Model allowlist —
LAYA_MODELSpins which checkpoints may load.Input caps —
LAYA_MAX_INPUT_CHARSbounds the state and, separately, the serialized questions;LAYA_MAX_QUESTIONSbounds their number.Confidence honesty —
LAYA_MIN_CONFIDENCEflags (never silently trusts) low-confidence answers; every answer already carries a calibratedconfidence.Log privacy —
LAYA_REDACT_STATEkeeps the input text out of the JSON audit log by default. Refused requests are audited too (outcome: "rejected").Read-only annotations — every tool is advertised with
readOnlyHint: true.
There's a bundled skill, laya-decisions, teaching an agent when to offload a decision to laya and how to phrase typed questions. See also SECURITY.md.
Developing
python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"
ruff check src tests && mypy src && pytest # the policy tests need no model
python -m mcp_laya # run the server (stdio)Credits
Built on laya by Convai Innovations (Apache-2.0). This server wraps that library; all model work is theirs. See NOTICE.
Licence
MIT
Available Tools
8 toolscheckA
Answer a single yes/no/unknown question about a state (a noul gate).
Returns answer (yes | no), the probability of yes (0..1), and calibrated confidence. Ideal for
agent control flow: "does the user request a refund?", "is this a security incident?".
Inputs: state (required), instructions (required), model. Returns: object
classifyB
Assign the single best category to a state (one choice question).
Provide either labels (a list of category names) or criteria (a map of category -> short
description; more accurate). Returns the chosen label, calibrated confidence, and the probability
over all labels.
Inputs: state (required), model, labels, criteria, +1 more. Returns: object
decideA
Answer several typed questions about a state in one local forward pass.
Use this to offload System-1 judgment calls from the main model: classification, routing, scoring and yes/no gates over text, an email, a ticket or a JSON object — fast, local, and without hallucination. Each question is one of three types:
choice: {"type":"choice","instructions":"...","criteria":{"labelA":"desc","labelB":"desc"}}
score: {"type":"score","instructions":"...","criteria":["level0","level1","level2"]}
noul: {"type":"noul","instructions":"..."} (yes/no/unknown)
Returns every answer with its calibrated confidence and full probabilities, plus routing
metadata explaining which checkpoint answered. model optionally pins english | multilingual |
typed-decisions (default: the Router auto-selects per language/task).
Inputs: state (required), questions (required), model. Returns: object
detect_languageB
Detect the script and language of a text (sub-millisecond, no model forward pass).
Inputs: text (required). Returns: object
explain_routingA
Explain which checkpoint the Router would use for this state, without running inference.
Inputs: state (required), questions (required). Returns: object
list_modelsA
List the laya checkpoints this server may use, the default, device and offline status.
Inputs: no named parameters. Returns: object
scoreB
Rate a state on an ordinal scale (one score question).
levels are the ordered rungs, lowest first, e.g. ["not urgent","soon","critical"]. Returns an
expected score (0..len-1), the level legend, calibrated confidence, and per-level probabilities.
Inputs: state (required), levels (required), instructions (required), model. Returns: object
triageA
Run a ready-made set of decisions over a state using a laya preset.
presets: triage (department/urgency/sentiment…), email, moderation (safety categories), guard (prompt-injection / policy gates). Returns all answers with confidence.
Inputs: state (required), model, preset. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
classify, score, and check are single-question wrappers around decide's choice/score/noul modes, so an agent choosing between decide and a specialized tool may face ambiguity for a one-off task. Their descriptions clearly separate the single-vs-multiple use cases, but the underlying semantics overlap.
All tool names are lowercase and start with an imperative verb, with compound names following verb_noun (detect_language, explain_routing, list_models). The single-word verbs (decide, classify, score, check, triage) are a minor stylistic deviation from the compound pattern but remain predictable.
Eight tools is a reasonable size for a decision-model server and stays inside the ideal 3-15 range. The count is slightly padded, though, because classify/score/check are specialized versions of decide's three question types.
The set covers general and specialized decisions, ready-made triage presets, language detection, routing explanation, and model listing—no obvious dead ends for inference workflows. Minor gaps include no queryable preset list or way to register custom presets, but these can be worked around.
Maintenance
Related MCP Connectors
Typed AI decisions for agents: classify, route, screen evidence, score and batch-label text.
Deterministic prompt-injection detector; signed, offline-verifiable verdicts. Not an LLM.
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.
Related MCP Servers
- AlicenseAqualityCmaintenanceProvides agents with fast, typed, calibrated decision tools for classification, scoring, yes/no checks, and gating risky tool calls.53MIT
- AlicenseNot gradedqualityBmaintenanceProvides coding agents with typed classification, yes/no checks, scoring, ranking, and question-answering tools that return calibrated probabilities for fast, reliable decisions.706 npm62MIT
- AlicenseAqualityBmaintenanceEnables MCP clients to run fast, local, non-autoregressive System-1 decisions on text, including classification, triage, routing, and safety gating, via six typed tools with probabilistic outputs.8Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to run local, model-backed decisions on short passages and routing choices, and to check whether exactly supplied text supports a scientific claim, returning the full probability distribution, review-policy status, and provenance details. All evaluation stays on the local machine with no cloud inference, and flagged results are surfaced for human review rather than treated as conclusions.MIT