Unity UIToolkit MCP Server
Provides LLM agents with access to Unity UIToolkit documentation, code examples, and HTML/CSS to UXML/USS conversion tools.
README
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:
Pre-rendered Documentation (Recommended)
- 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
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:
- Fetches latest Unity UIToolkit HTML documentation
- Filters to UIToolkit-related pages only
- Converts to clean Markdown using markitdown
- 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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.