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-mcpClassify: '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
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
| Name | Required | Description | Default |
|---|---|---|---|
| dtype | No | ||
| model | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It only says 'preload' without revealing whether the model is downloaded (network dependency), whether it becomes active for laya_predict, whether it replaces an existing loaded model, or what the response contains. A mutation-like operation with zero annotation coverage should disclose more.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact with no wasted sentences: the purpose is front-loaded in the first line, followed by a tight arg list. It earns its space without padding.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 2-optional-param load tool with an output schema present, the description covers purpose and all parameter semantics. However, with zero annotations it omits behavioral context (network, activation, replace semantics), leaving the completeness short of strong.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate – and it does. Both parameters are documented with type meaning (Hugging Face ID or local path), an example value, and dtype defaults (float16/float32). This adds real value beyond the bare schema names.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb+resource ('チェックポイントを事前ロードする' – preload checkpoint) and notes the default selection behavior (env var or multilingual when unspecified). Sibling differentiation (preload vs. status vs. predict) is only implicit from the names, not stated explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage context is implied rather than stated – a preload step naturally precedes laya_predict, but the description never says 'use before prediction' nor contrasts with laya_status/laya_predict. No when-not or alternative guidance is provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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": "返金を求めているか?"
}
}
| Name | Required | Description | Default |
|---|---|---|---|
| dtype | No | ||
| model | No | ||
| state | Yes | ||
| questions_json | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the behavioral burden. It explains model fallback behavior ('省略時はロード済み、なければ既定モデル') and that state can be a JSON object/array string, which adds operational context. It does not disclose potential side effects, error behavior, or return format, but the inference-oriented purpose is reasonably transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured: a one-sentence purpose, an Args block, and a concrete example. The example is somewhat long and includes the unexplained 'noul' type, but overall every section adds useful information without being redundant.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
All four parameters are documented, including optional defaults and input flexibility, and the output schema handles return-value documentation. The main gaps are the unelaborated 'noul' type and lack of explicit error-handling or prerequisite information, but the description is sufficient for constructing a valid call.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must fully compensate. It explains state, questions_json structure (type/instructions/criteria), model default behavior, and dtype allowed values. The example JSON makes the parameter format concrete and is especially valuable for the agent.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a clear verb+resource statement: '状態に対して typed decision を実行する' (execute typed decision on a state). The state and questions_json arguments make it evident that this is a text-judging/classification tool. It does not explicitly differentiate from laya_status or laya_load, but the operation is conceptually distinct from status/load.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The intended use is implied: the tool evaluates a state against a question definition, and the parameters show how to construct the call. However, it does not explicitly say when to use this tool instead of laya_status or laya_load, nor does it provide exclusions or alternative conditions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
laya_statusA
ロード済みモデルと実行環境の状態を返す。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It conveys a read-only status operation via '返す' (returns), but discloses nothing beyond that – no mention of side-effect-free behavior, cost, or what the response contains. For a simple zero-param status tool this is adequate but minimal.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded Japanese sentence with zero waste. Every word earns its place and the core purpose is stated immediately. Appropriate size for a tool with no parameters.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter tool with an output schema present, the description is nearly complete – it explains what state is returned and the output schema covers the return format. A small gap is the absence of usage context relative to the load/predict lifecycle, but nothing essential to invoking it correctly is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has 0 parameters, so per the rubric the baseline is 4. There is nothing the description needs to add about parameter meaning, and schema coverage is trivially 100% for an empty schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb (返す/returns) and resource (ロード済みモデルと実行環境の状態/state of loaded models and execution environment). The purpose is clear and implicitly distinct from siblings laya_load (loading) and laya_predict (prediction), though it does not explicitly name or differentiate them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage context is implied by the name and description – checking environment/model status – but no explicit guidance is given about when to call this versus laya_load or laya_predict. No exclusions, prerequisites, or alternative routing are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
laya_load - First observed
laya_predict - First observed
laya_status
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
MCP server for AI dialogue using various LLM models via AceDataCloud
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
- QuallaaOAuthcom.quallaa
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server that enables local Apple on-device Foundation Model access via any MCP client, supporting text generation, structured output, and multi-turn chat on macOS.2MIT
- AlicenseNot gradedqualityAmaintenanceProvides 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.Apache 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
- AlicenseNot gradedqualityCmaintenanceEnables MiMo Desktop to run a typed-decision engine through local stdio MCP, returning choice/score/noul predictions with calibrated confidence for auto-execution, LLM review, or escalation—without generating text.1MIT