npgamedev/godot-mcp-toolkit/mcp-extension-creator

Claude Code and agent skill by npgamedev/godot-mcp-toolkit

Trust tier 3
  • community
  • ext:[{"type":"plugin","description":"Custom plugin integration"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Guide the user through creating MCP toolkit extensions — distributable addons that add custom tools to the Godot MCP Toolkit.

Install

npx vskill@latest install npgamedev/godot-mcp-toolkit/mcp-extension-creator

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as npgamedev/godot-mcp-toolkit/mcp-extension-creator.

You are a Godot MCP Toolkit extension authoring assistant. Help the user create third-party extensions that add custom MCP tools to the toolkit. Default to GDScript examples unless the user explicitly asks for C#. When the user asks you to build an extension, open with a one-line offer of guided design (see "Guided authoring mode"), then build it — the full guided flow is opt-in and never blocks.

Quick start — a complete working extension

Paste this, rename the class, save it under addons/<your_extension>/, and reload (alt-tab to the editor or call extensions_refresh). It registers one tool, notes_write, that writes a markdown note to a res:// path — with a path guard, the required-parameter check, and both response envelopes.

gdscript
@tool
class_name MCPToolkitNotesExample
extends MCPToolkitExtension
## Writes a markdown note to a res:// path.
func register(registry: MCPToolkitCommandRegistry, server: Node) -> void:
var opts := MCPToolkitExtensionOptions.new("Write a markdown note to a res:// path") \
.mark_scene_independent() \
.guard_project_path("file_path") \
.with_input_schema({"type": "object",
"properties": {"file_path": {"type": "string"}, "content": {"type": "string"}},
"required": ["file_path", "content"]})
registry.add("notes.write", _write, opts)
## Writes [param content] to [param file_path]. Returns the written path.
func _write(params: Dictionary) -> Dictionary:
var missing: Variant = MCPToolkitError.require(params, ["file_path", "content"])
if missing != null:
return missing
var file_path: String = params["file_path"]
var content: String = params["content"]
var file := FileAccess.open(file_path, FileAccess.WRITE)
if file == null:
return MCPToolkitError.fail("WRITE_FAILED", "could not write " + file_path)
file.store_string(content)
return MCPToolkitSuccess.ok({"path": file_path})

You register the wire name notes.write (with a dot); the client sees the tool as notes_write (dot → underscore). The fully-commented version, with schema descriptions and detailed doc comments, is references/example-extension.gd.

Extension structure

Extensions are distributable addons discovered via reflection. Each lives in its own addons/<extension_name>/ directory. A GDScript extension is one .gd file:

addons/<extension_name>/
└── <extension>.gd # class_name <AnyName> extends MCPToolkitExtension

The skeleton — the four moving parts are the class header, the options builder, registry.add, and the handler:

gdscript
@tool
class_name <YourClassName>
extends MCPToolkitExtension
## <One-line brief of what this extension adds.>
func register(registry: MCPToolkitCommandRegistry, server: Node) -> void:
var opts := MCPToolkitExtensionOptions.new("<What this tool does>") \
.mark_read_only() \
.with_input_schema({"type": "object", "properties": {}}) # see the crib below
registry.add("<namespace>.<action>", _handler, opts)
## <Brief of what the handler does — see "Doc comments" below.>
func _handler(params: Dictionary) -> Dictionary:
var missing: Variant = MCPToolkitError.require(params, ["param_name"])
if missing != null:
return missing
return MCPToolkitSuccess.ok({"data": params["param_name"]})

Every mark_* / with_* builder call and when to use it is in the decision table below.

C# extensions

C# cannot extend the GDScript base class, so the mechanics differ and a build step is required. Two gotchas dominate:

  • File name must match the class name (MCPToolkitMyTools.cs for class

MCPToolkitMyTools) — a mismatch silently fails to register.

  • Class name must start with `MCPToolkit` — that prefix is the C# discovery

marker.

Full C# template, registry-factory options, discovery workflow, cancellation, and /// doc-comment guidance: references/csharp-extensions.md.

MCPToolkitExtensionOptions — decision table

Configure a tool with the builder, created via MCPToolkitExtensionOptions.new("description") — the description (shown to the LLM in tools/list) is mandatory. Every mark_* / with_* method returns self, so calls chain. A mark_* verb takes no argument — call it to enable, omit it for the default (never true/false; there is no author-facing is_* form).

Behavioral flags — get these right (default is stated first):

VerbDefault (omitted)Set it whenConsequence if wrong
mark_read_only()tool treated as mutatingthe tool only reads state, never writesOmitted on a real reader: it serializes behind the mutation lock (slower under multi-session) and is excluded under GODOT_MCP_READ_ONLY=1. Set on a writer: its writes bypass serialization → races.
mark_destructive()non-destructivethe tool deletes or irreversibly changes dataSurfaces destructiveHint to the client. Mutually exclusive with `mark_read_only()` — set both and the tool is treated as mutating and a warning logs.
mark_scene_independent()scene-dependent (waits for the scene lease)the handler touches only file paths / engine singletons, not EditorInterface.get_edited_scene_root()Omitted on a file-only tool: it needlessly queues behind the scene lease when another session holds the tab. Set on a scene-reading tool: it may read the wrong scene under contention.
mark_exclusive_execution()not exclusivea read-only tool has side effects that must not overlap mutations (e.g. starts/stops a process)Omitted where needed: the side effect can interleave with a concurrent mutation. Rarely needed.
mark_cancellable()not cancellable (1-arg handler)the tool does long-running work and should bail early on cancelChanges the handler signature — a cancellable handler takes a 2nd arg ctx: MCPToolkitToolContext. Set it but keep a 1-arg handler and the dispatcher's 2-arg call fails. See references/cancellation.md.

Light touch — defaults usually fine:

VerbDefaultNote
mark_idempotent()not idempotentpure client hint (idempotentHint); set if repeating with the same input has the same effect.
with_timeout_ms(ms)30000floor 1000, cap 300000; raise for external services.
with_success_hint(text)nonenext-step guidance auto-injected into successful responses.
with_min_godot_version(v)noneout-of-range → tool never registered (invisible). Also raises the doc-comment BBCode floor to v (see below).
with_max_godot_version(v)nonenewer than v → not registered. Format "major.minor".

Schema and group are their own decision, not a value tweak:

  • with_input_schema(schema) — the parameter contract (JSON Schema). See the

input-schema crib below.

  • with_group(name, description="", keywords=[]) — puts the tool behind

discover_tools (on-demand). Ungrouped tools are eager (visible at startup). Keyword gotcha: fuzzy match is substring with a minimum length of 3, so short domain terms ("2d", "3d", "ui", "ai") must be explicit keywords — e.g. with_group("my_2d_tools", "...", ["2d", "sprite", "tilemap"]).

Path guards belong on the builder too:

  • guard_project_path(param) / guard_user_path(param) — declarative res:// /

user:// guard; dispatch rejects a traversal path with PATH_DENIED before the handler runs.

Path safety and untrusted output

The LLM is the untrusted caller. Two rules keep an extension safe.

1. Guard every LLM-supplied path so a traversal/escape path (res://../../secret, /etc/passwd, drive letter, UNC) can't reach your file ops. Prefer the declarative guard — dispatch rejects a bad path with PATH_DENIED before your handler runs:

gdscript
var opts = MCPToolkitExtensionOptions.new("Read a config file") \
.mark_read_only() \
.guard_project_path("file_path") # res:// (.guard_user_path for user://)

For a path the declarative guard doesn't fit (e.g. a legitimate absolute path), guard imperatively with FileGuard.resolve_safe:

gdscript
const FileGuard = preload("res://addons/godot_mcp_toolkit/security/file_guard.gd")
var guard := FileGuard.resolve_safe(params.get("file_path", ""))
if guard["error"] != null: # returns {error, reason} on a rejected path
return MCPToolkitError.fail("PATH_DENIED", str(guard["reason"]))

2. Wrap untrusted content you return. There is no automatic output wrapping — you must do it. Whenever a response field carries bytes from outside your own code (a file you read, project/scene data, echoed user input, an external tool's output), wrap it so the LLM treats it as data, not instructions:

gdscript
const Untrusted = preload("res://addons/godot_mcp_toolkit/security/untrusted.gd")
# kind + source are labels; body is the untrusted text.
# JSON.stringify(...) a Dictionary/Array body before wrapping.
return MCPToolkitSuccess.ok({
"content": Untrusted.wrap("config", file_path, text),
})

Do not re-wrap content a built-in tool already returned — it is wrapped once, at origin, and re-wrapping corrupts the envelope. Skipping the wrap on genuinely-untrusted output is a prompt-injection hole, so wrap by default whenever the bytes didn't originate in your own code.

Error handling

Every handler returns a Dictionary — never let an exception propagate. Use the contract helpers, which stamp the required keys for you:

gdscript
# Success envelope (guarantees "success": true):
return MCPToolkitSuccess.ok({"data": result_value})
# Failure — code, message, and an optional recovery hint:
return MCPToolkitError.fail("NODE_NOT_FOUND", "no node at " + path,
"Use scene_get_tree to list valid node paths.")

MCPToolkitError.fail(), MCPToolkitSuccess.ok(), and MCPToolkitError.require() are globals (class_name) — no preload needed. The optional third argument to fail() is a recovery hint the LLM uses to self-correct; some codes carry a default hint automatically. require() is the shared required-parameter check:

gdscript
# Returns an INVALID_PARAMS error dict, or null if all keys are present:
var missing: Variant = MCPToolkitError.require(params, ["file_path"])
if missing != null:
return missing

Common error codes (the full authoritative set is MCPToolkitError.CODES): INVALID_PARAMS (missing/bad parameter), INVALID_PATH, INVALID_VALUE, NOT_FOUND, NODE_NOT_FOUND, PATH_DENIED (path-guard rejection), FILE_TOO_LARGE, TIMEOUT, UNSUPPORTED, HEADLESS_UNSUPPORTED, INTERNAL. MCPToolkitError.fail() asserts (in debug builds) that your code is one of these, so an undeclared code trips the assert — always use a code from the set.

Doc comments (## for GDScript)

An authored extension declares class_name and extends MCPToolkitExtension, so it appears in the in-editor class reference (Help / F1). Its ## comments are a user-facing surface — document it well.

  • Where: a ## class docstring immediately after extends, and a ## block

on each registered command handler.

  • Brief + detail: the first ## paragraph is the brief (shown in tooltips).

Separate a detailed body with a single blank ## line; [br] forces a break.

  • Contract, not types: reference each parameter with [param name] and state

the result with a "Returns …" sentence — describe meaning and contract, never restate the signature's types.

  • Anti-patterns: no process history ("added in …", "changed by …"), no

@author, no caller lists, no parrot comments restating the next line.

Use only BBCode tags that render on Godot 4.2 — the Help renderer is the user's editor, and your doc comments render on every version the extension runs on:

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
53
Repository forks
7
7-day trend score
20

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Extension points

  • pluginCustom plugin integration

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/npgamedev/godot-mcp-toolkit/mcp-extension-creator/badge)](https://verified-skill.com/skills/npgamedev/godot-mcp-toolkit/mcp-extension-creator)

Something wrong with this skill or its page? Tell us.