madewithlaya

Catalog / Tools & apps

0069GitHub

laya-mcp: a local MCP server exposing laya-mlx to any MCP client

Will Sargent's stdio MCP server on fastmcp. Classify text, score against a rubric or answer yes/no from Claude Code or any MCP client without sending input off the machine.

Open source ↗ github.comcostfree, localtime-
wsargent/laya-mcpREADME ↗
# laya-mcp

`laya-mcp` runs the [Laya](https://github.com/mizorewww/laya-mlx) decision model locally and exposes it as an [MCP](https://modelcontextprotocol.io/) server. Use it to classify text, score text against a rubric, or answer yes/no questions without sending inference input to a remote service.

Laya is a decision model, not a chat model. It returns probabilities for structured questions such as “Is this urgent?” or “Which category fits this message?”. Inference uses the Apple Silicon GPU through MLX.

## Requirements

- macOS on Apple Silicon
- Python 3.12 or newer
- [`uv`](https://docs.astral.sh/uv/)

## Install

```sh
git clone https://github.com/wsargent/laya-mcp.git
cd laya-mcp
uv sync
```

The model checkpoint downloads from Hugging Face on the first inference request and is cached locally. The server starts without loading the model; the first request may take longer than later requests.

## Use as an MCP server

Start the stdio server from the project directory:

```sh
uv run laya-mcp
```

Register the server in an MCP client with the command below. Use the absolute path to the Python executable in this project's `.venv`:

```json
{
  "command": "/absolute/path/to/laya-mcp/.venv/bin/python",
  "args": ["-m", "laya_mcp.server"]
}
```

See [client setup](docs/client-setup.md) for Claude Desktop, Polytoken, and the shared daemon.

## Tools

The server provides five tools:

| Tool | Purpose |
| --- | --- |
| `laya_decide` | Answer caller-defined `choice`, `score`, and yes/no (`noul`) questions about a string, object, or list. |
| `laya_triage` | Classify a support message by intent, urgency, frustration, refund request, and churn risk. |
| `laya_guard` | Check a prompt for jailbreak, prompt-injection, sensitive-data, harm, and topic signals. |
| `laya_modera

Also filed under Tools & apps

  1. 0005

    laya-mlx plays Snake at 60 decisions per second

    介绍比Jev快50倍,在你设备上跑的laya-mlx! 只在你的设备上占用最高1G内存 Laya是一个开源的类似于Jev的,基于文本输出概率的分类系统 我将其移植到MLX,并且做了一些性能优化! 视频中就是这个模型在我的本地M3Max上玩贪吃蛇 这个模型能够以每秒决策60次的速度玩贪吃蛇! https://t.co/31KGUiNunb

    @mizorewww · Tools & apps · free, local · 60 decisions/s

  2. 0112

    Laya on Axera AX650 and AX8850 edge NPUs, under 70 ms

    AXERA-TECH's conversion of all three Laya checkpoints for its edge AI chips, reported at latency under 70 ms per decision on AX650/AX8850.

    AXERA-TECH · Tools & apps · free, on-device · < 70 ms on AX650 / AX8850

  3. 0099

    laya-mcp (PerryLink): a warm sidecar that fixes Laya's silent truncation and constant noul

    MCP server plus HTTP sidecar: token-budget preflight that reports what would be cut, a persisted calibration store, structured errors, and a noul fix (P(true) 0.5 → 1.0).

    @PerryLink · Tools & apps · free, local

  4. 0097

    Gomoku against Laya-MLX: you play black, the model picks white's move from six candidates

    Local 15x15 Gomoku on Apple Silicon. Rules in Python, board in the browser, every AI move one real Laya choice over up to six candidates, probabilities shown. No Gomoku training.

    smile-magic · Tools & apps · free, local