Skip to main content

godot-visual-mcp

Secure, offline-first asset tools for Godot exposed through a Model Context Protocol (MCP) server.

Python Godot Protocol License

Empower your LLM agents (Cline, Roo Code, Copilot) to inspect, generate, and transform visual assets directly within your Godot Engine project. Engineered with strict filesystem sandboxing, this server securely translates agent reasoning into your game's res:// pipeline.

🚀 Quickstart

Requires Python 3.11+. The core profile runs entirely offline and has no heavy AI or GPU dependencies.

The project uses uv.lock for reproducible environments. Configurable safety limits include MCP_MAX_INPUT_BYTES, MCP_MAX_PIXELS, MCP_MAX_FRAMES, MCP_MAX_BATCH, MCP_MAX_OPERATION_SECONDS, and MCP_MAX_PROJECT_BYTES.

# Install core tools and development dependencies
uv sync

# Run the server (requires Godot project path)
GODOT_PROJECT_ROOT=/path/to/my-godot-project uv run python -m server.main

Client Configuration (stdio)

Configure your MCP client to launch the server via stdio. Every asset path provided by the agent is automatically interpreted as relative to the res:// directory and resolved against your configured GODOT_PROJECT_ROOT.

{
  "mcpServers": {
    "godot-visual-mcp": {
      "command": "uv",
      "args": ["run", "--no-dev", "python", "-m", "server.main"],
      "env": {
        "GODOT_PROJECT_ROOT": "/path/to/my-godot-project"
      }
    }
  }
}

🧰 Available Tools

All tool responses use a standard envelope format (status / data / warnings / errors) ensuring LLM agents never receive raw, unhandled stack traces.

Core Tools (v0.2):

  • Inspection: inspect_asset, list_assets, validate_asset
  • Prototyping: create_placeholder, generate_spritesheet (assembled offline from equal-sized frames)
  • Palette Engine: apply_palette, list_palettes (ships with Game Boy, PICO-8, and custom JSON palettes. Supports RGB/LAB distance matching while preserving alpha channels).

Generative AI Tools (v0.3):

  • Generation & Cleaning: generate_asset, remove_background

🧠 ComfyUI Integration (Optional)

The core installation intentionally omits heavy AI dependencies. To enable generative workflows and background removal, install the [ai] profile:

uv sync --extra ai

Configure your local ComfyUI instance via environment variables or pass the endpoint directly to the generate_asset tool: COMFYUI_ENDPOINT=http://127.0.0.1:8188

How generation works:

  1. The tool submits a local JSON workflow (located in workflows/).
  2. Prompts, dimensions, seeds, and batch sizes are injected dynamically (credentials are never stored).
  3. The MCP polls without fixed completion assumptions.
  4. The output is retrieved, background is removed (if requested), transparent borders are cropped, and the final asset is written safely to res://.
  5. Note: CPU-only machines can use ComfyUI's CPU backend; this project does not strictly require CUDA.

🛡️ Security Model

Security and directory integrity are core design principles:

  • Strict Sandboxing: All operations are strictly bound to the configured GODOT_PROJECT_ROOT.
  • Path Validation: Absolute paths, parent directory traversal (../), and symlink escapes are aggressively rejected.
  • Non-Destructive by Default: Existing files are never overwritten unless a tool explicitly receives the overwrite=true parameter from the agent.

🐳 Docker Deployment

The project includes an optional Dockerfile and compose.yaml to provide an isolated core container and an opt-in ComfyUI profile. The default core container has no GPU or AI runtime requirements, keeping the footprint minimal.

📦 Releases

Releases are created by pushing a tag that matches the package version, for example:

git tag v1.5.0
git push origin v1.5.0

The release workflow builds the wheel and source distribution with uv, validates installation in Python 3.11, generates SHA-256 checksums and an SPDX SBOM, publishes the package to PyPI through trusted publishing, and publishes the container to GHCR. Configure a PyPI trusted publisher for the pypi environment before using the workflow.

🛠️ Development & Testing

Run the test suite and code quality checks using standard Python tooling:

# Run unit tests
uv run pytest

# Run linter
uv run ruff check .

Documentation: Security Model | Tool Reference | Changelog

Metadata

Release files for godot-visual-mcp 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for godot-visual-mcp 1.5.0
File Size Uploaded
godot_visual_mcp-1.5.0.tar.gz 36.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for godot-visual-mcp 1.5.0
File Interpreter ABI Platform
godot_visual_mcp-1.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 74.1 kB

Release files / godot_visual_mcp-1.5.0.tar.gz

Download URL godot_visual_mcp-1.5.0.tar.gz
Size 36.5 kB
Tags Source
SHA-256 checksum
How to use checksums
301480b348e06300447157915932df203636ed9d53901218d2db3fb5b75c42d1
BLAKE2b-256 checksum
How to use checksums
5367ee90b218a03774b55a60218d2bef948a3a3dadbd9396de067f413e2bb9dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / godot_visual_mcp-1.5.0-py3-none-any.whl

Download URL godot_visual_mcp-1.5.0-py3-none-any.whl
Size 37.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a313499806ceabf81eaaa1dc57d3a084e68c39b1064739ec6864ee675955c03
BLAKE2b-256 checksum
How to use checksums
a0714ec2c233918b4cb9bd79496db1a80cb5c68b540b0da74c127dd11a948343
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

1.6.0

2 release files

This release

1.5.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page