Skip to main content
Glama

laya-mcp

An MCP server that exposes Laya — a 33ms non-autoregressive decision model — as tools for coding agents such as Claude Code.

Laya answers typed questions (choice / score / noul) about a piece of text in a single forward pass, with calibrated confidence. This server wraps Laya's built-in workflow presets so an agent can call into it mid-task instead of shelling out to a Python script.

Tools

Tool

Purpose

classify_request(request)

Difficulty, domain (code, math_or_logic, writing, ...), tool need, sensitivity — useful for routing a task to a lighter or heavier model.

guard_check(text)

Screen text (fetched web content, file, tool output) for jailbreak attempts, prompt injection, embedded secrets/PII, and harm severity before acting on it.

moderate_content(text)

Toxicity, harassment, threats, spam, rule-violation severity.

triage_ticket(message)

Support-ticket triage: intent, urgency, frustration, refund request, churn risk.

evaluate(state, questions)

Run an arbitrary typed-question schema against any state — the generic escape hatch. See Laya's decision primitives.

Related MCP server: jev-code

Setup

git clone https://github.com/<you>/laya-mcp.git
cd laya-mcp
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt

First call downloads the Laya checkpoint from Hugging Face (~300–400MB) and caches it under ~/.cache/huggingface.

Wire into Claude Code

claude mcp add laya -s user -- $(pwd)/.venv/bin/python $(pwd)/server.py

-s user registers it for every Claude Code session on this machine. Use -s project to scope it to the current project instead.

Wire into other MCP clients

Any stdio-based MCP client works the same way — point it at <venv>/bin/python <path>/server.py. For example, in ~/.codex/config.toml:

[mcp_servers.laya]
command = "/path/to/laya-mcp/.venv/bin/python"
args = ["/path/to/laya-mcp/server.py"]

Configuration

  • LAYA_PRELOAD=1 — preload all Laya checkpoints into memory at server startup instead of loading lazily on first request (trades startup latency for consistent per-call latency).

Notes

  • Laya's laya checkpoint emits a RuntimeWarning about temperature calibration for choice questions with 11+ options — an upstream calibration quirk in the checkpoint, not this wrapper. None of the built-in presets hit that bucket count.

  • This project only wraps Laya's Python SDK; it does not modify or vendor Laya itself.

License

MIT — see LICENSE. Laya itself is licensed separately (Apache 2.0); see NandhaKishorM/laya.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables coding agents to send natural language and JSON application state to a judge tool that returns typed judgments (yes/no probability, choice, or score) with model and usage metadata, and fails gracefully without blocking workflows.
    1,250 npm
    2
    Apache 2.0
  • A
    license
    A
    quality
    C
    maintenance
    Enables agents to call typed code-review and content-moderation decision tools, returning structured verdicts, probabilities, and confidence-gated actions.
    2
    MIT