Unreal Python API RAG MCP Server
Provides a retrieval/MCP knowledge server for the Unreal Engine Python API, enabling AI agents to retrieve real signatures and documentation before writing code.
README
unreal-python-api-rag
The Unreal Engine Python API as a retrieval / MCP knowledge server — so any AI agent writes correct, version-exact UE Editor Python instead of guessing.
LLMs hallucinate the unreal API (wrong class names, arg orders, deprecated
calls). This grounds them: it introspects the API straight from your engine
and serves it over MCP, so agents retrieve the real signatures/docs before
they write code. Plugs into Forge, Claude, kiro, GPT — anything that speaks MCP.
Install
pip install git+https://github.com/stanlink-games/unreal-python-api-rag.git
Python 3.10+. Lexical search needs no extra deps; semantic search is the optional
[semantic] extra.
1. Build the corpus (version-exact, from your engine)
Run inside the UE editor's Python (only there is import unreal available) —
e.g. via ForgeMCP's run_editor_python or the editor console:
import unreal_api_rag.build as b
b.dump("/path/to/ue_api_5.8.jsonl") # one JSON line per class/method/function
Ship that JSONL in src/unreal_api_rag/data/ and it's bundled with the package.
2. Serve it over MCP
unreal-api-rag mcp --host 127.0.0.1 --port 8780
# → http://127.0.0.1:8780/mcp/ (Streamable HTTP, stateless)
Tools:
search_ue_api(query, k=8, kind=None)— rank matching classes/methods by relevance (signatures + docs).kindoptionally filters toclass/method/function.get_symbol(name)— exact lookup (e.g.unreal.EditorActorSubsystemorspawn_actor_from_class; case-insensitive, accepts the bare member name).
Query it from the terminal too (no server needed):
unreal-api-rag search set actor location
unreal-api-rag search sky atmosphere --kind class -k 5
3. Plug into an agent
Add it as an MCP server (e.g. Forge game.yaml):
mcp_servers:
editor: http://127.0.0.1:8000/mcp
clay: http://127.0.0.1:8770/mcp/
ue_api: http://127.0.0.1:8780/mcp/
Then the agent calls search_ue_api before writing UE Python, so it uses the
real API — dramatically fewer tracebacks.
Design
-
Corpus (
data/*.jsonl) — one entry per API symbol, introspected from the engine (authoritative, version-pinned). -
Retrieval — dependency-light lexical ranking tuned for API queries:
- a tokenizer that splits
snake_case,CamelCaseand letter/digit runs into words, so"set actor location"matchesset_actor_location; - IDF weighting so discriminative terms (
heightmap) beat ubiquitous ones (get); - field boosting — a name hit outweighs a docstring hit;
- phrase/prefix bonuses + conservative plural stemming (
materials→material).
Optional embedding search (
[semantic]extra) is a drop-in upgrade behind the same interface. Ranking quality is guarded by a benchmark suite that runs against the real 27k-symbol corpus. - a tokenizer that splits
-
Server — stateless MCP Streamable HTTP, mounted at
/mcp(same shape as ForgeMCP/Clay), so it's multi-worker + edge-hostable.
Hosted (mcp.stanl.ink/unreal, Cloudflare Workers + Vectorize) is tracked
separately. This repo is the open, local-first core.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.