FreeCAD-MCP-For-YDGA: Command for Claude Code

.claude/commands/freecad-save.md

freecad-save is a command for Claude Code from Yaeshio/FreeCAD-MCP-For-YDGA. It costs 0 tokens per session (879 once invoked), scanned A, original, MIT.

A command that saves an open FreeCAD document, a computer-aided design file, as both an FCStd file and a Python script in the projects/ folder.

In plain words
What is it for?
Use it to choose an open FreeCAD document and save its files to projects/. It can list open documents when no document name is supplied.
Why use it?
It keeps the design in FreeCAD's native file format while also preserving a script version that can help reproduce or inspect it.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is Yaeshio/FreeCAD-MCP-For-YDGA's own configuration. It tells Claude Code how to work on FreeCAD-MCP-For-YDGA itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything FreeCAD-MCP-For-YDGA configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Yaeshio/FreeCAD-MCP-For-YDGA. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Yaeshio/FreeCAD-MCP-For-YDGA/main/.claude/commands/freecad-save.md
Clone the repo
git clone --depth 1 https://github.com/Yaeshio/FreeCAD-MCP-For-YDGA

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for freecad-save

README.md
[![agentmods](https://agentmods.dev/badge/commands/yaeshio/freecad-mcp-for-ydga/freecad-save/github.svg)](https://agentmods.dev/commands/yaeshio/freecad-mcp-for-ydga/freecad-save)
Your own site
<a href="https://agentmods.dev/commands/yaeshio/freecad-mcp-for-ydga/freecad-save"><img src="https://agentmods.dev/badge/commands/yaeshio/freecad-mcp-for-ydga/freecad-save/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for freecad-save

Your own site · 80×15
<a href="https://agentmods.dev/commands/yaeshio/freecad-mcp-for-ydga/freecad-save"><img src="https://agentmods.dev/badge/commands/yaeshio/freecad-mcp-for-ydga/freecad-save.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 879 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00879
Opus 5 $0.00000 $0.00439
Sonnet 5 $0.00000 $0.00176
Haiku 4.5 $0.00000 $0.00088

Measured 11d ago against content hash ff6368618a51, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

freecad-save scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/freecad-save.md · 88 lines

How it starts

The opening of the file, as written. The whole thing — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.

FreeCAD のドキュメントを FCStd ファイルと Python スクリプトとして projects/ に保存する。

Usage: /freecad-save [doc_name]

Steps

1. ドキュメント名を決定する

  • 引数が指定されている場合(例: /freecad-save CylinderDoc)、それをドキュメント名として使用する。
  • 引数が指定されていない場合、次の Python コードを uv 経由で実行して開いているドキュメント一覧を取得する:
    import xmlrpc.client, json
    server = xmlrpc.client.ServerProxy("http://localhost:9875", allow_none=True)
    docs = server.list_documents()
    print(json.dumps(docs))
    
    実行コマンド: cd "C:\Users\jut30\FreeCAD\FreeCAD-MCP"; uv run python -c "<上記コード>"
    • ドキュメントが1つだけならそれを使用する。
    • 複数ある場合はユーザーに選択を求める。
    • 1つもない場合はエラーを伝える。

2. FCStd ファイルを保存する

次のコードをインラインスクリプトとして一時ファイルに書き出し、uv 経由で実行する:

import xmlrpc.client, json
server = xmlrpc.client.ServerProxy("http://localhost:9875", allow_none=True)
doc_name = "{決定したドキュメント名}"
save_path = "C:/Users/jut30/FreeCAD/FreeCAD-MCP/projects/{doc_name}.FCStd"
code = f'import FreeCAD\ndoc = FreeCAD.getDocument("{doc_name}")\nif doc:\n    doc.saveAs("{save_path}")\n    print("saved")\nelse:\n    print("not found")'
result = server.execute_code(code)
print(json.dumps(result, ensure_ascii=False, indent=2))

このコードは projects/{doc_name}.FCStd に保存する。

3. ドキュメントのオブジェクト情報を取得する

次のコードで、ドキュメント内のオブジェクト一覧とプロパティを取得する:

import xmlrpc.client, json
server = xmlrpc.client.ServerProxy("http://localhost:9875", allow_none=True)
objects = server.get_objects("{決定したドキュメント名}")
print(json.dumps(objects, ensure_ascii=False, indent=2))

4. Python スクリプトを生成・保存する

取得したオブジェクト情報をもとに、FreeCAD MCP の RPC 経由でモデルを再現できる Python スクリプトを生成する。 スクリプトの形式は以下の通り:

"""
FreeCAD MCP - {doc_name} 作成スクリプト
生成日: {YYYY-MM-DD}
"""

import xmlrpc.client

server = xmlrpc.client.ServerProxy("http://localhost:9875", allow_none=True)

# ドキュメントを作成
result = server.create_document("{doc_name}")
print("ドキュメント作成:", result)

# オブジェクトを作成(取得したオブジェクト情報から生成)
obj_data = {
    "Type": "{obj_type}",
    "Name": "{obj_name}",
    "Properties": {
        # 取得したプロパティをここに展開
    },
}
result = server.create_object("{doc_name}", obj_data)
print("{obj_name} 作成:", result)

Read the full file on GitHub · 88 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 88 lines · 0 tokens per session scan A ff6368618a51

Subscribe to this mod's changes

freecad-save is a command published in the GitHub repository Yaeshio/FreeCAD-MCP-For-YDGA (0 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 879 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.