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.
# 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