sylvanai-mcp
# sylvanai
> **Work in progress.** sylvanai is an early, personal project, tested
> mostly on WoW Forever. Expect missing features, rough edges, and
> breaking changes to the config, database and addon data between
> versions.
>
> **Not affiliated with Blizzard Entertainment.** World of Warcraft and
> Blizzard are trademarks of Blizzard Entertainment, Inc. This project is
> not made, endorsed or supported by Blizzard.
>
> **Built to follow the game's Terms of Service.** sylvanai only reads
> files the client already writes (combat log, SavedVariables,
> screenshots). It sends no input to the game, automates nothing, reads
> no game memory or data files, and gives no in-combat callouts. The
> addon uses only standard addon APIs. See [Ground rules](#ground-rules)
> and [Terms decision](#terms-decision). This is how the project is
> designed, not legal advice: you are responsible for how you use it.
A read-only coach for World of Warcraft that you talk to between pulls.
It reads what the game already writes to disk (the combat log, addon
SavedVariables, your screenshots), stores it in a local SQLite database,
and gives Claude read-only MCP tools to look at it (plus a small goals list you can ask it to keep). After a wipe you can
ask "why did I die?" or "compare that pull with the last one" and get an
answer from real data.
It never plays the game for you. It sends no input to the client and
gives no real-time callouts during combat.
Primary target: **World of Warcraft: Forever** (`_forever_`, interface
16001). The addon also loads on retail and does nothing on Classic
flavors.
```
WoW client ──writes──> Logs/ , WTF/.../SavedVariables/ , Screenshots/
│ (read only)
sylvanai-daemon (tails, parses, stores)
│
SQLite (local)
│ (read only)
sylvanai-mcp (stdio) ──> Claude Code / Claude Desktop
```
## Ground rules
This is a design posture, not legal advice. Each data source stays on
the passive side of the line:
| Channel | What it does | What it never does |
|---|---|---|
| Combat log | Tails the file the client writes once you turn on `/combatlog` | Turn logging on itself or call `LoggingCombat()` |
| Addon | Snapshots your character (see [What the addon saves](#what-the-addon-saves)) when you are out of combat, using standard guarded APIs | Register `COMBAT_LOG_EVENT_UNFILTERED`, send addon/chat messages, join channels, write to chat logs, make protected calls, read secret values |
| SavedVariables | Parses `Sylvanai.lua` after `/reload` or logout | Write to any client file |
| Screenshots | Reads images you took with the WoW screenshot key (Print Screen by default) | Capture the screen or the game window itself |
| Network | Only when you run `data pull` (see [Knowledge base](#knowledge-base)). `bnet_enabled` is reserved and off | Telemetry, uploads, or network use from `run` or the MCP server |
Hard constraints, from [AGENTS.md](AGENTS.md):
- Read-only: no in-game actions, input injection, keystrokes, mouse
events, automation, or macros generated for execution.
- No process memory reading, no DLL injection, and no client file
changes outside the addon's own folder.
- No pixel-strip or screen-encoded data channel from the addon.
- The addon makes no network calls and sends no addon or chat messages.
- Advice is given between pulls only.
- Screenshots are only the files you took with the game's screenshot key.
- The daemon is local-only and has no telemetry.
Note that whatever an MCP tool returns, including player names and any
image, is sent to Claude as part of your conversation.
## Install
Requires [uv](https://docs.astral.sh/uv/). uv fetches Python 3.12+ itself
if needed.
```bash
# macOS: brew install uv (or the installer on docs.astral.sh/uv)
# Windows: winget install astral-sh.uv
git clone <this repo> sylvanai
cd sylvanai
uv sync
```
This installs two commands into the project environment, `sylvanai-daemon`
and `sylvanai-mcp`. `uv run sylvanai-daemon ...` and
`uv run python -m sylvanai_daemon ...` are the same thing.
## 1. Turn on combat logging
1. In game: **Options > System > Network > Advanced Combat Logging**, on.
Without it, pulls still work but there is no HP, position or power
data.
2. Type `/combatlog`. The chat line confirms that logging started. Type
it again later to stop.
3. Forever ignores logging requests for about 10 seconds after loading
into a dungeon. Turn logging on before you zone in, or wait a moment
and check the chat confirmation.
Logs go to `<WoW root>/_forever_/Logs/WoWCombatLog-MMDDYY_HHMMSS.txt`.
## 2. Install the addon
Copy (or symlink) `addon/Sylvanai` into the flavor's AddOns folder:
| OS | AddOns folder |
|---|---|
| macOS | `/Applications/World of Warcraft/_forever_/Interface/AddOns/` |
| Windows | `C:\Program Files (x86)\World of Warcraft\_forever_\Interface\AddOns\` |
```bash
# macOS
cp -R addon/Sylvanai "/Applications/World of Warcraft/_forever_/Interface/AddOns/"
```
```powershell
# Windows (PowerShell)
Copy-Item -Recurse addon\Sylvanai "C:\Program Files (x86)\World of Warcraft\_forever_\Interface\AddOns\"
```
Forever loads `Sylvanai_Camelot.toc`; retail loads `Sylvanai.toc`.
The addon snapshots your character when you are out of combat, but the
client writes SavedVariables to disk only on `/reload` or logout.
`/sylsync` just reminds you of that ("type /reload to sync"). It never
reloads for you.
`/sylprobe` is a diagnostic: it saves which game APIs exist and which
reads come back secret to `SylvanaiCharDB.probe` (no values or names).
See [Checking the addon](docs/fixture-capture.md#checking-the-addon).
### What the addon saves
Each character's snapshot goes to its own SavedVariables file
(`WTF/Account/<ACCOUNT>/<Realm>/<Char>/SavedVariables/Sylvanai.lua`,
`SylvanaiCharDB` schema v2), so the account-wide file stays small however
many alts you play. The account `SylvanaiDB` is now an empty schema v3;
older v1 and v2 account files, which held every character, still load.
Each section has its own `taken_at`, and a section whose APIs are
missing on a flavor is left out.
| Section | Contents |
|---|---|
| `basics` | Name, realm, level, class, race, faction, XP, rested XP, money (copper) |
| `gear` | Equipped items (slot, id, link, ilvl) and weapon speed, damage range and DPS |
| `talents` | Spec, loadout, talents with spell name, tree and rank, and unspent points |
| `spells` | Spellbook: spell id, name, rank, tab (up to 300) |
| `skills` | Professions, secondary, weapon and class skills with rank/max (Lockpicking, Poisons, First Aid...) |
| `reps` | Factions with standing and progress |
| `bags` | Item id, link and count per bag slot (up to 200) |
| `bank` | Same, saved only while the bank is open |
| `quests` | Quest id, title, level, zone, complete, and objectives with progress (x/y) |
| `zone` | Zone, subzone, map id, x/y map position (not inside instances), instance |
| `roster` | Solo, party or raid with members |
### Freshness
What Claude sees is as old as your last `/reload` or logout.
`get_character` returns, per section, `taken_at`, `age_s` and `stale`
(`stale_why` says why). A section's `taken_at` is when the addon last
read it: at the last loading screen, or when its game event fired
(money, bags, quests...). The addon takes no snapshot as you log out,
since the game already reads empty data when it closes, so a section
that did not change since the last loading screen keeps that older
time even after a `/reload`. Its data is still current, except for
changes in the 2 s before the `/reload`, which reach the next save.
- `age`: older than 10 minutes.
- `zone`: the combat log shows a zone or map change after the snapshot
that names somewhere else, or your own logged map id (`live.map_id`)
is newer and differs (the log flushes far more often than
SavedVariables).
It also returns `log_zone`, the combat log's latest zone and map with
their times, `live` (below), and `missing` for sections never saved.
When a section is stale, `/reload` and ask again. A section still
stale right after a `/reload` has not changed since your last loading
screen (the `/reload` itself re-reads it for the next save).
### Live state from the combat log
`get_status` and `get_character` carry a `live` block built from the
combat log, not the addon, so it is as fresh as the last log flush
(check `lag_s`). With Advanced Combat Logging on, every damage, heal,
energize and cast line carries an advanced block about one unit (its
`infoGUID`). `live` takes the newest such line about you (the source
flagged as yours, `AFFILIATION_MINE`):
| Field | Meaning |
|---|---|
| `ts`, `age_s`, `event` | Log time of that line, seconds since, its event type |
| `hp`, `max_hp` | Health |
| `power` | `[{type, value, max, on}]`; a rogue finisher logs energy and combo points. Combo points carry `on: "target"`: they sit on your target at that cast, switching targets leaves them there, and every fight starts at 0 (Premeditation excepted) |
| `ilvl` | The block's "level" field: item level for players (a level 20 rogue logs 12, then 14 after new gear), not character level |
| `map_id`, `pos` | uiMapID and world `x`, `y`, `facing`; `map_id` is 0 inside instances |
| `map_pos` | Map percent `x`/`y` (like `/way`), `approx: true`; left out inside instances or when no `MAP_CHANGE` for that map was logged |
| `zone`, `map` | Latest `ZONE_CHANGE` (name, instance id, difficulty) and `MAP_CHANGE` (id, name, bounds) |
`MAP_CHANGE` writes its bounds as `x0, x1, y0, y1`. In both real
fixtures `posX` always falls between `x0` and `x1` and `posY` between
`y0` and `y1` (Tirisfal and Undercity, where the ranges do not
overlap, settle it), and the `y` span is 1.5 times the `x` span, the
3:2 zone map. So `posY` runs left to right and `posX` top to bottom:
`map_x = (y0 - posY) / (y0 - y1)`, `map_y = (x0 - posX) / (x0 - x1)`,
times 100. Known spots land right (the Sepulcher at 45, 40; Tarren
Mill at 60, 20; Boulder Lode Mine at 56, 6), but nothing has been
checked against the addon's `C_Map` position yet, hence `approx`. `tools/map_pos_probe.py` does that
check (docs/fixture-capture.md, "Checking map_pos").
There is deliberately no live feed from the addon between reloads. A common trick is
to have an addon print state into a private chat channel and read it
back from `WoWChatLog.txt` with `/chatlog`. That sends chat messages
and uses chat as a data channel, which the hard constraints forbid and
which risks breaking the game's terms of service. The addon never
calls `SendChatMessage`, `C_ChatInfo`, `JoinChannelByName` or
`LoggingChat` (a test greps for them).
## 3. Run the daemon
Keep it running in a terminal while you play:
```bash
uv run sylvanai-daemon run
```
It finds the WoW folder, prefers `_forever_`, and resumes from where it
stopped last time. Ctrl-C stops it cleanly (a second Ctrl-C stops it at
once). If it cannot find your install, tell it where to look:
```bash
# macOS
uv run sylvanai-daemon run --wow-root "/Applications/World of Warcraft"
```
```powershell
# Windows
uv run sylvanai-daemon run --wow-root "D:\Games\World of Warcraft" --flavor forever
```
The install is searched for in this order:
1. `--wow-root`
2. the `SYLVANAI_WOW_ROOT` variable
3. **macOS:** `/Applications` and `~/Applications`
4. **Windows:** the Battle.net registry key, then `Program Files` on
drives C to H, plus `Games` and the drive root
5. **Linux:** Wine prefixes
`--wow-root` may also point at a flavor folder such as `_forever_`.
`uv run python tools/locate_probe.py` prints every path tried and what it
found there (docs/fixture-capture.md, "Checking the install locator").
### Commands
| Command | What it does |
|---|---|
| `run [--flavor F] [--wow-root P] [--log-tz Z] [--once]` | Tail the log and watch SavedVariables and screenshots. `--once` drains the backlog and exits. |
| `ingest-file PATH [--flavor F] [--log-tz Z]` | Import one log file and print counts as JSON. Running it twice on the same file duplicates events (wc-ynz). |
| `prune [--days N]` | Delete events older than the retention window and print `{"deleted": n}`. Pull aggregates are kept. |
| `status` | Print flavor, build, log path, last event and last pull as JSON. Needs the database that `run` creates. |
| `data pull\|rebuild\|status\|list` | Knowledge base; see [Knowledge base](#knowledge-base). |
Every `sylvanai-daemon` command accepts `--db PATH`, `--config PATH` and
`-v`; `data` commands also take `--kb-dir PATH`. Logs go to stderr. The
exit code is 1 on errors and 2 on bad arguments.
### Config file (optional)
Defaults < `config.toml` < command-line flags. The file is optional and
never created for you: without it every default applies. Unknown keys
are logged and ignored.
`config.toml` lives in the **config** folder. On Linux and Windows that
is **not** the folder that holds the database, so do not look for it
next to `sylvanai.sqlite3` (only macOS uses one folder for both):
| OS | Config file | Database (data folder) |
|---|---|---|
| macOS | `~/Library/Application Support/sylvanai/config.toml` | `~/Library/Application Support/sylvanai/sylvanai.sqlite3` |
| Windows | `%APPDATA%\sylvanai\config.toml` (Roaming) | `%LOCALAPPDATA%\sylvanai\sylvanai.sqlite3` (Local) |
| Linux | `$XDG_CONFIG_HOME/sylvanai/config.toml`, default `~/.config/sylvanai/config.toml` | `$XDG_DATA_HOME/sylvanai/sylvanai.sqlite3`, default `~/.local/share/sylvanai/sylvanai.sqlite3` |
`sylvanai-daemon status` and the `get_status` tool print the config path
in use and whether the file was found; `sylvanai-mcp` also logs it at
startup. The daemon accepts `--config PATH`; `sylvanai-mcp` has no such
flag yet and always reads the default path above. It reads the
file once at startup, so restart it after an edit; until then
`get_status` shows the startup values with `changed_since_start: true`.
`get_status` also lists the `paths` it started with (`db`, `kb`,
`goals`), each with its `source`: `flag`, `env`, `config` or `default`.
```toml
# every key is optional; values shown are examples or (marked) defaults
db = "~/sylvanai/sylvanai.sqlite3" # default: <data folder>/sylvanai.sqlite3
wow_root = "/Applications/World of Warcraft" # default: found automatically
flavor = "forever" # forever, retail, classic, classic_era, classic_beta
retention_days = 30 # default; raw events older than this are pruned (hourly)
idle_gap_s = 8 # default; quiet time that ends a trash pull
flush_lag_s = 60 # default; extra wait for late log flushes before closing it
# (or before leaving an old log that ends mid-line)
log_tz = "local" # default; zone of log timestamps: local (this machine) or IANA name
poll_s = 1 # default; seconds between log reads
bnet_enabled = false # reserved; no Battle.net code exists
kb_dir = "~/sylvanai/kb" # knowledge base: raw cache + kb.sqlite3 (default: <data folder>/kb)
goals_path = "~/sylvanai/goals.json" # personal goals (default: goals.json next to the database)
[channel] # game events pushed to Claude; every value is the default
enabled = true
fights = "all" # all, dungeon, boss, off
min_pull_s = 10 # shorter pulls get no note (not applied to boss)
notable = true # ...unless on a rare or named NPC (needs the knowledge base)
deaths = true
areas = "first_visit" # first_visit, always, off
area_cooldown_min = 60
dungeons = true
goals = true
level_up = true
gear = true
skills = true # profession tier caps, lagging weapon skill
xp_drift = true # open-world pulls in a row on grey mobs (no XP)
xp_drift_pulls = 5 # ...that many before the note
screenshots = true
min_gap_s = 30 # seconds between notes; events inside are merged
poll_s = 2 # seconds between database checks
```
The `[channel]` keys are explained in [Events](#events). A broken
`[channel]` table only turns events off; the rest of the file still
applies.
Log timestamps carry no offset: they are the game machine's wall clock.
The default `local` fits when the daemon runs on that machine; set
`log_tz` (e.g. `Europe/Paris`) when importing a log from elsewhere.
On Windows, IANA names need the `tzdata` package (`local` does not).
Upgrading from a version without `log_tz`: those versions read log
timestamps as UTC, so on a UTC+1 machine stored pulls sit an hour in the
future. The first `run` or `ingest-file` after the upgrade re-dates
them once into `log_tz` and logs a warning saying how many events it
moved. Snapshot and screenshot times are not touched (they were right).
Changing `log_tz` later does not re-date stored rows: delete the
database and re-import if you change it. A running MCP server (section
4) switches to the new database by itself. On Windows it holds the file
open, so the delete fails: quit Claude Code first (or disable the
`sylvanai` server in `/mcp`).
## 4. Connect Claude
The MCP server reads the database that the daemon writes. It finds it
from `--db`, then `SYLVANAI_DB`, then the daemon config (`db` key or the
platform default). It opens the database on the first tool call, so it
can start before the daemon does.
**Claude Code:**
```bash
claude mcp add sylvanai -- uv --directory /path/to/sylvanai run python -m sylvanai_mcp
```
**Claude Desktop:** edit `claude_desktop_config.json`
(macOS: `~/Library/Application Support/Claude/`, Windows: `%APPDATA%\Claude\`):
```json
{
"mcpServers": {
"sylvanai": {
"command": "uv",
"args": ["--directory", "/path/to/sylvanai", "run", "python", "-m", "sylvanai_mcp"]
}
}
}
```
If Claude Desktop cannot find `uv`, use its full path (`which uv` or
`where uv`). To use a non-default database, add `"env": {"SYLVANAI_DB": "..."}`.
The knowledge base folder comes from `--kb`, then `SYLVANAI_KB`, then the
config's `kb_dir`; it too is opened on first use.
Tools, read-only except `add_goal`, `update_goal` and `remove_goal` (they write `goals.json`; see [Personal goals](#personal-goals)) and `mute_events` (in-memory only; see [Events](#events)):
| Tool | Returns |
|---|---|
| `get_status` | Flavor, build, log path, last event time, lag, `log_quiet` when the log went silent while you play, `live` (your HP, power, position from the log), and the config and paths in effect |
| `list_pulls(limit, encounter?, char?)` | Recent boss and trash pulls, each with the `char` that logged it; `char` keeps one character's pulls |
| `get_pull_summary(pull_id = "last")` | Per-player damage, healing and taken, deaths, interrupts, aura uptimes; enemy casts that went off uninterrupted next to the ones kicked (per NPC and spell), dispels per player, and who broke crowd control (Sap, Polymorph, Gouge) with what |
| `get_pull_details(pull_id = "last", player?)` | One player's pull (default: you): per ability casts, hits, crits, damage, misses by type (pets labeled) and casts refused for positioning (behind, facing, range, sight, close), aura uptime, debuff uptime on the main target, stealth opener and first ability, power spent and gained, finishers, presses refused on cooldown or short of power (`starved`: key spam, not a mistake), enemies (level, killed), idle time between ability casts (auto attacks do not count); for a healer, healing per spell rank (effective, overheal %, share of 90%+ overheal hits, mana per heal) and per target (overheal, HP % before the heal) |
| `get_damage_taken(pull_id = "last", player?)` | One player's damage taken (default: you) by source NPC and ability, by kind (melee, spell, `aoe` and `env`: often avoidable), how many enemies hit you (over the pull, and at most within 5 s), and mitigation (dodges, parries, blocks, resists, absorbs, crushing blows, crits) |
| `get_aggro(pull_id = "last")` | Who each enemy went for in a group pull: who it went to first, who held it and for how long, when it switched off the tank and to whom, and per player how often mobs came to them and the melee they took while someone else held the mob. Classic logs carry no threat, so this reads who the mob attacked (an estimate: random-target spells, fears and kiting look like switches; a mob counts as on nobody during crowd control or gaps over 5 s, and moving on after its target died is not a switch) and infers the tank as the one who took the most enemy swings; solo pulls have nothing to report |
| `get_recent_combat(window_s)` | Aggregates for the last N seconds of log time |
| `get_death_recap(pull_id, player?)` | Last hits and heals before each death |
| `compare_pulls(a, b)` | Side-by-side `[a, b, b-a]`, with kicks and missed kicks (enemy casts with a cast time that went off; not all are interruptible) |
| `get_character(char?, sections?)` | Latest addon snapshot per section, with `age_s`, `stale`, the log's latest zone and `live` |
| `get_talent_summary(char?)` | Talent points per tree, spent (trait trees: purchased ranks only) and unspent (the game's own count, saved by the addon; for older saves on Classic Era, level - 9 - spent), and the nearest trainers of your class friendly to your faction in your zone (or the zones that have one), for the character you are playing; trainable spell ranks are not listed yet |
| `get_class_kit(char?)` | Your character's kit on Forever, which is neither retail nor Classic 1.12: the abilities you have learned (highest rank of each, as of your last `/reload`: `/reload` after training) tagged with what Forever's own spell text says about them (combo point builder or finisher, needs Stealth, from behind, only out of combat, breaks on damage, interrupts...), your talents with points, and the engine rules of your class that apply to you (resources, what carries between fights, what you can prepare before a pull), each marked with how we know it: a real Forever log, Forever's spell data, the player, or Classic lore not checked on Forever. It flags a spellbook saved before your last level-up |
| `find_item(query, char?)` | Bag and bank slots for an item name or id, with counts and snapshot age; `char = "*"` searches every character (which alt holds it) |
| `list_characters()` | Every character the addon saved: level, xp %, rested xp, class, race, money, professions, zone and last seen, plus your gold across all of them |
| `get_session(when = "last", run?, char?)` | A review of one play session (play with no break over 30 min; `when` is `last`, a day `YYYY-MM-DD` or a time `YYYY-MM-DDTHH:MM`, local), every session of the last N days (`when = "7d"`, up to 30: what got done this week) or one dungeon run (`run = "last"` or a run id): time played and in pulls, zones with minutes, dungeon runs, bosses killed and wiped, deaths with their killing blows, the abilities that hurt you most, dps and idle % per pull with the early vs late trend, interrupts, the worst and best pull, level, xp and gold gained (from `/reload` or logout saves), skill ranks and reputation gained, xp, gold and skill pace per hour played (hours from log activity: the game's played time is never saved) with how many hours at that pace to each active level and skill goal, gear swaps, quests turned in, screenshots and goals done |
| `get_mob_stats(zone?, hours = 3, char?)` | What each kind of mob cost you over the last hours of play (up to 72; `zone` keeps the pulls of one zone; one character's pulls, by default the latest pull's): how many you fought and killed, how often alone or with adds (its own summons are no adds), damage to you and HP lost per mob, time to kill, downtime before the next pull (eating, drinking, walking), deaths it caused, with its level range and rank from the knowledge base. A pack's HP and downtime are split by each mob's share of the damage to you, and a summon's damage and kills count for its master, even after the master died; HP needs advanced combat logging |
| `list_screenshots(limit)` | Known screenshots |
| `get_screenshot(id = "latest", region = "center", max_edge = 1568)` | JPEG image plus its path and size |
| `search_wiki(query, limit = 5)` | Wiki snapshot search: title, snippet, url, license and snapshot date (max 10) |
| `get_wiki_page(title, max_chars = 4000, section?, offset = 0)` | One wiki page as plain text (redirects followed, any case), its `sections` (`sections_total` when more exist), cut at `max_chars` (max 8000) with `next_offset` to read on, and its `classic` sibling page when there is one with real content (300 chars or more; shorter "(Classic)" pages are stubs) |
| `lookup_item(name_or_id, limit = 3)` | Item quality, item level, required level (QuestieDB levels when the client hides the item, `source: questie`), class, slot, `has_stats`, drop sources with zone and chance, quests, links; where to buy: `sold_by` vendors friendly to your faction (current zone first, with coords), `buy_copper` per `buy_count`, and `afford` from your money at the last `/reload` |
| `lookup_quest(name_or_id, limit = 3)` | Quest level, zone, start and end NPCs/objects with coords, objectives with names, races and classes it is limited to, prerequisites, links |
| `get_quest_chain(name_or_id)` | A quest's whole chain, start to end (prerequisites, follow-ups, breadcrumbs; up to 40 quests), in order, each step marked done, held, available, locked (and why: prerequisites, level, race or class) or closed (you took the exclusive alternative or its follow-up, or passed its breadcrumb by), from your last `/reload`; the first step you can pick up now with where its giver stands, and the items the chain ends with (not when cut at 40) |
| `lookup_npc(name_or_id, limit = 3)` | NPC level range, `rank` (normal, elite, rare elite, rare, boss), `services` (vendor, repair, trainer...) and the side it is `friendly` to, zone, spawn coords per zone, quests started and ended, top drops, links |
| `lookup_spell(name_or_id, limit = 3)` | Spell name, rank, tooltip text, links |
| `lookup_reference(name_or_id, kind?, limit = 3)` | Races (faction, client prefix, the other faction's variant such as Forever's Skyborne), classes, factions and skills; `kind` is `race`, `class`, `faction` or `skill` |
| `list_goals(status = "active", char?)` | Your goals with progress, plus counts and the file path |
| `add_goal(text, kind = "note", target?, char?, due?)` | Save a goal (writes `goals.json` only) |
| `update_goal(id, status?, text?, target?, due?)` | Change or close a goal |
| `remove_goal(id)` | Delete a goal |
| `suggest_quests(zone?, limit?)` | Quests for your level in a zone (default: the current one; its subzones included, not dungeon entrances), a subzone or a dungeon (its entrance's quests too), excluding active and completed ones, those for another race, class or faction, those capped below your level (battleground bracket quests) and those whose prerequisites you have not completed or that a completed or held exclusive quest locks out (`locked` counts them); reads the KB and your snapshots |
| `recommend_zones(limit = 5)` | Where to quest next: every zone ranked by the quests it holds for your level, with the `suggest_quests` filters (quest log, completed, race, class, faction, level caps), repeatable quests left out, nearer levels weighing more, plus your quest-log turn-ins there; dungeons, raids and battlegrounds listed apart (up to 3). Quests whose prerequisites are not done are not counted; reads the KB and the latest saved character's snapshots |
| `find_service(service, zone?, subname?, limit = 5)` | The nearest vendor, repairer, flight master, trainer, innkeeper, banker, auctioneer or stable master in a zone (default: the current one) friendly to your faction, by distance from your map position (combat log or last `/reload`); `subname` narrows by title (`Warrior` trainer, `Gryphon` master); names other zones when there is none here |
| `plan_farm(item? \| goal_id?, limit = 5)` | Where to farm an item, or an item goal's item: the NPCs that drop it, per zone, hostile to your faction, ranked by drop chance, how many spawn there, and their mid level against yours (elites count less); then the latest play session's kills of those NPCs from the combat log (and how long ago it ended), the drops expected at the known chance, and how many you held at your last `/reload` (loot since is not counted) |
| `mute_events(minutes)` | Silence the [events](#events) for 0 to 240 minutes (0 unmutes); server memory only |
The eight tools from `search_wiki` to `lookup_reference` read the [knowledge base](#knowledge-base) and say
which `data pull` to run when it is missing. Names match fuzzily (word
prefixes and stems, an exact name first); digits look up an id. With the
KB present, `get_character` and `find_item` also return `kb_items`, the
KB names of the item ids they show.
There are also the resources `sylvanai://pull/{id}` and
`sylvanai://character/{key}`, and the prompts `coach_last_pull`, `review_session` (sum up a session or
run and the one thing to fix) and `review_goals`.
## Events
The MCP server can push game events into a running Claude Code session
(a one-way *channel*), so Claude posts a short note on your second
screen between pulls: a pull recap with one fix, a death recap, what is
worth doing in a new area, and so on. It never speaks during a fight.
Channels are a Claude Code research preview (v2.1.80 or later).
Start Claude Code with the development channel flag (interactive mode
only):
```bash
claude --dangerously-load-development-channels server:sylvanai
```
Claude Code shows a warning dialog because this is a custom channel;
accept it. Without the flag, or when your organization blocks channels,
the events are dropped silently and the tools still work. Team and
Enterprise organizations must enable channels first.
| Event | Fires when |
|---|---|
| `pull_end` | A pull closes and passes the fight filter: a boss on `ENCOUNTER_END`, with kill or wipe; trash once the daemon closes it. A trash pull that went on after its note gets one `Pull N continued: now D s.` line |
| `death` | You die. A death in a pull waits for that pull's `pull_end` (`idle_gap_s` + `flush_lag_s` + 2 min, at most 9 min) and is folded into it; it goes alone when that pull gets no note. A death outside any pull names the zone instead of a pull |
| `area` | You enter a zone or map and stay there 1 min, and the area setting allows it; zones only passed through (a flight) and the continent map get no note. With the knowledge base and a quests snapshot it names the quest-log quests ready to turn in there |
| `dungeon_enter` / `dungeon_leave` | You enter or leave an instance; the leave waits until you have been out 5 min or enter another instance, so a corpse run or a quick hearth-back resumes the run. It names the bosses killed or wiped and the bosses you died on; its pull count skips trash shorter than `min_pull_s`. An active dungeon goal for that instance, made before you left and shared or of the current character, is named, and Claude asks before marking it done (dungeon goals never turn met by themselves). Its hint points at `get_session(run=...)` for the run's details |
| `level_up` | A newer `basics` snapshot shows a higher level; says how many talent points are unspent when known and saved at the new level (meta `talent_points`) and points at `get_talent_summary` for the nearest class trainer, `recommend_zones` for where to quest next and `get_class_kit` for what the new ranks do after training and a `/reload` |
| `gear` | A newer `gear` snapshot changes equipped items (each changed slot is listed) |
| `skill` | A newer `skills` snapshot shows a profession or secondary skill (cooking, first aid, fishing) skilled up to a trainer cap (75, 150, 225): train the next tier or skill-ups are wasted. Also an equipped weapon whose skill is 10 or more below its max (5 x level), once until it catches up, even across weapon swaps (needs the knowledge base for weapon types). The ranged slot counts for hunters, mages, priests and warlocks only; a character's first snapshot after startup records lags without a note |
| `xp_drift` | Your last `xp_drift_pulls` open-world trash pulls in a row in one zone were all on grey mobs (no XP at your level, Classic formula): Claude suggests a zone at your level (`recommend_zones`). Once per zone per `area_cooldown_min` |
| `goal_met` | An active goal's progress turns met |
| `screenshot` | You take a screenshot with the WoW screenshot key: Claude looks at it (`get_screenshot`, `center` region) and comments. Turn off with `screenshots = false` |
Each event costs Claude one turn (tokens). Events that arrive while
Claude is busy queue and show up together on its next turn.
Settings live in the `[channel]` table of `config.toml`. A bad value
turns events off (logged to stderr) and the tools keep working.
| Key | Values | Default |
|---|---|---|
| `enabled` | `true`, `false` | `true` |
| `fights` | `all`, `dungeon`, `boss`, `off` | `all` |
| `min_pull_s` | seconds of the closed pull (not applied to bosses) | `10` |
| `notable` | `true`, `false`: shorter trash on a rare or named NPC is still announced (needs the knowledge base) | `true` |
| `deaths` | `true`, `false` | `true` |
| `areas` | `first_visit`, `always`, `off` | `first_visit` |
| `area_cooldown_min` | minutes | `60` |
| `dungeons` | `true`, `false` (enter and leave) | `true` |
| `goals`, `level_up`, `gear`, `skills`, `xp_drift` | `true`, `false` each | `true` |
| `xp_drift_pulls` | grey pulls in a row before an `xp_drift` note (whole number, at least 1) | `5` |
| `screenshots` | `true`, `false` | `true` |
| `min_gap_s` | seconds between pushes; events inside the gap are merged into one note | `30` |
| `poll_s` | seconds between database checks | `2` |
Things to know:
- The `boss` filter and the kill or wipe rely on `ENCOUNTER_START/END`.
Forever logs them in 5-player dungeons (8 of 8 pairs in a Shadowfang
Keep run).
- A pull is announced only once it is over, with its final length:
a boss right after `ENCOUNTER_END` (kill or wipe), a trash pull when
the daemon closes it, about a minute after its last hit (see
[The log runs late](#the-log-runs-late)). Trash shorter than
`min_pull_s` is skipped, unless `notable` lets it through (below).
- `notable` only lifts `min_pull_s`; the `fights` filter still applies.
A short trash pull is announced as `Pull N ended: <NPC> (<label>),
D s.` when the group dealt most of the damage one NPC in it took and
the knowledge base (QuestieDB rank and spawns) calls it notable: rare
or rare elite anywhere; outside instances also elite (or boss), or
`named`, a rank-less NPC with a single spawn point in that zone
(Jailor Marlgen). Every enemy hit counts, not only the pull's name.
Summons, NPCs without spawn points and a stranger's kill (the group
dealt half the damage or less, counting what the NPC took from anyone
up to 5 min before the pull) never count. Every dungeon mob is elite,
so inside only rares count. Without the knowledge base nothing changes.
- The area note reads the quest log when it goes out, from the latest
quests snapshot: `Turn in here: The Book of Ur (Keeper Bel'dugur).`
(at most 3 names, then `+N more`), with `(as of /reload Xm ago)` when
that snapshot was saved before you arrived.
- The addon saves snapshots only on `/reload` or logout, so `level_up`,
`gear`, `skill` and `goal_met` (for snapshot-based goals) arrive then,
not the moment they happen.
- `skill` is enUS-only: the addon writes skill kinds from enUS skill
window headers, and weapon skills match by the knowledge base's enUS
skill names. On other client languages secondary skills read as
`other` and get no cap note, and weapons get no lag note. A tier
learned already at its cap (riding) is no news.
- `xp_drift` compares the mobs' levels with your level from the latest
`basics` snapshot of the pull's character (it lags until `/reload`, so
it errs towards no note). Mob levels come from the advanced block;
without advanced logging, from the knowledge base's top level for the
NPC. Every closed trash pull outside instances counts, short ones
too, except summons and a stranger's kill. A boss, an instance pull or
a pull with a mob that gives XP breaks the streak; a pull whose levels
are unknown is skipped. No note at the level cap (`xp_max` 0).
- The combat hold is best effort. The server treats you as in combat
while a boss encounter is open (the client holds a boss fight's lines
back; at most 15 min from its start, in case `ENCOUNTER_END` never
comes) or while your combat activity in the log is newer than
`idle_gap_s`, and sends held events once you are out. The log itself
flushes late outside raids, so after trash "quiet" can come early and
a note may land just after the next pull starts.
- When the client holds back a fight's lines for longer than
`idle_gap_s` + `flush_lag_s` (68 s), the daemon closes the pull at its
last line on disk, so its note can go out mid-fight with a short
length. When the lines arrive, the pull grows (it is not split) and
one `Pull N continued: now D s.` line follows once its end stays put
for a poll with no combat since, with a death in it folded in; a pull
first skipped as too short gets its `pull_end` then. Notes are not
held back further: a short hold only helps stalls a few seconds past
68 s, while stalls seen in play also last minutes. A second long stall
in the same fight can still make that update short (it comes once).
- Until the log moves past such a pull's idle gap (at most 10 min after
its end), `list_pulls`, `get_pull_summary` and `get_death_recap` mark
it `provisional: true`: late lines may still lengthen it or add a
death, so an empty `deaths` there does not yet mean you survived.
- Hints name real tool calls with keyword arguments, e.g.
`get_pull_summary(pull_id=12)`. A note for one event also carries
string meta: `kind`, `count`, and as relevant `pull_id`, `pull_kind`,
`instance`, `deaths`, `notable` (its label), `continued`, `pulls` (a
merged chain of pulls), `zone_segment_id` (a death outside a pull),
`zone`, `map_id`, `instance_id`, `items` / `old_items` (gear ids now
and before, empty slots left out: they do not pair by position),
`level`, `skill`, `rank`, `max_rank`, `item` (the lagging weapon's
id), `mob_levels` and `streak` (grey pulls in a row), or `id` (a
screenshot or goal).
- Events start from "now": nothing is replayed at startup, and events
whose log time is more than 10 minutes behind the clock are dropped.
- Ask Claude to mute events for a while (`mute_events`, up to 240
minutes). Events during a mute are dropped and counted once on unmute.
- Notes are not stored. To catch up on what you missed (Claude was closed,
or you use Claude Desktop, which has no channel), ask for a review:
`get_session` rebuilds a session or dungeon run from the database.
## Personal goals
Tell Claude what you are working toward and it keeps the list:
"I want to reach 150 skinning", "let's do Shadowfang Keep", "I need to
loot 10 Linen Cloth", "get me to level 30". It checks the list at the
start of a session, and the `review_goals` prompt gives a progress
summary.
Progress is automatic where the addon snapshots hold the answer: skill
rank, level, item counts and reputation standing. Snapshots are taken
out of combat and saved to disk on `/reload` or logout, so `/reload` for
a fresh reading. Dungeon goals only show visits since you set the goal;
tell Claude when you are done and it marks the goal. Notes carry no
progress.
Goals live in `goals.json` next to the database. Move it with
`goals_path` in the config TOML, `--goals` on `sylvanai-mcp`, or
`SYLVANAI_GOALS` (flag, then env, then config). It is plain JSON you may
edit by hand. A file that does not parse is never overwritten. Each MCP
server session copies the file, as it was before that session's first
change, to `goals.json.bak`. Running in a sandbox or
container? Point `goals_path` at a path on the host drive so the goals
outlive it.
## Knowledge base
Optional offline reference data that Claude can look up between pulls:
items, spells and zones from the game's tables, quests, NPCs, objects
and drops from QuestieDB, and a Warcraft Wiki snapshot. You download it
once with an explicit command. `data pull` is the only command that uses
the network: the daemon's `run` loop and the MCP server never go online
(they do not even load the download code), and the MCP tools only read
the local copy. `data pull` only contacts wago.tools, GitHub's API and
codeload (QuestieDB) and archive.org; any other host, redirects
included, is refused.
```bash
uv run sylvanai-daemon data pull wago # or questie, wiki, all
uv run sylvanai-daemon data pull wago --version 1.60.1.70938 # pin a build
uv run sylvanai-daemon data rebuild # recreate the KB from the cache, offline
uv run sylvanai-daemon data pull all --check # ask for the latest versions; no download
uv run sylvanai-daemon data status # versions and staleness, offline
uv run sylvanai-daemon data list # sources, licenses, cached versions
```
| Source | What | From | Download | KB size | Build |
|---|---|---|---|---|---|
| `wago` | Items, spells, races, classes, zones (AreaTable, UiMap), factions, skills | CSV exports from [wago.tools](https://wago.tools) (`/db2/<table>/csv`, `/api/builds/wowf/latest`), one pinned build | about 10 MB | about 12 MB | seconds |
| `questie` | Quests, NPCs, objects, spawns, item drops | [QuestieDB](https://github.com/Questie/QuestieDB) at a pinned commit, Forever flavor only | about 19 MB kept | about 30 MB | about 15 s |
| `wiki` | Lore, mechanics, strategy pages | Warcraft Wiki WikiTeam dump on archive.org (2023-11-13) | 637 MiB (about 8.5 min at 1.25 MB/s) | about 400 MB | 11 to 18 min (about 27 CPU-minutes), about 2.8 GB of memory in all (main process about 2.3 GB) |
Details per source:
- `wago`: `--version` takes a full dotted build such as `1.60.1.70938`;
without it, `data pull` asks wago.tools for the latest Forever build
(a re-pull of a cached build downloads no tables). About 40% of
Forever items have no ItemSparse row in the client export: they keep
class and slot but have no name, quality, level or stats there.
`lookup_item` then takes the name, and the item and required levels
when QuestieDB has them, from QuestieDB and says so.
- `questie`: `--version` takes a commit SHA (default: the latest commit
on master); a cached commit is not downloaded again. The build applies
QuestieDB's Forever layers in their own order (raw base, legacy
corrections, generated delta-base, traces, authored fixes). It does
not apply faction- or class-dependent corrections, derived passes or
manual drop corrections, so the KB shows a faction-neutral view.
Spawn coordinates are map percent (0-100), like `/way`.
- `wiki`: the dump is downloaded in 64 MiB ranges (an interrupted pull
resumes) and checked against archive.org's md5/sha1. Only the latest
revision of each main-namespace page is kept, as plain text with
`## ` headings. The text predates WoW: Forever. The build reads about
35 GiB of decompressed XML twice; the dump needs a 2 GiB zstd window.
A dump with a DOCTYPE (entity declarations) is refused.
Everything lives in `kb_dir` (default `<data dir>/kb`, next to the
database), never in the repo:
- `raw/<source>/<version>/`: the downloaded files and a `manifest.json`
with the source, URL, version (build or commit), license, sha256,
size and download time of each file.
- `raw/<source>/_pin.json`: the version `data pull` last built.
`data rebuild` rebuilds that version while it is cached (else the
latest download), so pinning an older build sticks.
- `raw/<source>/_remote.json`: the latest version the source offered
when `data pull` (or `data pull --check`) last asked, and when.
- `kb.sqlite3`: the tables and full-text indexes, built from `raw/`.
`data rebuild` recreates it from the cache alone, so you can delete it
at any time. After an upgrade that changes the KB schema, the MCP
tools ask for a `data rebuild`. The schema v4 upgrade (NPC rank, item
levels) and v5 (NPC services and faction) drop the QuestieDB build, so run
`sylvanai-daemon data rebuild questie` (offline, from the cache, about
15 s); a plain `data rebuild` also rebuilds the wiki (minutes). v6
(item vendors and buy prices) also drops the game tables: run
`sylvanai-daemon data rebuild wago` and `data rebuild questie`.
`data pull` downloads and then builds. `data pull <source> --check` only
asks the source for its latest version (no download, no build) and
records it. `data status` is offline: it reports the cached, selected
(pinned) and built versions, `rebuild_needed` when the KB lags the
cache, and `behind` when the selected version lags the latest version
recorded at the last pull or check (`remote_checked_at` says how old
that is).
### Licenses and attribution
| Source | License |
|---|---|
| `wago` | Blizzard Entertainment game data; personal local use only |
| `questie` | QuestieDB: GPLv3 for forks, otherwise all rights reserved; private local use only |
| `wiki` | CC BY-SA 4.0, Warcraft Wiki contributors ([warcraft.wiki.gg](https://warcraft.wiki.gg)) |
Wiki results carry `license`, `credit`, `snapshot` and the page's
warcraft.wiki.gg `url`; credit the contributors and link the page when
you quote it. Lookups also return Wowhead (Forever) and wiki links for
you to open. sylvanai builds them from ids and names and never fetches
them (`wiki_guess` marks a link to a page the snapshot does not have).
### Terms decision
Game tables come only from wago.tools exports. sylvanai never reads the
game's own data files (CASC/DB2, DBCache or hotfix caches), which the
EULA's data-mining clause covers. It never crawls or calls
warcraft.wiki.gg, Wowhead or Fandom; the downloader refuses those
hosts, and their content arrives only through the archived wiki dump.
Imported data stays on your machine and is never redistributed: `kb/`
is gitignored and the tests use hand-written synthetic rows.
## Screenshots and privacy
- Sylvanai never captures the screen. The only images are the ones you
take with the WoW screenshot key, saved by the game in
`<flavor>/Screenshots/`.
- Screenshots stay on disk. An image goes to Claude only when a tool
call asks for it. With the `screenshot` event on (the default), each
new screenshot prompts Claude to look at it: press the key when you
want a comment, or set `screenshots = false` in `[channel]`.
- The default region is `center`: the middle 50% of the width and the
band from 10% to 70% of the height. That leaves out the chat box, party
frames, minimap and action bars. Nameplates over characters can still
be in view. `full` and `bottom` include chat, so use `full`, `left`,
`right` and `bottom` only when you mean to.
### Cost per image
Claude bills about one token per 28x28 px tile
(`ceil(w/28) * ceil(h/28)`). The `est_tokens` field in the tool result
holds this estimate. Images are scaled down so the long edge is at most
`max_edge` (256 to 2576, default 1568); they are never scaled up.
| Screen | `center`, 1568 | `center`, 1024 | `center`, 512 | `full`, 1568 | `full`, 1024 |
|---|---|---|---|---|---|
| 1920x1080 | 960x648, ~840 | 960x648, ~840 | 512x346, ~247 | 1568x882, ~1792 | 1024x576, ~777 |
| 2560x1440 | 1280x864, ~1426 | 1024x691, ~925 | 512x346, ~247 | 1568x882, ~1792 | 1024x576, ~777 |
| 3840x2160 | 1568x1058, ~2128 | 1024x691, ~925 | 512x346, ~247 | 1568x882, ~1792 | 1024x576, ~777 |
| 3456x2234 (MacBook Pro 16") | 1568x1217, ~2464 | 1024x795, ~1073 | 512x397, ~285 | 1568x1014, ~2072 | 1024x662, ~888 |
The center crop is there for privacy, not cost. On a 4K screen it costs
more than a downscaled full frame, so lower `max_edge` to save tokens.
The text tools cost far less than any image, so ask for an image only
for spatial or UI questions.
## The log runs late
The client buffers the combat log. Outside raids it may flush only
after enough events have built up, so the file can be seconds to
minutes behind the game. In practice:
- `get_status` reports `lag_s`, the seconds since the last logged event.
Check it before you trust "last pull". If it is off by whole hours,
`log_tz` does not match the game machine's zone (see the config file).
When `lag_s` passes 300 s and you took a screenshot or `/reload`ed
more than a minute after the last event and within the last 5
minutes, it adds `log_quiet: true` and a hint to check `/combatlog`.
This is only a status field, never an event: a quiet log alone is
normal outside combat, and so is one after you log off.
- A trash pull is your (or your group's) fight with outsiders: your
damage, misses and hostile casts on them keep it going, and so does
an enemy still meleeing you. Enemy spell, DoT or fall damage alone
does not, so a burn ticking while you eat is not a new pull. A pull
starts at the enemy's first hit if it hit you first, and ends at the
last death it caused or suffered when that comes after the last hit.
- Boss pulls close on `ENCOUNTER_END`. A trash pull closes after
`idle_gap_s` (8 s) of log-time quiet, plus another `flush_lag_s`
(60 s) of wall-clock time, so a late flush does not split it in two.
A trash pull can therefore take about a minute to show up as finished.
- `get_recent_combat(window_s)` counts back in log time, not wall time.
- Addon snapshots appear only after `/reload` or logout; see
[Freshness](#freshness).
- After a `/reload`, the client writes a new header partway through the
same file. The daemon handles this.
## Development
```bash
uv run ruff check . && uv run ruff format --check . && uv run gawain check . && uv run deptry . && uv run pytest -q && busted addon/spec
```
This is a local-only project with no CI. The spec and the layering rules
are in [AGENTS.md](AGENTS.md). Work is tracked in beads (`bd ready`).
The test fixtures are mostly synthetic. To replace them with real
captures, see [docs/fixture-capture.md](docs/fixture-capture.md). The
verified log format is in
[docs/combat-log-format.md](docs/combat-log-format.md).
TDQS
Scored across 35 tools
Most tools target a clearly distinct resource or action (list_pulls vs get_pull_summary vs get_damage_taken vs get_aggro are separated by scope and intent), and the very detailed descriptions reinforce the boundaries. A few overlaps remain: get_status and get_character both return the identical 'live' combat-log state block, and lookup_item's drop sources overlap with plan_farm's scoring of the same sources, which could cause misselection.
All names are snake_case verb_noun (get_*, list_*, lookup_*, suggest_*, recommend_*, add/update/remove_goal), so the pattern is predictable. The minor wrinkle is the mix of get_/find_/lookup_ for retrieval, where find_ vs lookup_ inconsistently signals 'your snapshots' vs 'game data' (find_service actually queries QuestieDB).
35 tools is heavy for an agent to navigate and sits well above the comfortable 3-15 range. The breadth is partly justified (combat-log analytics, wiki, game-data lookups, quest guidance, goals, screenshots are genuinely separate sub-domains), but consolidation is clearly possible (e.g. the five lookup_* tools, the pull-analysis cluster).
Coverage is strong: goals have full CRUD, pull analysis spans summary/details/damage-taken/aggro/deaths/compare/session/mob-stats, and questing has lookup, chain, suggestion and zone ranking. Gaps are minor: config is read-only (no way to edit or reload), and there is no explicit gear/upgrade comparison or inventory-management operation beyond find_item.