laya-mlx-mcp
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., "@laya-mlx-mcp Classify: 'The app crashed' - billing or technical?"
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.
Laya-MLX MCP
laya-mlx を MCP 経由で使う薄いサーバーです。
文章生成はしません。choice / score / noul の typed decision だけ返します。
必要環境: Apple Silicon(macOS arm64)、Python 3.11+
ツール
ツール | 内容 |
| ロード状態・既定モデル |
| チェックポイントを事前ロード |
| 状態+質問 JSON で判定 |
既定モデルは aac6fef/laya-multilingual-mlx(日本語向け)。
変更は環境変数 LAYA_MLX_MODEL / LAYA_MLX_DTYPE。
Related MCP server: laya-mcp — on-device typed decisions in ~10ms
Cursor への入れ方
推奨(Homebrew の mlx が入っていても安全): scripts/run-mcp.sh を叩く。
~/.cursor/mcp.json(またはプロジェクトの .cursor/mcp.json)に追加:
{
"mcpServers": {
"laya-mlx": {
"command": "/絶対パス/laya-mlx-mcp/scripts/run-mcp.sh"
}
}
}GitHub クローン後の最短手順:
gh repo clone Blackphi6/laya-mlx-mcp
cd laya-mlx-mcp
uv sync
chmod +x scripts/run-mcp.sh
# mcp.json の command を scripts/run-mcp.sh の絶対パスにするCursor を再起動(または MCP を再読込)すると laya_predict などが使えます。
初回の laya_load / laya_predict で Hugging Face から重みを取得します。
ローカル開発
cd laya-mlx-mcp
uv sync --extra dev
uv run pytest -q
uv run laya-mlx-mcp # stdio MCP(ホストから起動する想定)手動で判定だけ試す例(laya-mlx-mcp と同じ dylib 修正を通す):
uv run python -c '
from laya_mlx_mcp.dyld_fix import ensure_wheel_mlx_dylib
ensure_wheel_mlx_dylib()
from laya_mlx_mcp.runtime import predict
import json
print(json.dumps(predict(
"二重請求です。返金してください。",
{
"department": {
"type": "choice",
"instructions": "どの部署が対応すべきか?",
"criteria": ["billing", "technical", "sales"],
},
"refund": {
"type": "noul",
"instructions": "返金を求めているか?",
},
},
), ensure_ascii=False, indent=2))
'Homebrew の mlx が入っていると、pip の mlx wheel と libmlx.dylib が衝突することがあります。MCP のエントリポイントは自動で wheel 側を優先します。
ライセンス・帰属
この MCP ラッパー: Apache-2.0
推論本体: mizorewww/laya-mlx(Apache-2.0)
元モデル: Convai Innovations / upstream Laya
Available Tools
3 toolslaya_loadB
チェックポイントを事前ロードする。未指定時は環境変数または既定の multilingual を使う。
Args:
model: Hugging Face のモデル ID またはローカルパス。例: aac6fef/laya-multilingual-mlx
dtype: float16(既定)または float32
Inputs: dtype, model. Returns: result
laya_predictA
状態に対して typed decision を実行する。
Args:
state: 判定対象の文章。JSON オブジェクト/配列の文字列でも可。
questions_json: 質問定義の JSON オブジェクト文字列。各値は type / instructions
(choice・score は criteria)を持つ。
model: 使うチェックポイント。省略時はロード済み、なければ既定モデル。
dtype: float16 または float32。
Example questions_json:
{
"department": {
"type": "choice",
"instructions": "どの部署が対応すべきか?",
"criteria": ["billing", "technical", "sales"]
},
"urgency": {
"type": "score",
"instructions": "緊急度は?",
"criteria": ["not urgent", "soon", "critical"]
},
"refund": {
"type": "noul",
"instructions": "返金を求めているか?"
}
}
Inputs: state (required), questions_json (required), dtype, model. Returns: result
laya_statusA
ロード済みモデルと実行環境の状態を返す。
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: status reports environment state, load prepares a checkpoint, and predict runs inference. There is no functional overlap between any pair.
All tools follow a uniform laya_ prefix with a concise verb suffix (status, load, predict), using consistent snake_case throughout. The pattern is predictable and easy to extend.
Three tools form a tight, well-scoped set for model serving: check status, load a model, and run predictions. No tool feels extraneous, and the count is sufficient for the domain.
The core lifecycle of loading and using a model is covered, including a status check for runtime awareness. A minor gap is the lack of an explicit unload or model listing operation, but these are not essential for the stated purpose.
Maintenance
Related MCP Connectors
Bot-free macOS Zoom/Meet/Teams call transcripts, Apple Vision screen OCR, and live SQLite MCP.
MCP server for AI dialogue using various LLM models via AceDataCloud
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Chat, image, video, and audio models from many vendors behind one remote MCP server and one key.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceProvides an MCP interface to the Laya decision model, enabling typed queries (yes/no, multiple choice, score) with preflight token-budget reporting, honest confidence calibration, and structured error handling.31 PyPI5Apache 2.0
- AlicenseNot gradedqualityCmaintenanceLaya-MLX as an MCP server (and plain-HTTP API). It answers typed decisions — choose an option / score a rubric / is this true? — on your own machine (Apple Silicon / MLX), with no cloud and ~10ms after warm-up. Not a chatbot. No token-by-token text, no JSON that can break. One forward pass returns a structured answer you can branch on. Ideal for routing, triage, classification, lead scoring, and gMIT
- AlicenseAqualityBmaintenanceEnables local Laya-MLX typed decisions (classification, scoring, risk routing, and yes/no) for coding agents like Codex, Claude Code, DeepSeek Harness, and Pi via MCP, running entirely on Apple Silicon Macs.24MIT
- AlicenseNot gradedqualityCmaintenanceEnables local, read-only Laya typed decisions for Codex, providing classification, scoring, truth-probability, batch decision, and token-budget planning tools on Apple Silicon.MIT