P4ulyB/Unreal-Engine-Semantic-Analysis-MCP-Server---Claude-Code
If you are the rightful owner of Unreal-Engine-Semantic-Analysis-MCP-Server---Claude-Code and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The UE Semantic Analysis MCP Server is a powerful tool designed to provide Claude Code agents with deep and accurate analysis of Unreal Engine codebases, enhancing decision-making and maintaining clear separation of concerns.
UE Semantic Analysis MCP Server
Version: 1.0.0
Target: Claude Code + Agent Integration
Engine: Unreal Engine 5.5+ (optimised for UE 5.6)
Platform: Windows 11
A powerful MCP server that provides your Claude Code agents with deep, accurate analysis of Unreal Engine codebases. This MCP serves as a read-only knowledge provider enabling your agents to make better implementation decisions while maintaining clear separation of concerns.
Enhanced Features
Advanced Multi-Strategy Search
- Clangd Integration: Enhanced LSP protocol implementation with proper message parsing
- SQLite FTS5: Improved indexing with BM25 ranking and context-aware queries
- Smart Basic Search: File caching, batch processing, and intelligent confidence scoring
- Graceful Degradation: Always works, automatically adapts to available tools
Comprehensive Pattern Matching
- 26+ Epic Source Patterns: Now with regex matching and semantic analysis
- Pattern Confidence Scoring: AI-driven relevance ranking for better results
- Multi-Modal Detection: Exact, regex, and semantic pattern matching
- Anti-Pattern Detection: Identifies common mistakes and suggests fixes
Enhanced Policy Framework
- 22-Point Validation: Extended with Epic source references and pattern matching
- Automated Fix Suggestions: Smart recommendations with code examples
- Performance Impact Analysis: Categorizes policy violations by performance cost
- Australian English: Enhanced spelling consistency with automated corrections
Networking & Multiplayer Focus
- Authority Validation: Advanced HasAuthority() pattern detection
- RPC Analysis: Comprehensive Server/Client/NetMulticast validation
- Replication Safety: Enhanced DOREPLIFETIME and OnRep_ pattern checking
- Epic Source Verification: Mandatory verification against Epic's official patterns
Quick Start
# Clone or extract to your desired location
cd ue-semantic-mcp
# Install dependencies
npm install
# Initialize the project
npm run init
# Edit configuration with your actual paths
nano ue.config.json # or use your preferred editor
# Build the project
npm run build
# Start the server
npm run start
Configuration
Edit ue.config.json with your project paths:
{
"paths": {
"engineSource": "C:/UnrealEngine/Engine/Source",
"projectSource": "C:/Dev/YourProject/Source",
"compileCommands": "C:/Dev/YourProject/.vscode/compile_commands.json",
"indexDirectory": "./indexes"
},
"search": {
"strategies": ["clangd", "fts", "basic"],
"maxResults": 50,
"timeoutMs": 5000
},
"policies": {
"enforceAustralianEnglish": true,
"requireEpicSourceCitations": true,
"validateNetworkingPatterns": true
}
}
Performance Optimizations
- Intelligent Caching: File-level caching with memory limits
- Batch Processing: Efficient handling of large codebases
- Confidence-Based Ranking: AI-powered result prioritization
- Multi-Threading Support: Parallel search execution
- Index Optimization: Smart indexing with performance analysis
Claude Code Integration
Add to your Claude Code MCP configuration:
{
"mcpServers": {
"ue-semantic": {
"command": "node",
"args": ["./dist/server.js"],
"cwd": "/path/to/ue-semantic-mcp"
}
}
}
Available Tools
search_ue_patterns
Advanced search with multi-modal pattern matching and confidence scoring.
Parameters:
query(required): Search termscontext: Filter by 'class', 'function', 'property', 'networking', 'replication', or 'any'requireEpicSource: Only return Epic source resultscheckPolicies: Apply enhanced policy analysismaxResults: Limit results (default: 20)
Enhanced Features:
- Regex pattern matching with anti-pattern detection
- Semantic analysis with confidence scoring
- Epic source correlation and verification
- Performance impact analysis
get_epic_pattern
Comprehensive pattern analysis with Epic source references.
Parameters:
pattern(required): Pattern name (e.g., "HasAuthority", "DOREPLIFETIME")includeExamples: Include code examples (default: true)includeDocLinks: Include Epic documentation links (default: true)
Enhanced Features:
- Regex pattern definitions with usage examples
- Common mistake detection and prevention
- Context validators for proper usage
- Related pattern suggestions
validate_policies
Advanced validation with Epic source correlation and automated fixes.
Parameters:
code(required): C++ code to validatepolicyCategories: Specific categories to checkenforcementLevel: 'strict', 'moderate', or 'advisory' (default: moderate)
Enhanced Features:
- Epic source reference correlation
- Automated fix suggestions with code examples
- Performance impact analysis
- Confidence-based violation scoring
get_networking_patterns
Get UE networking patterns for multiplayer development.
Parameters:
category: 'authority', 'rpc', 'replication', 'networking', or 'all' (default: all)includeExamples: Include code examples (default: true)
analyze_networking_code
Comprehensive networking analysis with Epic pattern verification.
Parameters:
code(required): C++ code to analyze
Enhanced Features:
- Advanced authority validation patterns
- RPC qualifier analysis with performance recommendations
- Replication safety checks with Epic source references
- Multi-modal pattern detection (exact, regex, semantic)
gent Integration Examples
CodeArchitect
// Verify Epic source patterns
const epicPatterns = await mcp.get_epic_pattern({
pattern: "HasAuthority",
includeExamples: true,
includeDocLinks: true
});
// Validate implementation against policies
const policyCheck = await mcp.validate_policies({
code: implementationCode,
policyCategories: ["networking", "authority"],
enforcementLevel: "strict"
});
CodeReviewer
// Search for similar networking patterns
const patterns = await mcp.search_ue_patterns({
query: "HasAuthority replication",
context: "networking",
requireEpicSource: true,
checkPolicies: true
});
TestRunner
// Find Epic testing patterns
const testPatterns = await mcp.search_ue_patterns({
query: "UFUNCTION test automation",
context: "function",
requireEpicSource: true
});
Key Benefits
For Agents
Enhanced Epic Source Verification: Regex and semantic pattern matching
AI-Powered Confidence Scoring: Better decision-making with ranked results
Automated Fix Suggestions: Code examples from Epic source references
Performance Impact Analysis: Understand the cost of different approaches
Performance & Reliability
Multi-Tier Search Architecture: clangd → FTS5 → Basic with intelligent fallbacks
Smart Caching: File-level caching with memory management
Batch Processing: Efficient handling of large codebases
Always Available: Works even without clangd installation
Networking Excellence
Authority Pattern Detection: Advanced HasAuthority() validation
RPC Analysis: Server/Client/NetMulticast pattern verification
Epic Source Alignment: Verified against official Epic patterns
Anti-Pattern Detection: Prevents common networking mistakes
Architecture
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Your Agents │──▶│ UE Semantic │───▶│ Hybrid Search │
│ (Claude Code) │ │ Analysis MCP │ │ (Multi-tier) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ Policy │ │
│ │ Engine (22pts) │ │
│ └─────────────────┘ │
│ │
▼ Search Strategies:
┌─────────────────┐ 1. Clangd (semantic)
│ Your UE Project │ 2. SQLite FTS (fast)
│ (Implementation)│ 3. Basic text (reliable)
└─────────────────┘ 4. Epic patterns (built-in)
Project Structure
ue-semantic-mcp/
├── package.json
├── tsconfig.json
├── ue.config.json # Your project configuration
├── src/
│ ├── server.ts # Main MCP server
│ ├── search/ # Multi-strategy search
│ │ ├── hybrid-search.ts
│ │ ├── clangd-search.ts
│ │ ├── fts-search.ts
│ │ └── basic-search.ts
│ ├── policy/ # Policy validation
│ │ ├── pa-policy-engine.ts
│ │ └── ue-patterns.ts
│ └── types/
│ └── index.ts
├── data/
│ ├── pa-policies.json # 22-point policy framework
│ └── ue-patterns.json # Epic source patterns
├── scripts/
│ └── init.mjs # Initialization script
├── indexes/ # Search indexes
└── dist/ # Compiled JavaScript
Enhanced Search Strategies
1. Clangd (Semantic Analysis)
- Enhanced LSP Protocol: Improved message parsing and symbol analysis
- Symbol Context: Better understanding of code structure and relationships
- Requires: compile_commands.json for optimal performance
- Performance: Highest accuracy, best for complex semantic queries
2. SQLite FTS5 (Full-Text Search)
- BM25 Ranking: Advanced relevance scoring algorithm
- Context-Aware Queries: Understands networking, replication contexts
- Smart Indexing: Optimized for UE source code patterns
- Performance: Fast, good for large codebases
3. Enhanced Basic Search
- File Caching: Smart memory management with size limits
- Batch Processing: Efficient parallel file processing
- Confidence Scoring: AI-driven relevance calculation
- Performance: Always available, reliable fallback
4. Epic Pattern Engine
- 26+ Verified Patterns: Comprehensive UE networking patterns
- Regex Matching: Advanced pattern detection capabilities
- Semantic Hints: AI-powered pattern recognition
- Anti-Patterns: Common mistake detection and prevention
Policy Framework (22-Point)
The system validates against 22 comprehensive policies:
- Authority & Security - Server authority validation
- RPC Qualifiers - Explicit networking qualifiers
- Australian English - Spelling consistency
- Networking Patterns - Epic networking best practices
- Replication Safety - Data validation and integrity
- UFUNCTION Consistency - Blueprint integration patterns
- Memory Management - UE memory management practices
- Thread Safety - Safe multi-threading patterns
- Performance Patterns - Epic optimization guidance
- Error Handling - Robust error management ... (and 12 more specialized policies)
Troubleshooting & Optimization
Search Performance
Clangd Not Available
- Normal if you don't have compile_commands.json or clangd installed
- System automatically falls back to FTS5 + Basic search
- Optimization: Generate compile_commands.json for 40% better accuracy
- Installation: Install clangd via LLVM or Visual Studio Build Tools
Slow Search Results
- Check if FTS indexing completed successfully
- Solution: Run
npm run initto rebuild indexes with performance analysis - Tuning: Adjust
maxResultsin config for faster responses - Caching: File cache automatically optimizes repeated searches
Policy & Pattern Issues
No Epic Source Patterns Found
- Verify your
engineSourcepath points to UE Engine source - Expected:
C:/UnrealEngine/Engine/Sourceor similar - Validation: Run init script for automatic path validation
Policy Validation Too Strict/Lenient
- Adjust
enforcementLevel: 'strict' | 'moderate' | 'advisory' - Confidence Tuning: Enhanced policies now include confidence scoring
- Custom Rules: Modify
data/pa-policies.jsonfor project-specific rules
Performance Optimization
Memory Usage
- File cache automatically limits to 100 files (configurable)
- Large Projects: Use FTS strategy for projects >1000 files
- Monitoring: Enhanced init script provides performance estimates
Index Management
- Automatic: Indexes rebuild when source files change
- Manual:
npm run initrebuilds all indexes with validation - Size: Typical index: ~50KB per 1000 source files
Requirements
Essential
- Node.js 18+: JavaScript runtime
- Your UE Project: Source paths configurable in ue.config.json
- Dependencies: Automatically installed via
npm install
Recommended for Optimal Performance
- clangd: LSP server for semantic analysis (40% accuracy improvement)
- compile_commands.json: Generated by UE build system for clangd
- Git: For source tracking and version correlation (optional)
Performance Scaling
- Small Projects (<500 files): Basic search sufficient
- Medium Projects (500-2000 files): FTS5 recommended
- Large Projects (2000+ files): clangd + FTS5 for optimal performance
Memory Requirements
- Minimum: 512MB RAM for basic operation
- Recommended: 2GB RAM for large projects with full indexing
- Storage: ~50KB index per 1000 source files
License
Enhanced Version 1.1.0 - Created for Agent integration with advanced pattern matching, Epic source verification, and comprehensive networking analysis following Australian English conventions.
Recent Enhancements
- Advanced Pattern Matching: Regex and semantic analysis with confidence scoring
- Enhanced Search Strategies: Improved clangd, FTS5, and basic search implementations
- Epic Source Integration: Comprehensive Epic pattern verification with source references
- Performance Optimizations: Smart caching, batch processing, and intelligent result ranking
- Policy Framework 2.0: Enhanced 22-point validation with automated fix suggestions
Integration Ready
Optimized for Claude Code PA agents with advanced semantic analysis and Epic source pattern verification.