npgamedev/godot-mcp-toolkit/mcp-extension-creator
Claude Code and agent skill by npgamedev/godot-mcp-toolkit
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
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-creatorSemi-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.
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:
The skeleton — the four moving parts are the class header, the options builder, registry.add, and the handler:
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.csfor 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):
| Verb | Default (omitted) | Set it when | Consequence if wrong | |
|---|---|---|---|---|
mark_read_only() | tool treated as mutating | the tool only reads state, never writes | Omitted 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-destructive | the tool deletes or irreversibly changes data | Surfaces 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 exclusive | a 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 cancel | Changes 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:
| Verb | Default | Note | |
|---|---|---|---|
mark_idempotent() | not idempotent | pure client hint (idempotentHint); set if repeating with the same input has the same effect. | |
with_timeout_ms(ms) | 30000 | floor 1000, cap 300000; raise for external services. | |
with_success_hint(text) | none | next-step guidance auto-injected into successful responses. | |
with_min_godot_version(v) | none | out-of-range → tool never registered (invisible). Also raises the doc-comment BBCode floor to v (see below). | |
with_max_godot_version(v) | none | newer 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)— declarativeres:///
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:
For a path the declarative guard doesn't fit (e.g. a legitimate absolute path), guard imperatively with FileGuard.resolve_safe:
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:
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:
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:
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 afterextends, 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
- SKILL.md in the repositoryCheckingaddons/godot_mcp_toolkit/CompanionSkills/mcp-extension-creator/SKILL.md
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
[](https://verified-skill.com/skills/npgamedev/godot-mcp-toolkit/mcp-extension-creator)