odin-print-farm-mcp

odin-print-farm-mcp

Enables AI agents to operate a 3D print farm via O.D.I.N. backend, including job queuing, printer control, inventory management, and standalone cost calculators.

Category
访问服务器

README

odin-print-farm-mcp

Model Context Protocol server for O.D.I.N. — drive an actual print farm with AI agents, or run the bundled reference calculators standalone.

v2 (2026-04-15) splits the surface in two:

  • Live tools (22) — agent-driven farm operation. Require a running O.D.I.N. instance + a scoped token. Queue jobs, pause printers, manage inventory, clear alerts, log maintenance, read the dashboard.
  • Reference tools (4) — standalone calculators. No ODIN deployment required. Print-cost math, printer recommendations, farm capacity planning, software comparison.

Both surfaces ship in the same npm package; the live tools error at invocation if ODIN_BASE_URL / ODIN_API_KEY aren't set, so the reference tools keep working for pre-sales and research use cases.


Quick Start

Standalone (reference tools only)

npx -y odin-print-farm-mcp@2

Wire into Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "odin-reference": {
      "command": "npx",
      "args": ["-y", "odin-print-farm-mcp@2"]
    }
  }
}

Agents can now use reference.calculate_print_cost, reference.recommend_printer_for_farm, reference.estimate_farm_capacity, reference.compare_farm_software.

Live (connected to O.D.I.N.)

  1. Mint an API token in O.D.I.N. (Settings → API Tokens → New Token) with scope agent:read or agent:write.
  2. Export the env vars and wire the client:
{
  "mcpServers": {
    "odin": {
      "command": "npx",
      "args": ["-y", "odin-print-farm-mcp@2"],
      "env": {
        "ODIN_BASE_URL": "http://192.168.1.100:8000",
        "ODIN_API_KEY": "odin_xxxxxxxxxxxxxxxxxxxx"
      }
    }
  }
}

All 26 tools are now available.


Tools

Live reads (scope agent:read or higher)

Tool Purpose
farm_summary One-shot dashboard: printer counts by state, queue depth, unread alerts, active jobs. Call this first to orient.
list_printers Fleet list, optional status filter.
get_printer Full status + telemetry + AMS + active job for one printer.
list_jobs Filter by status (pending / printing / completed / failed / cancelled).
get_job Full job record.
list_queue Pending jobs in priority order.
list_alerts Filter by severity + read state.
list_spools Filter by filament type / availability.
list_filaments Filament library.
list_maintenance_tasks Optional overdue-only filter.
list_orders Customer orders by status.

Live writes (scope agent:write or admin)

Every write tool accepts optional dry_run and idempotency_key.

Tool Purpose
queue_job Add a job from a model library ID. Accepts model_id, optional item_name, quantity, priority, and notes; the ODIN scheduler assigns the printer.
cancel_job Cancel a job. Requires reason on some endpoints.
approve_job Approve a submitted job.
reject_job Reject a job (reason required).
pause_printer Pause the active print.
resume_printer Resume a paused printer.
mark_alert_read / dismiss_alert Alert housekeeping.
assign_spool Bind spool → printer AMS slot.
consume_spool Log grams used.
complete_maintenance Log task completion. Requires printer_id, task_id, and task_name.

Reference (no backend)

Tool Purpose
reference.calculate_print_cost Material + electricity + depreciation + failure-rate math.
reference.recommend_printer_for_farm Match printers to farm constraints.
reference.estimate_farm_capacity Throughput forecasting.
reference.compare_farm_software Feature matrix vs OctoFarm / Mainsail / Duet / etc.

Agent Primitives

The live surface inherits four retry-safety primitives from the O.D.I.N. v1.8.9 backend:

Idempotency-Key. Every write tool auto-generates a UUID key per call; pass a stable idempotency_key across retries to deduplicate. On replay, the response comes back with _idempotent_replay: true.

X-Dry-Run. Pass dry_run: true to any write tool. The backend returns {dry_run: true, would_execute: {...}} without committing. Per-route opt-in — individual routes land preview branches in subsequent releases.

Structured errors. Failures return an error: {code, detail, retriable} envelope. Stable codes agents can branch on:

Code Meaning
printer_not_found / job_not_found / spool_not_found / alert_not_found Resource missing.
scope_denied Token scope insufficient. Mint a broader token.
permission_denied Role-based denial (role, not scope).
quota_exceeded Usage quota hit. extra.used_grams / extra.limit_grams.
idempotency_conflict Same key + different body. Use a fresh key.
idempotency_in_progress Concurrent retry in flight. Retry shortly.
idempotency_authz_changed Role/scope changed since the original call. Mint a fresh key.
idempotency_uncacheable_success Original succeeded but couldn't be cached. Mint a fresh key.
idempotency_unsupported Multipart or oversized body — use app-level dedup.
itar_outbound_blocked ODIN_ITAR_MODE=1 refused a public destination.
rate_limited retriable: true.
validation_failed Input schema error.

next_actions hints. Write responses include next_actions: [{tool, args?, reason?}] suggesting follow-up calls. Pure hint — no enforcement. Designed for 7B–32B local models.


ITAR / CMMC Deployment

O.D.I.N. ships ODIN_ITAR_MODE=1 for fail-closed air-gap deployments. Typical stack:

   Ollama (Qwen2.5-32B or similar)
      │
      ▼
   MCP client (Claude Desktop / OpenClaw / etc.)
      │ stdio
      ▼
   odin-print-farm-mcp@2  ── ODIN_BASE_URL=http://localhost:8000
      │ HTTP
      ▼
   O.D.I.N. backend  ── ODIN_ITAR_MODE=1
      │ LAN
      ▼
   Printers (LAN-only)

Zero outbound packets. All tokens, prompts, and telemetry stay inside the compliance boundary. See the ITAR / CMMC mode docs.


Migration from v1

v2.0.1 renames the four v1 tools into a reference.* namespace:

v1 v2
calculate_print_cost reference.calculate_print_cost
recommend_printer_for_farm reference.recommend_printer_for_farm
estimate_farm_capacity reference.estimate_farm_capacity
compare_farm_software reference.compare_farm_software

The behavior of each tool is unchanged — only the identifier. Pin odin-print-farm-mcp@1 if you need the un-namespaced IDs. Upgrade to @2 to access the 22 live tools plus the namespaced reference calculators.


Skill packages

The skills/ directory ships operator-ready prompt packs for Claude Code, OpenClaw, Cline, and other MCP clients. odin-farm/SKILL.md is the baseline "safe farm operator" rulebook — dry-run-first, branch on error codes, never batch cancellations. Drop it into ~/.claude/skills/ (Claude Code) or your client's skills directory, and a local 32B model will stop trying to cancel jobs without confirmation.

See skills/README.md for install + customization.


Development

git clone https://github.com/HughKantsime/odin-mcp
cd odin-mcp
npm install
npm run build
npm test  # 22 integration tests against an in-process mock ODIN

Tests use a node-native http mock server (test/mock_server.ts) — no external fixtures, no ODIN instance required, runs in ~1s.


Links

License

Apache 2.0.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选