{"id":45831007,"url":"https://github.com/codeturion/unity-api-mcp","last_synced_at":"2026-03-03T02:01:17.399Z","repository":{"id":340459698,"uuid":"1166090340","full_name":"Codeturion/unity-api-mcp","owner":"Codeturion","description":"Instant, accurate Unity API lookups instead of expensive source file reads, saving your agent tokens, context, and hallucinations","archived":false,"fork":false,"pushed_at":"2026-02-28T22:49:20.000Z","size":7808,"stargazers_count":30,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-02T01:48:38.625Z","etag":null,"topics":["ai","api-documentation","claude","cursor","game-development","mcp","mcp-server","model-context-protocol","unity","unity2022","unity2023","unity3d","unity6","windsurf"],"latest_commit_sha":null,"homepage":"https://www.codeturion.me","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Codeturion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-24T21:40:04.000Z","updated_at":"2026-03-01T23:44:15.000Z","dependencies_parsed_at":"2026-03-02T01:12:40.167Z","dependency_job_id":null,"html_url":"https://github.com/Codeturion/unity-api-mcp","commit_stats":null,"previous_names":["codeturion/unity-api-mcp"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/Codeturion/unity-api-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codeturion%2Funity-api-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codeturion%2Funity-api-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codeturion%2Funity-api-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codeturion%2Funity-api-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Codeturion","download_url":"https://codeload.github.com/Codeturion/unity-api-mcp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codeturion%2Funity-api-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30030304,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T00:31:48.536Z","status":"online","status_checked_at":"2026-03-03T02:00:07.650Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","api-documentation","claude","cursor","game-development","mcp","mcp-server","model-context-protocol","unity","unity2022","unity2023","unity3d","unity6","windsurf"],"created_at":"2026-02-26T22:10:12.895Z","updated_at":"2026-03-03T02:01:17.350Z","avatar_url":"https://github.com/Codeturion.png","language":"Python","readme":"# unity-api-mcp\n\n\u003c!-- mcp-name: io.github.Codeturion/unity-api-mcp --\u003e\n\n[![MCP Registry](https://img.shields.io/badge/MCP-Registry-blue)](https://registry.modelcontextprotocol.io/servers/io.github.Codeturion/unity-api-mcp)\n[![PyPI Version](https://img.shields.io/pypi/v/unity-api-mcp.svg)](https://pypi.org/project/unity-api-mcp/)\n[![PyPI Downloads](https://img.shields.io/pypi/dm/unity-api-mcp.svg)](https://pypi.org/project/unity-api-mcp/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)\n\n**MCP server that gives AI agents accurate Unity API documentation. Prevents hallucinated signatures, wrong namespaces, and deprecated API usage.**\n\nSupports **Unity 2022 LTS**, **2023**, and **Unity 6** with separate databases for each version. Works with Claude Code, Cursor, Windsurf, or any MCP-compatible AI tool. No Unity installation required.\n\n## Quick Start\n\n```bash\npip install unity-api-mcp\n```\n\nAdd to your MCP config (`.mcp.json`, `mcp.json`, or your tool's MCP settings), setting `UNITY_VERSION` to match your project:\n\n```json\n{\n  \"mcpServers\": {\n    \"unity-api\": {\n      \"command\": \"unity-api-mcp\",\n      \"args\": [],\n      \"env\": {\n        \"UNITY_VERSION\": \"2022\"\n      }\n    }\n  }\n}\n```\n\nValid values: `\"2022\"`, `\"2023\"`, or `\"6\"`. On Windows, use `unity-api-mcp.exe`.\n\nOn first run the server downloads the correct database (~18-24 MB) to `~/.unity-api-mcp/`.\n\n## How It Works\n\n1. **Version detection.** The server figures out which Unity version to serve:\n\n| Priority | Source | Example |\n|----------|--------|---------|\n| 1 | `UNITY_VERSION` env var | `\"2022\"`, `\"6\"`, or `\"6000.3.8f1\"` |\n| 2 | `UNITY_PROJECT_PATH` | Reads `ProjectSettings/ProjectVersion.txt`, maps `2022.3.62f1` to `\"2022\"` |\n| 3 | Default | `\"6\"` |\n\n2. **Database download.** If the database for that version isn't cached locally, it downloads from GitHub (one time).\n\n3. **Serve.** All tool calls query the version-specific SQLite database. Every query returns in \u003c15ms.\n\nEach version has its own database with the correct signatures, deprecation warnings, and member lists for that release.\n\n## Tools\n\n| Tool | Purpose | Example |\n|------|---------|---------|\n| `search_unity_api` | Find APIs by keyword | \"Tilemap SetTile\", \"async load scene\" |\n| `get_method_signature` | Exact signatures with all overloads | `UnityEngine.Physics.Raycast` |\n| `get_namespace` | Resolve `using` directives | \"SceneManager\" -\u003e `using UnityEngine.SceneManagement;` |\n| `get_class_reference` | Full class reference card | \"InputAction\" -\u003e all methods/fields/properties |\n| `get_deprecation_warnings` | Check if an API is obsolete | \"WWW\" -\u003e Use UnityWebRequest instead |\n\n## Coverage\n\nAll UnityEngine and UnityEditor modules, plus packages parsed from C# source: Input System, Addressables, uGUI, TextMeshPro, AI Navigation, and Netcode.\n\n| Version | Records | Deprecated | Modules | Size |\n|---------|---------|------------|---------|------|\n| Unity 2022 LTS | 32,000 | 442 | 86 XML + packages | 18 MB |\n| Unity 2023 | 31,387 | 436 | 92 XML | 18 MB |\n| Unity 6 | 42,223 | 516 | 139 XML + packages | 24 MB |\n\nDoes **not** cover third-party assets (DOTween, VContainer, Newtonsoft.Json). For those, rely on project source.\n\n## Benchmarks\n\nIn a 10-step research workflow, MCP uses **4x fewer tokens** than a skilled agent and **11x fewer** than a naive agent:\n\n![Total Tokens - 10-Step Research Workflow](https://raw.githubusercontent.com/Codeturion/unity-api-mcp/master/docs/images/01-total-tokens.png)\n\nThe gap holds across every question type. MCP wins on simple lookups and complex multi-part research alike:\n\n![Hallucination Risk: Grep+Read vs MCP](https://raw.githubusercontent.com/Codeturion/unity-api-mcp/master/docs/images/04-hallucination.png)\n\nEven in a realistic hybrid workflow where MCP results are followed up with targeted file reads, it still uses **54% fewer tokens** than a skilled agent working without MCP:\n\n![Realistic Workflow: MCP + Targeted Read](https://raw.githubusercontent.com/Codeturion/unity-api-mcp/master/docs/images/03-hybrid.png)\n\n\"Without MCP\" estimates assume full file reads. A skilled agent with good tooling may use fewer tokens than shown. What MCP guarantees is a correct, structured answer in 1 call every time.\n\n### Per-question breakdown\n\n![Token Cost Per Question](https://raw.githubusercontent.com/Codeturion/unity-api-mcp/master/docs/images/02-per-step.png)\n\n\u003cdetails\u003e\n\u003csummary\u003eAccuracy\u003c/summary\u003e\n\n| Test | Result |\n|------|--------|\n| Search top-1 relevance (12 common queries) | 100% |\n| Namespace resolution (6 key classes) | 100% |\n| Key class coverage (17 common Unity classes) | 94% (16/17) |\n\nRanking uses BM25 with tuned column weights (member name 10x, class name 5x) plus core namespace boosting to ensure `Object.Instantiate` ranks above niche APIs like `InstantiationParameters.Instantiate`.\n\n\u003c/details\u003e\n\n## CLAUDE.md Snippet\n\nAdd this to your project's `CLAUDE.md` (or equivalent instructions file). **This step is important.** Without it, the AI has the tools but won't know when to reach for them.\n\n```markdown\n## Unity API Lookup (unity-api MCP)\n\nUse the `unity-api` MCP tools to verify Unity API usage instead of guessing. **Do not hallucinate signatures.**\n\n| When | Tool | Example |\n|------|------|---------|\n| Unsure about a method's parameters or return type | `get_method_signature` | `get_method_signature(\"UnityEngine.Tilemaps.Tilemap.SetTile\")` |\n| Need the `using` directive for a type | `get_namespace` | `get_namespace(\"SceneManager\")` |\n| Want to see all members on a class | `get_class_reference` | `get_class_reference(\"InputAction\")` |\n| Searching for an API by keyword | `search_unity_api` | `search_unity_api(\"async load scene\")` |\n| Checking if an API is deprecated | `get_deprecation_warnings` | `get_deprecation_warnings(\"FindObjectOfType\")` |\n\n**Rules:**\n- Before writing a Unity API call you haven't used in this conversation, verify the signature with `get_method_signature`\n- Before adding a `using` directive, verify with `get_namespace` if unsure\n- Covers: all UnityEngine/UnityEditor modules, Input System, Addressables\n- Does NOT cover: DOTween, VContainer, Newtonsoft.Json (third-party)\n```\n\n## Setup Details\n\n\u003cdetails\u003e\n\u003csummary\u003eAuto-detect version from project path\u003c/summary\u003e\n\nInstead of setting `UNITY_VERSION`, you can point to your Unity project. The server reads `ProjectSettings/ProjectVersion.txt` automatically:\n\n```json\n{\n  \"mcpServers\": {\n    \"unity-api\": {\n      \"command\": \"unity-api-mcp\",\n      \"args\": [],\n      \"env\": {\n        \"UNITY_PROJECT_PATH\": \"/path/to/your/unity-project\"\n      }\n    }\n  }\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eEnvironment variables\u003c/summary\u003e\n\n| Variable | Purpose | Example |\n|----------|---------|---------|\n| `UNITY_VERSION` | Unity version to serve | `2022`, `2023`, `6`, or `6000.3.8f1` |\n| `UNITY_PROJECT_PATH` | Auto-detect version from project | `F:/Unity Projects/my-project` |\n| `UNITY_INSTALL_PATH` | Override Unity install path (for `ingest` only) | `D:/Unity/6000.3.8f1` |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eBuilding databases locally\u003c/summary\u003e\n\nIf you want to build a database from your own Unity installation instead of downloading:\n\n```bash\n# Install with ingest dependencies\npip install unity-api-mcp[ingest]\n\n# Build for a specific version\npython -m unity_api_mcp.ingest --unity-version 6 --unity-install \"D:/Unity/6000.3.8f1\" --project \"F:/Unity Projects/MyProject\"\npython -m unity_api_mcp.ingest --unity-version 2022 --unity-install \"D:/Unity/2022.3.62f1\"\npython -m unity_api_mcp.ingest --unity-version 2023 --unity-install \"D:/Unity/2023.1.22f1\"\n```\n\nDatabases are written to `~/.unity-api-mcp/unity_docs_{version}.db` by default.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eAI-Assisted Setup\u003c/summary\u003e\n\nIf an AI agent is setting this up for you:\n\n\u003e Install `unity-api-mcp` via pip, add it to my MCP config with `UNITY_VERSION` set to match my project, append the CLAUDE.md snippet from the README, and verify with `get_namespace(\"SceneManager\")`.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eProject structure\u003c/summary\u003e\n\n```\nunity-api-mcp/\n├── src/unity_api_mcp/\n│   ├── server.py          # MCP server (5 tools)\n│   ├── db.py              # SQLite + FTS5 database layer\n│   ├── version.py         # Version detection + DB download\n│   ├── xml_parser.py      # Parse Unity XML IntelliSense files\n│   ├── cs_doc_parser.py   # Parse C# doc comments from package source\n│   ├── unity_paths.py     # Locate Unity install + package dirs\n│   └── ingest.py          # CLI ingestion pipeline\n└── pyproject.toml\n```\n\nDatabases are stored in `~/.unity-api-mcp/` (downloaded on first run).\n\n\u003c/details\u003e\n\n## Troubleshooting\n\n| Problem | Fix |\n|---------|-----|\n| \"Could not download Unity X database\" | Check internet connection. Or build locally: `python -m unity_api_mcp.ingest --unity-version 2022` |\n| Wrong API version being served | Set `UNITY_VERSION` explicitly. Check stderr: `unity-api-mcp: serving Unity \u003cversion\u003e API docs` |\n| Server won't start | Check `python --version` (needs 3.10+). Check path: `which unity-api-mcp` or `where unity-api-mcp` |\n| Third-party packages return no results | DOTween, VContainer, Newtonsoft.Json are not indexed (third-party, not Unity packages) |\n\n---\n\n## See Also\n\n**[unreal-api-mcp](https://github.com/Codeturion/unreal-api-mcp)** — Same concept for Unreal Engine (C++). Covers UE 5.5, 5.6, and 5.7.\n\n## Contact\n\nNeed a custom MCP server for your engine or framework? I build MCP tools that cut token waste and prevent hallucinations for AI-assisted game development. If you want something similar for your team's stack, reach out.\n\nfuatcankoseoglu@gmail.com\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeturion%2Funity-api-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeturion%2Funity-api-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeturion%2Funity-api-mcp/lists"}