Tibia MCP Server
Enables AI agents to query TibiaWiki data including creatures, items, NPCs, quests, and more via 19 MCP tools.
README
Tibia MCP Server
A tool that downloads, parses, and indexes all content from TibiaWiki — the wiki for the MMORPG Tibia — and serves it via an MCP (Model Context Protocol) server for AI agents.
Quick Start
The fastest way to get everything running is with Claude Code (Anthropic's official CLI). This project includes a custom skill /start that automates the entire setup:
- Open a terminal at the project root
- Start Claude Code:
claude - Run the skill:
/start
The skill will automatically:
- Check all prerequisites (Docker, Docker Compose, free ports, etc.)
- Create the persistent data directory for PostgreSQL
- Start the database, run the crawler, and launch the MCP server
- Display the ready-to-use MCP URL
MCP URL:
http://localhost:8000/sse
Prerequisites
- Claude Code installed (
npm install -g @anthropic-ai/claude-code) - Docker and Docker Compose V2
- Ports 5432 (PostgreSQL) and 8000 (MCP) available
Persistent Data
PostgreSQL data is stored in ./data/postgres/ on the host machine. This means restarting containers does not lose data — the crawler doesn't need to re-download everything.
Useful Commands
# Watch logs in real-time
docker compose logs -f
# Check service status
docker compose ps
# Stop everything (data preserved)
docker compose down
# Full reset (deletes data)
docker compose down -v && rm -rf ./data/postgres && docker compose up --build -d
MCP Configuration for Claude Desktop
Add to your MCP configuration file:
{
"mcpServers": {
"tibiawiki": {
"url": "http://localhost:8000/sse"
}
}
}
Works with Claude Desktop, Claude Code, Cursor, Windsurf, and any MCP-compatible client.
What It Does
- Downloads all TibiaWiki pages via the MediaWiki API (raw wikitext)
- Parses structured infoboxes from 20 entity types (creatures, items, spells, NPCs, quests, etc.)
- Stores normalized data in PostgreSQL
- Extracts map coordinates and generates tags/summaries per entity
- Serves the data via MCP with 19 tools optimized for AI agent queries
Stack
- Python 3.12
- PostgreSQL 16 — relational storage with materialized views
- FastMCP — MCP server for AI agent integration
- Docker + Docker Compose — containerized environment
- psycopg2, requests, python-dotenv
- pgvector + llama-index (optional) — semantic search via embeddings
Project Structure
src/
main.py # Orchestrator (runs all 6 phases)
mcp_server.py # MCP server with 19 tools
tagger.py # Tag and summary generation
api/ # HTTP client with rate limiting and retry
parser/ # Parsers by infobox type (20 types)
db/ # Connection, migrations, and upserts
migrations/ # 28 numbered SQL files
tests/ # pytest + wikitext fixtures
web/ # Next.js landing page
How It Works
src/main.py runs 6 sequential phases:
Phase 0 → Migrations Apply SQL migrations to the database
Phase 1 → Download Download wikitext from all pages (batches of 50)
Phase 2 → Parse & Import Extract infoboxes and upsert into normalized tables
Phase 3 → Positions Extract {{mapa|X,Y,Z}} coordinates to the positions table
Phase 4 → Tags & Summaries Generate tags (e.g. "boss", "immune_fire") and text summaries
Phase 5 → Materialized Views Refresh creature_drops, npc_trades, quest_bosses, etc.
Supported Entities
| Entity | Table | Infobox |
|---|---|---|
| Creatures | creatures |
Infobox_Criatura |
| Items | items |
Infobox_Item |
| Spells | spells |
Infobox_Spell |
| NPCs | npcs |
Infobox_NPC |
| Quests | quests |
Infobox_Quest |
| Achievements | achievements |
Infobox_Achievement |
| Mounts | mounts |
Infobox_Mount |
| Outfits | outfits |
Infobox_Outfit |
| Imbuements | imbuements |
Infobox_Imbuement |
| Hunts | hunts |
Infobox_Hunts |
| Books | books |
Infobox_Book |
| Buildings | buildings |
Infobox_Building |
| Worlds | worlds |
Infobox_World |
| Runes | runes |
Infobox_Runas |
| World Quests | world_quests |
Infobox_World_Quest |
| World Changes | world_changes |
Infobox_World_Change |
| Familiars | familiars |
Infobox Familiar |
| Tasks | tasks |
Infobox_Tasks |
| Updates | updates |
Infobox_Updates |
| Fansites | fansites |
Infobox_Fansite |
MCP Server
src/mcp_server.py exposes 19 tools for AI agents to query the database. The suggested usage pattern is:
discover → filter → detail
Tools
| Category | Tool | Description |
|---|---|---|
| Discovery | describe_tables |
Database schema, row counts, and column details |
| Discovery | list_entities |
Browse entities by type with pagination |
| Search | search |
Full-text search across all entity types |
| Search | search_by_tags |
Filter by auto-generated tags |
| Search | semantic_search |
Natural language AI-powered search |
| Creatures | creature_full_info |
Complete profile: stats, loot, hunts, quests |
| Creatures | creature_weakness |
Find creatures weak to a specific element |
| Creatures | compare_creatures |
Side-by-side stat comparison |
| Items | where_to_get_item |
Drops, NPC shops, and quest rewards |
| Items | where_to_sell_item |
NPCs that buy the item and their prices |
| Items | items_for_vocation |
Equipment for a class and body slot |
| Hunting | recommend_hunt |
Best hunts by level and vocation |
| Hunting | profit_analysis |
Estimated gold per kill |
| Map | get_map_url |
Generate TibiaWiki map URLs |
| Map | search_by_position |
Find entities near coordinates |
| Map | nearby_entities |
Entities near a named location |
| Advanced | rank_entities |
Top items by price, strongest creatures, etc. |
| Advanced | query_database |
Custom read-only SQL queries |
| Advanced | get_entity |
Full details for any single entity |
Usage Examples
Real questions an AI agent can answer using this MCP:
Equipment recommendation by vocation and level
"What's the recommended set for a Knight level 400?"
The agent uses items_for_vocation("knight") filtering by each slot (helmet, armor, legs, boots, shield, ring) and cross-references with level to build the best combination:
| Slot | Item | Armor/Def | Resistances | Skill Boost |
|---|---|---|---|---|
| Helmet | Spiritthorn Helmet | 12 arm | Physical +6%, Energy +10% | Sword/Club/Axe +3 |
| Armor | Spiritthorn Armor | 20 arm | Physical +13% | Sword/Club/Axe +4 |
| Legs | Falcon Greaves | 10 arm | Physical +7%, Ice +7% | Melee +3 |
| Boots | Pair of Soulwalkers | 4 arm | Physical +7%, Fire +5% | Melee +1, Speed +15 |
| Shield | Soulbastion | 42 def | Physical +10%, Death +10% | — |
| Ring | Charged Spiritthorn Ring | 2 arm | Physical +8%, All Elements +4% | Melee +3 |
Complete quest guide
"How do I complete the Desert Quest?"
The agent uses search("desert quest", entity_type="quests") followed by get_entity("quests", "The Desert Dungeon Quest") to return the full spoiler: preparation, required items, step-by-step path, sacrifice room positioning, and rewards.
NPC locations
"Where are the guards for the Inquisition Quest?"
The agent fetches each NPC with get_entity("npcs", "Walter, The Guard") etc., returning exact coordinates and TibiaWiki map links:
| NPC | Coordinates | Link |
|---|---|---|
| Henricus | 32316, 32268, z8 | map |
| Walter, The Guard | 32341, 32278, z7 | map |
| Tim, The Guard | 32424, 32226, z6 | map |
More examples
- "Creatures weak to fire?" →
creature_weakness("fire") - "Where does Falcon Longsword drop?" →
where_to_get_item("Falcon Longsword") - "Best hunts for Paladin level 250?" →
recommend_hunt(250, "paladin") - "Most expensive items?" →
rank_entities("items", "npc_value") - "Dragon Lord vs Frost Dragon?" →
compare_creatures("Dragon Lord", "Frost Dragon") - "Where to sell Demon Helmet?" →
where_to_sell_item("Demon Helmet") - "Profit per kill at Hydra?" →
profit_analysis("Hydra")
Local Setup (without Docker)
# 1. Copy and edit the configuration file
cp .env.example .env
# 2. Install dependencies
pip install -r requirements.txt
# 3. Run the downloader
python -m src.main
# 4. Start the MCP server
python -m src.mcp_server
Tests
pytest tests/
Fixtures in tests/fixtures/ contain real wikitext samples for testing parsers.
Semantic Search (optional)
To enable semantic search with embeddings:
- Install the optional dependencies in
requirements.txt(uncomment thellama-indexlines) - Make sure the
pgvectorextension is enabled in PostgreSQL (migration027_enable_pgvector.sql) - Run
python -m src.indexerafter the download
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。