Enterprise-grade Model Context Protocol server providing 107 MCP tools for TrinityCore bot development targeting World of Warcraft 12.x (Midnight), including 12.1 opcode tables. Includes comprehensive game data access, AI-powered code analysis, performance profiling, and a full-featured web interface.
# Clone repository
git clone https://github.com/agatho/trinitycore-mcp.git
cd trinitycore-mcp
# Install dependencies
npm install
# Build TypeScript and generate the active build's spell caches
npm run setup
# Start both MCP server and Web UI
npm run start:all
npm run setupbuilds the project and generates the spell caches for the active build inconfig/builds.json. The caches are derived from that build'sSpellName.db2and take a few minutes. Skipping it is not fatal - the server generates them itself on first start - but spell lookups return no data until they exist.
Web UI will open at: http://localhost:3000
- Overview
- Features
- Installation
- Configuration
- Usage
- MCP Tools (107 Total)
- Web UI
- Documentation
- Development
- Contributing
- License
The TrinityCore MCP Server is a comprehensive development platform for building and managing TrinityCore PlayerBots. It provides:
- 107 MCP Tools - Complete API for game data, code analysis, testing, and automation
- Full-Featured Web UI - Interactive Next.js 16 interface with 36+ pages
- AI-Powered Code Review - 1,020+ TrinityCore-specific rules for C++ analysis
- DBC/DB2 Support - Parse WDC5/WDC6 client database files
- Performance Analysis - Bot scaling simulation (100-5000 bots)
- Live Database Access - Real-time MySQL queries via MCP
- 3,800+ API Documentation - Complete TrinityCore C++ API reference
- VMap/MMap Integration - Height detection and pathfinding support
- Spells - Spell info, damage/healing calculations, comparisons, optimal selection
- Items - Item data, gear scoring, best-in-slot finder, set optimization
- Quests - Quest chains, prerequisites, rewards, route optimization
- Creatures - NPC data, vendors, trainers, spawn locations, statistics
- World Data - Points of interest, game objects, spawn searches
- DBC/DB2 - Client database file parsing (WDC5/WDC6 support)
- GameTables - Combat ratings, XP tables, character stats, scaling data
- Talents - Specialization info, recommended builds, tier comparisons
- Combat Mechanics - Melee damage, armor mitigation, threat, diminishing returns
- Buffs - Buff recommendations, group coverage analysis, consumable optimization
- Dungeon Strategy - Boss mechanics, layouts, group composition, Mythic+ strategies
- Economy - Item pricing, auction house analysis, arbitrage, gold-making strategies
- Reputation - Faction info, reputation grinding paths, reward tracking
- Professions - Recipe data, skill-up plans, profitability analysis
- Coordination - Group composition analysis, cooldown coordination, tactical assignments
- PvP - Arena composition analysis, battleground strategies, PvP talent builds
- Collections - Pet/mount/toy tracking, missing collectibles, farming routes
- Quest Routing - Optimal quest paths, leveling routes, daily circuits, zone analysis
- Documentation - PlayerBot wiki search, code patterns, implementation guides
- Code Generation - Bot component templates, packet handlers, CMake integration
- API Reference - 3,800+ TrinityCore C++ method documentation
- Performance Analysis - Real-time metrics, scaling simulation, optimization suggestions
- Testing Automation - Test execution, multi-format reporting (JSON/HTML/Markdown/JUnit)
- Coverage Analysis - Code coverage with threshold validation
- Schema Exploration - Table listing, schema inspection, relationship mapping
- Database Operations - Export/import, backup/restore, health checks
- Schema Comparison - Database diff, migration support
- Code Review - 1,020+ rules across 7 categories (Null Safety, Memory, Concurrency, etc.)
- Thread Safety - Race condition detection, deadlock analysis, lock pattern validation
- Memory Analysis - Memory leak detection, RAII violations, circular references
- API Migration - Version migration support (3.3.5a → 12.0)
- Bot AI Analysis - Decision tree visualization, Mermaid flowchart generation
- Combat Log Analysis - DPS/HPS/TPS metrics, rotation quality, optimization suggestions
- Health Monitoring - Server health status, component checks, system metrics
- Logging - Log querying, filtering, file location
- Backups - Automated/manual backups, verification, integrity checks
- Security - Security status, rate limiting, access control audit
- Code Style - Naming convention checks, formatting validation, auto-fix
- VMap - Line-of-sight testing, height detection, spawn radius searches
- MMap - Pathfinding, navigation mesh validation, path calculation
- Configuration - Get/update/validate/reset/export server configuration
- AI Test Generation - AI-powered test generation, performance/load testing
The included web interface provides 36+ interactive pages for comprehensive TrinityCore development:
- Homepage - Beautiful dark gradient UI with live MCP status
- API Explorer - Browse 3,800+ TrinityCore methods with search
- Interactive Playground - Test all 107 MCP tools with JSON editor and history
- Real-time Database Access - Direct MySQL queries via MCP protocol
- Spell Browser - Search 45,000+ spells with school/effect filtering
- Item Database - Item search with quality/stat filtering
- Creature Explorer - NPC search with type/faction/vendor filters
- Quest Viewer - Quest chains, prerequisites, rewards visualization
- Analytics Dashboard - Interactive charts (Recharts) for spell/item/creature distributions
- Comparison Tool - Side-by-side batch comparison (up to 10 items) with diff highlighting
- Advanced Search - Fuzzy search (Fuse.js), multi-criteria filtering, saved presets
- Data Export - Export to CSV, Excel, JSON, PDF, XML formats
- AI Code Review - Upload C++ files for TrinityCore-specific analysis (1,020 rules)
- Bot AI Visualizer - Analyze PlayerBot AI with Mermaid flowcharts
- Server Monitoring - Real-time health, CPU, memory, latency graphs
- Database Schema Explorer - Visual ER diagrams, query builder, schema comparison
- Performance Profiler - Query optimization, slow query detection, N+1 analysis
- Workflow Automation - Automate dev tasks, code generation, server management
- Migration Manager - Database version control, migration tracking
- Documentation Generator - Auto-generate schema documentation
- Live Data Inspector - Real-time server monitoring via TrinityCore SOAP API
- Dark Mode - Complete dark theme optimized for development
- Responsive Design - Desktop, tablet, and mobile optimized
- Global Search - Cmd+K quick search across all data
- Copy to Clipboard - JSON, CSV, TSV clipboard support
- Print-Optimized - PDF exports with clean layouts
- Node.js 18+ - Download
- MySQL 9.4 (optional) - TrinityCore database for full functionality
- TrinityCore Build (optional) - For DBC/DB2 file paths
# 1. Clone repository
git clone https://github.com/agatho/trinitycore-mcp.git
cd trinitycore-mcp
# 2. Install dependencies
npm install
# 3. Build TypeScript to JavaScript
npm run build
# 4. Verify build output
ls dist/
# Should see: index.js, tools/, database/, etc.
# 5. Generate the active build's spell caches (a few minutes)
npm run setupThe spell name and description caches are generated from the active build's
SpellName.db2 and are keyed by build, so they are not in the repository and a
build cutover leaves the new build without them. Three things provision them:
| When | What happens |
|---|---|
npm install |
Reports whether the caches are present. Never generates, never fails the install. |
npm run setup |
Builds, then generates them and waits. This is the install-time step. |
First npm start |
If they are missing or belong to another build, the server generates them in the background and keeps serving its other tools meanwhile. |
Until they exist, spell lookups return no data rather than an error, so check
the server log if spells come back empty. npm run generate:spell-cache
regenerates them at any time.
# Install Web UI dependencies
cd web-ui
npm install
cd ..Create .env file in project root:
# TrinityCore Database (Required for game data queries)
TRINITY_DB_HOST=localhost
TRINITY_DB_PORT=3306
TRINITY_DB_USER=trinity
TRINITY_DB_PASSWORD=your_password
TRINITY_DB_AUTH=auth
TRINITY_DB_CHARACTERS=characters
TRINITY_DB_WORLD=world
# TrinityCore Paths (Optional - for DBC/DB2 reading)
TRINITY_ROOT=C:\TrinityBots\TrinityCore
DBC_PATH=C:\TrinityBots\Server\data\dbc
DB2_PATH=C:\TrinityBots\Server\data\db2
# VMap/MMap Paths (Optional - for height/pathfinding)
VMAP_DATA_PATH=C:\TrinityBots\Server\data\vmaps
MMAP_DATA_PATH=C:\TrinityBots\Server\data\mmaps
# MCP Server (Optional - defaults shown)
MCP_PORT=3000
MCP_HOST=localhostAdd to .claude/mcp-servers-config.json or claude_desktop_config.json:
{
"mcpServers": {
"trinitycore": {
"command": "node",
"args": ["C:\\TrinityBots\\trinitycore-mcp\\dist\\index.js"],
"env": {
"TRINITY_DB_HOST": "localhost",
"TRINITY_DB_PORT": "3306",
"TRINITY_DB_USER": "trinity",
"TRINITY_DB_PASSWORD": "${TRINITY_DB_PASSWORD}",
"TRINITY_ROOT": "C:\\TrinityBots\\TrinityCore",
"DBC_PATH": "C:\\TrinityBots\\Server\\data\\dbc",
"DB2_PATH": "C:\\TrinityBots\\Server\\data\\db2"
}
}
}
}For detailed configuration, see MCP_CONFIGURATION.md
npm run start:allThis will:
- Build the MCP server (if not already built)
- Install Web UI dependencies (if needed)
- Start the MCP server (stdio mode)
- Start the Web UI (http://localhost:3000)
- Automatically open your browser
# Production mode (stdio transport)
npm start
# or
npm run start:mcp
# Development mode (watch for changes)
npm run devnpm run start:webStarts Next.js development server on http://localhost:3000
The MCP server provides 107 registered tools organized into the following categories:
| Category | Tools | Description |
|---|---|---|
| Game Data | 40 | Spells, items, quests, creatures, world data, DBC/DB2, GameTables |
| Combat & Optimization | 12 | Talents, combat mechanics, buffs, dungeon strategy |
| Economy & Social | 8 | Item pricing, reputation, professions |
| Group & PvP | 8 | Coordination, arena, battlegrounds |
| Collections & Leveling | 7 | Collectibles, quest routing, zone analysis |
| Knowledge & Codegen | 12 | Documentation, code generation, API reference |
| Performance & Testing | 9 | Performance analysis, testing, coverage |
| Database | 11 | Schema, export/import, backup/restore |
| AI Code Review | 11 | Code review, thread safety, memory analysis, bot AI |
| Production & Monitoring | 11 | Health monitoring, logging, backups, security |
| VMap & MMap | 8 | Height detection, pathfinding |
| Configuration & Tests | 8 | Config management, AI test generation |
get-spell-info - Get detailed spell information by ID
get-item-info - Get item data by ID
get-quest-info - Get quest information by ID
query-dbc - Query DBC/DB2 file by record ID
get-trinity-api - Get TrinityCore C++ API documentation
get-opcode-info - Get network packet opcode documentation
query-gametable - Query GameTable files (CombatRatings.txt, xp.txt, etc.)
list-gametables - List all available GameTable files
get-combat-rating - Get combat rating conversion for level
get-character-stats - Get character base stats for level
// Get spell information
const fireball = await callMCPTool("get-spell-info", { spellId: 133 });
// Analyze bot performance
const perf = await callMCPTool("analyze-bot-performance", {
duration: 60000,
sampleInterval: 1000
});
// Review C++ code
const review = await callMCPTool("review-code-file", {
filePath: "src/modules/Playerbot/BotAI.cpp",
minConfidence: 0.7
});
// Optimize quest route
const route = await callMCPTool("optimize-quest-route", {
zone: "Elwynn Forest",
level: 5
});For complete tool documentation, see the Web UI API Explorer at http://localhost:3000/playground
Start the Web UI:
# Start both MCP server and Web UI
npm run start:all
# Or start Web UI only
npm run start:webAccess at: http://localhost:3000
- / - Homepage with live MCP status and quick links
- /playground - Interactive API playground to test all 107 tools
- /spells - Search and filter 45,000+ spells
- /items - Browse item database with filtering
- /creatures - Explore NPCs, vendors, trainers
- /dashboard - Analytics dashboard with charts
- /compare - Side-by-side data comparison
- /code-review - AI-powered C++ code review
- /ai-visualizer - Bot AI behavior analysis
- /monitoring - Server health monitoring
- /schema - Database schema explorer
- /docs - Complete API documentation
✅ 36+ Interactive Pages ✅ 107 MCP Tools Integration ✅ Real-time Database Access ✅ Advanced Search & Filtering ✅ Data Export (CSV, Excel, JSON, PDF, XML) ✅ AI Code Review (1,020 rules) ✅ Bot AI Visualization (Mermaid flowcharts) ✅ Server Monitoring (Real-time metrics) ✅ Dark Mode (Optimized for development) ✅ Responsive Design (Desktop, tablet, mobile)
- README.md - This file (main overview)
- CHANGELOG.md - Version history and changes
- MCP_CONFIGURATION.md - Detailed configuration guide
- INSTALLATION.md - Step-by-step installation instructions
- web-ui/README.md - Web UI specific documentation
- API Explorer - Interactive docs at http://localhost:3000/docs
- doc/API_REFERENCE.md - DBC/DB2 API reference
- doc/USAGE_GUIDE.md - Usage guide and examples
- doc/KNOWN_LIMITATIONS.md - Known limitations
# Build TypeScript to JavaScript
npm run build
# Watch mode (rebuild on changes)
npm run dev# Run tests
npm test
# Or use MCP testing tools via Claude Codenpm run linttrinitycore-mcp/
├── src/
│ ├── index.ts # Main MCP server entry point
│ ├── tools/ # 107 tool implementations (58 files)
│ │ ├── spell.ts
│ │ ├── item.ts
│ │ ├── quest.ts
│ │ ├── dbc.ts
│ │ ├── codereview.ts
│ │ ├── performance.ts
│ │ └── ... (52 more)
│ ├── database/
│ │ └── connection.ts # MySQL connection pool
│ ├── parsers/
│ │ ├── dbc/ # DBC/DB2 parsers
│ │ └── cache/ # Caching system
│ └── utils/
│ └── logger.ts
├── web-ui/ # Next.js 16 web interface
│ ├── app/ # App Router pages (36+ pages)
│ ├── components/ # React components
│ ├── lib/ # Utilities and MCP client
│ └── public/ # Static assets
├── data/
│ └── api_docs/ # 3,800+ API documentation files
├── tests/ # Test suites
├── dist/ # Compiled JavaScript (build output)
├── package.json # v0.9.0-RC1
├── tsconfig.json
└── README.md # This file
Contributions welcome! Please follow TrinityCore coding standards.
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Build and test:
npm run build && npm test - Commit with descriptive message
- Push to fork:
git push origin feature/amazing-feature - Open Pull Request
- ✅ TypeScript strict mode compliance
- ✅ Zero compilation errors/warnings
- ✅ Comprehensive error handling
- ✅ JSDoc documentation for public APIs
- ✅ Unit tests for new features
- ✅ Performance considerations
GPL-2.0 (same as TrinityCore)
See LICENSE file for details.
- Documentation: doc/ directory
- Issues: GitHub Issues
- TrinityCore: TrinityCore Repository
- MCP Protocol: Model Context Protocol
- TrinityCore Team - For the amazing WoW server framework
- Model Context Protocol - For the MCP standard
- Anthropic - For Claude Code and AI assistance
- TypeScript Team - For the excellent language
- Next.js Team - For the React framework
- Vercel - For shadcn/ui components
Version: 0.9.0-RC1 (Release Candidate 1) Status: ✅ Production Ready MCP Tools: 107 registered tools Web UI Pages: 36+ interactive pages Last Updated: 2025-11-08
Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com