Skip to main content
Glama
MarzLars

Unity UIToolkit MCP Server

by MarzLars

Unity UIToolkit MCP Server

A Vibe Coded Model Context Protocol (MCP) server that provides LLM agents with access to Unity UIToolkit documentation, code examples, and conversion tools for migrating HTML/CSS to UXML/USS.

Features

This MCP server provides the following tools for working with Unity UIToolkit:

  • list_prerendered_docs: Lists all available pre-rendered Markdown documentation

  • read_prerendered_docs: Reads clean, LLM-friendly Markdown documentation converted from Unity's HTML docs

Note: Pre-rendered documentation is automatically fetched and converted weekly via GitHub Actions using markitdown. This provides faster access, better LLM digestibility, and eliminates runtime dependencies on external sites.

Legacy Documentation Tools

  • get_uitoolkit_documentation: Provides Unity UIToolkit documentation reference with links and examples for specific topics (UXML, USS, VisualElement, etc.)

  • get_unity_script_reference: Access Unity Script API reference documentation for UIToolkit classes and methods

  • list_uitoolkit_components: List available UIToolkit components and controls by category

Code Examples

  • get_uitoolkit_code_example: Provides common Unity UIToolkit code example patterns with links to Unity's official examples repository

  • fetch_unity_example_code: Fetches actual source code from Unity's UI Toolkit examples repository. Use this to retrieve implementation samples referenced in documentation (e.g., from <code source="..."/> tags)

Conversion Tools

  • convert_html_to_uxml: Convert HTML markup to UXML format with guidance and best practices

  • convert_css_to_uss: Convert CSS styles to USS (Unity Style Sheets) format with property mappings

Related MCP server: Unity MCP Server

Documentation Pre-rendering

Unity UIToolkit documentation is automatically fetched and converted to Markdown:

  • Schedule: Weekly on Mondays at 00:00 UTC

  • Trigger: Can be manually triggered via GitHub Actions

  • Process:

    1. Fetches latest Unity UIToolkit HTML documentation

    2. Filters to UIToolkit-related pages only

    3. Converts to clean Markdown using markitdown

    4. Commits to docs/ directory

See .github/workflows/update-unity-docs.yml for implementation details.

Installation

npm install
npm run build

Usage

This MCP server uses the stdio transport and can be integrated with any MCP-compatible client.

Configuration

Add to your MCP client configuration (e.g., Claude Desktop config):

{
  "mcpServers": {
    "uitoolkit": {
      "command": "node",
      "args": ["/path/to/UIToolkitMCP/dist/index.js"]
    }
  }
}

Or use npx:

{
  "mcpServers": {
    "uitoolkit": {
      "command": "npx",
      "args": ["uitoolkit-mcp-server"]
    }
  }
}

Available Tools

1. list_prerendered_docs

Lists all available pre-rendered documentation files.

Parameters: None

Example:

{}

2. read_prerendered_docs

Reads pre-rendered Markdown documentation.

Parameters:

  • doc_type (string): Either "manual" or "script-api"

  • doc_name (string): Name of the documentation file (e.g., "UXML", "UIElements_VisualElement")

Example:

{
  "doc_type": "manual",
  "doc_name": "UXML"
}

3. get_uitoolkit_documentation

Retrieves Unity UIToolkit documentation for specific topics.

Parameters:

  • topic (string): The UIToolkit topic to search for (e.g., "UXML", "USS", "VisualElement")

Example:

{
  "topic": "UXML"
}

4. get_uitoolkit_code_example

Provides common Unity UIToolkit code example patterns with links to Unity's official repository.

Parameters:

  • example_name (string): Name or path of the example (e.g., "simple-list-view", "custom-control")

Example:

{
  "example_name": "simple-list-view"
}

5. fetch_unity_example_code

Fetches actual source code from Unity's UI Toolkit examples repository. This is particularly useful when you encounter <code source="..."/> tags in the script-api documentation and want to see the actual implementation.

Parameters:

  • file_path (string): Path to the code file (e.g., "Button_clicked.cs" or "Modules/UIElements/Tests/UIElementsExamples/Assets/Examples/Button_clicked.cs")

Example:

{
  "file_path": "Button_clicked.cs"
}

Note: The tool will automatically search multiple Unity repositories to find the code:

  • Unity's public UI Toolkit manual code examples repository

  • Unity's C# Reference repository (for internal test examples)

6. get_unity_script_reference

Retrieves Unity Script API reference for UIToolkit classes.

Parameters:

  • class_name (string): The Unity class name (e.g., "VisualElement", "ListView", "Button")

Example:

{
  "class_name": "ListView"
}

7. convert_html_to_uxml

Provides guidance for converting HTML to UXML.

Parameters:

  • html_snippet (string): HTML code to convert

Example:

{
  "html_snippet": "<div class='container'><button>Click Me</button></div>"
}

8. convert_css_to_uss

Provides guidance for converting CSS to USS.

Parameters:

  • css_snippet (string): CSS code to convert

Example:

{
  "css_snippet": ".button { background-color: blue; padding: 10px; }"
}

9. list_uitoolkit_components

Lists available UIToolkit components.

Parameters:

  • category (string, optional): Filter by category ("containers", "controls", "data-bound", "advanced")

Example:

{
  "category": "controls"
}

Resources

Development

Build

npm run build

Watch Mode

npm run watch

License

MIT

Install Server
A
license - permissive license
A
quality
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    B
    quality
    B
    maintenance
    Provides AI assistants with structured access to Unity project metadata, build settings, and agent documentation directly from the filesystem. It enables querying project details and scene configurations without requiring the Unity Editor to be running.
    100
    398
    2
  • A
    license
    B
    quality
    A
    maintenance
    Provides AI assistants with comprehensive control over Unity Hub and Unity Editor through over 200 specialized tools for project management and scene manipulation. It enables users to perform complex tasks like script creation, asset management, and project builds using natural language commands.
    80
    271
    366
    Inno Setup
  • A
    license
    -
    quality
    -
    maintenance
    Exposes Unity Editor project context and manipulation tools to AI coding agents, enabling automated scene hierarchy analysis, script inspection, and asset management. It supports both read and write operations including GameObject editing, component configuration, and animation authoring within the Unity environment.
    2

View all related MCP servers

Related MCP Connectors

  • UI design from prompts, screenshots, and URLs for AI coding agents and theme tokens.

  • Give your agent live data from Twitter, Reddit, the web and GitHub. No API keys, no scraping stack.

  • Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MarzLars/UIToolkitMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server