Skip to main content

MCP server providing ground-truth Unreal Engine API documentation -- prevents AI hallucination of signatures, includes, and deprecated APIs

Project description

unreal-api-mcp

MCP Registry PyPI Version PyPI Downloads License: MIT Python 3.10+

MCP server that gives AI agents accurate Unreal Engine C++ API documentation. Prevents hallucinated signatures, wrong #include paths, and deprecated API usage.

Supports UE 5.5, 5.6, and 5.7 with separate databases for each version. Works with Claude Code, Cursor, Windsurf, or any MCP-compatible AI tool. No Unreal Engine installation required.

Quick Start

pip install unreal-api-mcp

Add to your MCP config (.mcp.json, mcp.json, or your tool's MCP settings), setting UNREAL_VERSION to match your project:

{
  "mcpServers": {
    "unreal-api": {
      "command": "unreal-api-mcp",
      "args": [],
      "env": {
        "UNREAL_VERSION": "5.5"
      }
    }
  }
}

Valid values: "5.5", "5.6", or "5.7". On Windows, use unreal-api-mcp.exe.

On first run the server downloads the correct database (~43-48 MB) to ~/.unreal-api-mcp/.

How It Works

  1. Version detection. The server figures out which UE version to serve:
Priority Source Example
1 UNREAL_VERSION env var "5.5", "5.6", "5.7"
2 UNREAL_PROJECT_PATH Reads .uproject EngineAssociation field, maps 5.5.1 to "5.5"
3 Default "5.7"
  1. Database download. If the database for that version isn't cached locally, it downloads from GitHub (one time).

  2. Serve. All tool calls query the version-specific SQLite database. Exact lookups return in <1ms, searches in <5ms.

Each version has its own database with the correct signatures, deprecation warnings, and member lists for that release.

Tools

Tool Purpose Example
search_unreal_api Find APIs by keyword "character movement", "spawn actor"
get_function_signature Exact signature with parameters and return type AActor::GetActorLocation
get_include_path Resolve #include for a type "ACharacter" -> #include "GameFramework/Character.h"
get_class_reference Full class reference card "APlayerController" -> all functions/properties/delegates
get_deprecation_warnings Check if an API is obsolete "K2_AttachRootComponentTo" -> Use AttachToComponent() instead

Coverage

All Engine Runtime, Editor, Developer modules, plus built-in plugins (Enhanced Input, Gameplay Abilities, Common UI, Niagara, Chaos, and hundreds more).

Version Records Deprecated Modules DB Size
UE 5.5 99,591 3,689 860 43 MB
UE 5.6 109,530 4,205 981 48 MB
UE 5.7 114,724 4,409 1,019 50 MB

Record breakdown (UE 5.7):

Type Count Source
Classes (UCLASS) 10,075 AActor, ACharacter, UGameplayStatics, ...
Structs (USTRUCT) 9,014 FHitResult, FVector, FTransform, ...
Enums (UENUM) 3,475 EMovementMode, ECollisionChannel, ...
Functions (UFUNCTION) 23,414 Signatures with params, return types, specifiers
Properties (UPROPERTY) 66,340 Types, specifiers, doc comments
Delegates 2,406 Dynamic multicast, delegate declarations

Does not cover third-party plugins or marketplace assets. For those, rely on project source.

Benchmarks

In a 10-step character movement development workflow, MCP consistently uses far fewer tokens than agents working with grep and file reads:

Total Tokens - 10-Step Development Workflow

The gap holds across every question type. MCP wins on simple include lookups and complex class references alike:

Hallucination Risk: Grep+Read vs MCP

Even in a realistic hybrid workflow where MCP results are followed up with targeted file reads, it still uses significantly fewer tokens than a skilled agent working without MCP:

Realistic Workflow: MCP + Targeted Read

"Without MCP" estimates assume full or partial file reads. A skilled agent with good tooling may use fewer tokens than shown. What MCP guarantees is a correct, structured answer in one call every time.

Per-question breakdown

Token Cost Per Question

Query latency

Measured on UE 5.7 database (114,724 records), 50 iterations per query:

Query Median p95
Exact FQN lookup (get_function_signature) <1ms <1ms
FTS search: specific function name <1ms <1ms
FTS search: keyword ("spawn actor") 1ms 1ms
Include path resolution 2ms 2ms
Class reference (full member list) 22ms 23ms
Deprecation check 24ms 25ms
Accuracy
Test Result
Search top-1 relevance (8 common queries) 100%
Include path resolution (6 key classes) 100%
Function signature accuracy (3 common functions) 100%
Class reference completeness (2 classes) 100%
Deprecation detection (1 deprecated API) 100%

Ranking uses BM25 with tuned column weights (member name 10x, class name 5x) plus core module boosting to ensure AActor::GetActorLocation ranks above niche plugin APIs.

CLAUDE.md Snippet

Add 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.

## Unreal Engine API Lookup (unreal-api MCP)

Use the `unreal-api` MCP tools to verify UE C++ API usage instead of guessing. **Do not hallucinate signatures or #include paths.**

| When | Tool | Example |
|------|------|---------|
| Unsure about a function's parameters or return type | `get_function_signature` | `get_function_signature("AActor::GetActorLocation")` |
| Need the `#include` for a type | `get_include_path` | `get_include_path("ACharacter")` |
| Want to see all members on a class | `get_class_reference` | `get_class_reference("UCharacterMovementComponent")` |
| Searching for an API by keyword | `search_unreal_api` | `search_unreal_api("spawn actor")` |
| Checking if an API is deprecated | `get_deprecation_warnings` | `get_deprecation_warnings("K2_AttachRootComponentTo")` |

**Rules:**
- Before writing a UE API call you haven't used in this conversation, verify the signature with `get_function_signature`
- Before adding a `#include`, verify with `get_include_path` if unsure
- Covers: all Engine Runtime/Editor modules, built-in plugins (Enhanced Input, GAS, CommonUI, Niagara, etc.)
- Does NOT cover: third-party plugins or marketplace assets

Setup Details

Auto-detect version from .uproject

Instead of setting UNREAL_VERSION, you can point to your Unreal project. The server reads the EngineAssociation field from your .uproject file:

{
  "mcpServers": {
    "unreal-api": {
      "command": "unreal-api-mcp",
      "args": [],
      "env": {
        "UNREAL_PROJECT_PATH": "F:/Unreal Projects/MyProject"
      }
    }
  }
}
Environment variables
Variable Purpose Example
UNREAL_VERSION UE version to serve 5.5, 5.6, 5.7
UNREAL_PROJECT_PATH Auto-detect version from .uproject F:/Unreal Projects/MyProject
UNREAL_INSTALL_PATH Override UE install path (for ingest only) H:/UE_5.6
Building databases locally

If you want to build a database from your own Unreal Engine installation instead of downloading:

# Build for a specific version
python -m unreal_api_mcp.ingest --unreal-version 5.6 --unreal-install "H:/UE_5.6"
python -m unreal_api_mcp.ingest --unreal-version 5.5 --unreal-install "H:/UE_5.5"

Databases are written to ~/.unreal-api-mcp/unreal_docs_{version}.db by default.

Project structure
unreal-api-mcp/
├── src/unreal_api_mcp/
│   ├── server.py          # MCP server (5 tools)
│   ├── db.py              # SQLite + FTS5 database layer
│   ├── version.py         # Version detection + DB download
│   ├── header_parser.py   # Parse Unreal C++ headers (UCLASS, UFUNCTION, etc.)
│   ├── unreal_paths.py    # Locate UE installs + discover modules
│   └── ingest.py          # CLI ingestion pipeline
└── pyproject.toml

Databases are stored in ~/.unreal-api-mcp/ (downloaded on first run).

Troubleshooting

Problem Fix
"Could not download UE X database" Check internet connection. Or build locally: python -m unreal_api_mcp.ingest --unreal-version 5.6 --unreal-install H:/UE_5.6
Wrong API version being served Set UNREAL_VERSION explicitly. Check stderr: unreal-api-mcp: serving UE <version>
Server won't start Check python --version (needs 3.10+). Check path: which unreal-api-mcp or where unreal-api-mcp
Third-party plugins return no results Marketplace/third-party plugins are not indexed. Only built-in Engine and Plugin APIs are covered.

Contact

Need 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.

fuatcankoseoglu@gmail.com

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unreal_api_mcp-0.1.1.tar.gz (363.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unreal_api_mcp-0.1.1-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file unreal_api_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: unreal_api_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 363.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for unreal_api_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 381f2e8b3d7affd89b6fc2b71e24e1b6a6aa3d28d57edc08ec8704f224cc0571
MD5 9817f2d90d73901bf4eff9101a9e9e4f
BLAKE2b-256 aee84f1b3572e8701df3096a69c39a21f3548f66b1598ee19072a53fba9c1440

See more details on using hashes here.

Provenance

The following attestation bundles were made for unreal_api_mcp-0.1.1.tar.gz:

Publisher: publish.yml on Codeturion/unreal-api-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file unreal_api_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: unreal_api_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for unreal_api_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4cb7083ad475ae11d962cd29ee53cafc1928d41081b91b37505f04ec1537d3a4
MD5 5eafb0ff2496a42514fe6141b9db3277
BLAKE2b-256 5e9258a234921b74f85d3f4a7408f9c2509b80eb05eb3b4c6ce43f991a4e4c78

See more details on using hashes here.

Provenance

The following attestation bundles were made for unreal_api_mcp-0.1.1-py3-none-any.whl:

Publisher: publish.yml on Codeturion/unreal-api-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page