Skip to main content
Glama
orca-profiles-mcp

orca-profiles-mcp

by Zmokizmoghi

orca-profiles-mcp

一个读取和编辑 OrcaSlicer 配置文件的 MCP 服务器。它会展开完整的 inherits 链,并显示每个值是由哪一层设置的。

功能简介

OrcaSlicer 配置文件只存储与其父配置的差异。仅打开文件不足以得知外墙速度:该值可能来自父配置、父配置的父配置,或引擎的内置默认值。此服务器会沿继承链追溯到根,计算有效值并保留其来源。

它处理 Orca 中会让朴素的读取器出错的部分:

  • 父配置按名称、跨厂商解析 — Sovol 耗材从 OrcaFilamentLibrary 继承;

  • 缺失的 Generic … 父配置会回退到 Generic <material> @System,重命名的配置文件通过其 renamed_from 列表找到;

  • 绑定到挤出机变体的向量逐元素合并,包括 nil 标记,该标记表示“此处保留父配置的值”;

  • 子配置可以声明比其父配置更多的挤出机 — 在单挤出机机器配置文件之上添加工具更换器 — 并且两个挤出机都保留其值;

  • 不属于该配置文件类型的键会被丢弃,因为 Orca 也会丢弃它们;这些键会被报告,而不会被静默应用。

Related MCP server: local-code-mcp

设置

cd ~/job/orca-profiles-mcp
uv sync

使用 Claude Code 注册:

claude mcp add orca-profiles -- uv --directory ~/job/orca-profiles-mcp run orca-profiles-mcp

工具

工具

用途

get_setup

已发现的根、Orca 版本、厂商、选定的预设

list_profiles

按类型、名称、厂商、来源搜索

get_profile

以 raw / resolved / traced 模式获取配置文件

get_chain

指向根的继承链

explain_key

特定值的来源

find_children

哪些配置文件继承自该配置

diff_profiles

比较两个配置文件

compare_with_upstream

与 OrcaSlicer 仓库进行比较

validate

损坏的 inherits、循环、未知键、冗余增量

check_deltas

针对 Orca 自身写入的增量验证展开

分别报告冗余键和无法解释的向量长度

set_values

设置值并重新计算增量

create_profile

创建用户配置文件

rename_profile, delete_profile

重命名和删除

normalize_profile

删除与父配置相同的键

值完全按照文件存储的方式返回:"0.20" 保持为 "0.20","100%" 保持为百分比。引擎在切片时会规范化这两者;此服务器不会,因此您读取到的就是配置文件所记录的内容,写回的内容也不会改变。

写入配置文件

您自己的配置文件可以自由编辑。修改系统或内置配置文件需要 force=true:这些文件属于厂商库,下一次配置文件更新会恢复它们,并且所有后代配置都会继承该更改。

写入操作通过临时文件和原子重命名进行,因此中断的写入不会截断配置文件,并且会先在文件旁边生成备份副本(backup=false 可禁用)。在写入任何内容之前都会检查值——属于其他配置文件类型的键、引擎需要标量却提供向量的值、格式要求字符串却提供数字的值都会被拒绝,而不是被存储后由 Orca 静默丢弃。您的固定快照无法识别的设置会原样保留,因此由较新版本 Orca 写入的配置文件不会丢失这些设置。

OrcaSlicer 在启动时读取配置文件,并在退出时重写它们。 在应用程序运行期间进行的编辑将被覆盖——请先关闭 Orca。

如何检查正确性

Orca 的 CLI 无法验证继承关系。--export-settings 返回引擎默认值加上提供给它的文件中存在的键,并且从不遍历 inherits;通过 OrcaSlicer.conf 选择预设不会激活这些预设;将整个链作为文件列表传入会被当作重复配置文件而拒绝。这三种方式都在 2.4.2 上尝试过。

Orca 确实留下的东西是其自身展开的证据:当它保存用户配置文件时,它会存储相对于完全展开的父配置的最小增量。因此,Orca 写出的每个配置文件都是一个记录的答案。check_deltas 重新计算这些增量并比较——不匹配意味着解析器展开父配置的方式与引擎不同。

这正是 tests/test_smoke.py 针对已安装库所断言的内容,也正是这样发现了工具更换器向量缺陷。

刷新引擎快照

引擎默认值、变体键集和按类型划分的键列表会从已安装的 Orca 捕获到 src/orca_profiles_mcp/data/engine-snapshot.json,并固定到其版本标签。升级 OrcaSlicer 后:

uv run python scripts/build_snapshot.py
uv run pytest

测试

uv run pytest

四层:

  • 针对微型夹具库的单元测试,每个边界情况一个测试 — 跨厂商继承、Generic 回退、renamed_from、循环、缺失的父配置、步长为 1 和步长为 2 的向量、nil 元素;

  • 写入往返测试:读取 → 原样写入 → 文件与原始字节完全相同;

  • 端到端测试,将打包的入口点作为子进程启动,并通过 MCP stdio 驱动它,涵盖工具注册、完整的创建/编辑/验证/删除循环以及错误传播;

  • 针对已安装库的检查,包括上述增量验证。

使用真实库的测试在不存在 Orca 数据目录时会自行跳过;其他所有测试都针对夹具运行。

文档

  • 设计:docs/specs/2026-08-17-orca-profiles-mcp-design.md — 包括阅读 OrcaSlicer 源码后确定的配置文件格式信息,以及 CLI 实验排除的内容

  • 实施计划:docs/plans/2026-08-17-orca-profiles-mcp.md

许可证

AGPL-3.0,与 OrcaSlicer 本身一致。本项目不包含 OrcaSlicer 代码,但它的继承逻辑是对 Preset.cpp 和 PrintConfig.cpp 的逐行移植,而且引擎快照保存了从该源代码中提取的默认值和键列表。

与 OrcaSlicer 项目无关联,也未获得其认可。

Available Tools

15 tools
check_deltasB

Verify inheritance expansion against the deltas Orca itself wrote: for every profile, the delta is recomputed and compared with the file. A mismatch means the resolver expands the parent differently than the engine did; redundant keys are reported separately and are harmless

Inputs: scope.

compare_with_upstreamC

Compare a profile against its version in the OrcaSlicer repository

Inputs: name (required), type (required), ref.

create_profileC

Create a user profile inheriting from the given one

Inputs: name (required), type (required), values (required), inherits (required).

delete_profileB

Delete a profile; deleting outside your own profiles needs force=True, and cloud-synced ones keep a flagged .info

Inputs: name (required), type (required), force.

diff_profilesB

Compare two profiles by effective values (mode=resolved) or by their stored deltas (mode=raw)

Inputs: a (required), b (required), type (required), mode.

explain_keyB

Where a key's value came from: originating link, overridden values, engine default

Inputs: key (required), name (required), type (required).

find_childrenC

Profiles inheriting from this one. Check before editing shared profiles

Inputs: name (required), type (required).

get_chainC

The inheritance chain to its root, with how each link was resolved

Inputs: name (required), type (required).

get_profileC

A profile with inheritance expanded. mode: raw — file contents, resolved — effective values, traced — values with provenance. Engine defaults are excluded unless include_defaults is set

Inputs: name (required), type (required), keys, mode, +3 more.

get_setupB

Discovered Orca profile roots, application version, vendors, selected presets

Inputs: no named parameters.

list_profilesC

Search profiles by type, name, vendor and source

Inputs: type, limit, query, source, +3 more.

normalize_profileC

Drop keys whose values are identical to the parent's

Inputs: name (required), type (required), force, backup.

rename_profileC

Rename a user profile

Inputs: name (required), type (required), new_name (required).

set_valuesA

Set profile values. The delta against the parent is recomputed automatically and the paired .info is updated. Editing a system or bundled profile affects every descendant and needs force=True

Inputs: name (required), type (required), values (required), force, +1 more.

validateC

Integrity check: broken inherits, cycles, unknown keys, redundant deltas, name collisions

Inputs: scope.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 15 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes: get_profile expands inheritance, get_chain shows the chain, explain_key traces a single key's origin. However, validate and check_deltas both verify integrity and could be confused; diff_profiles and compare_with_upstream both compare but to different targets. Descriptions are detailed enough to resolve ambiguity.

    Naming Consistency5/5

    All tool names follow a consistent snake_case imperative verb-noun pattern (get_setup, list_profiles, set_values, create_profile). Even compound names like compare_with_upstream and check_deltas fit the pattern. No mixed conventions or vague verbs.

    Tool Count5/5

    15 tools is well-scoped for a profile management server, covering discovery, inspection, mutation, validation, and comparison. Each tool addresses a distinct need without unnecessary duplication.

    Completeness5/5

    The tool surface provides full lifecycle coverage: create, read (multiple views), update, delete, rename, plus validation, diffing, and impact analysis (find_children). Missing operations like import/export are not core to the domain, and the set appears complete for effective profile management.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for pre-print QA of Bambu Studio projects, providing tools to inspect models and 3MF files, validate risky settings, create support variants, and open files in Bambu Studio.
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      MCP server for BambuStudio slicer: inspect geometry, configure saved projects, and compare slices with Claude Code or Codex.
      30
      2
      AGPL 3.0