Skip to content

Repository files navigation

tibiawiki-data

A snapshot of TibiaWiki as one SQLite file, published to npm as @tibia.sh/tibiawiki-data. It is the index that @tibia.sh/tibiawiki-mcp serves to MCP clients.

You rarely install it yourself. The server depends on it, so installing the server brings the index with it. To ask questions over the data without installing anything, add the hosted server https://mcp.tibia.sh/wiki to your MCP client.

What is inside

index.db is about 18 MB and holds the wiki's structured data. Some of it:

Table Rows
item 9,800
creature 2,193
npc 1,245
book 1,226
house 1,090
achievement 571
quest 370
spell 211

The counts are from the 3.0.3 snapshot. The tables come from tibia.sh's copy of tibiawiki-sql, which generates the file. The server adds a few more for its own queries. The copy is based on tibiawiki-sql by Allan Galarza, the original project. Images are not included, only links to them.

Use

npm install @tibia.sh/tibiawiki-data

The example needs Node 22.13 or later, for node:sqlite.

import { DatabaseSync } from 'node:sqlite';
import { DB_PATH, SCHEMA_VERSION } from '@tibia.sh/tibiawiki-data';

const db = new DatabaseSync(DB_PATH, { readOnly: true });
console.log(db.prepare('select title, hitpoints from creature where name = ?').get('Dragon Lord'));
  1. DB_PATH => the absolute path to index.db inside the installed package
  2. SCHEMA_VERSION => the version of the tables the server adds. It always equals this package's major version

Versions

The major version is the server's schema version, which is why the first release was 3.0.0. A server that reads schema 3 depends on ^3, so npm never installs an index it cannot read. Every release within a major is a newer snapshot. The tables the server adds keep their shape within a major. The rest come from the generator, and version in database_info says which release of it wrote them. From 3.1.0 that is a release of tibia.sh's copy, listed on its releases page. Earlier releases say 9.0.0, the upstream release.

A snapshot says when it was taken. generate_time in the database_info table is the moment the wiki was read, and version there is the generator version that read it:

db.prepare("select key, value from database_info where key in ('version', 'generate_time')").all();

The releases page says what each snapshot holds: those two values, and how the row counts moved since the release before it.

How it stays current

A workflow rebuilds the index on Tuesdays and Fridays. When the wiki's content changed, it opens a pull request with the new index.db and merges it by itself once the checks pass. The merge publishes the next patch version to npm with a provenance attestation, and the hosted server picks the new version up by itself within minutes. A refresh that loses rows is held for a person instead.

The file you install is the file the pull request carried and its checks tested. It is committed to this repository, and a release packs it without rebuilding.

Contributing

Wrong or missing data belongs on TibiaWiki. Fix the wiki page and the next snapshot carries it. Problems with the package itself are welcome as issues here.

pnpm install --frozen-lockfile
pnpm test

docs/MAINTAINING.md covers how the index is built and tested, and docs/RELEASING.md covers publishing.

Licence

index.db is adapted from TibiaWiki (https://tibia.fandom.com), whose text is licensed CC BY-SA 3.0 Unported by TibiaWiki and its contributors, and it is released under the same licence. Tibia is made by CipSoft, and its game content is copyright CipSoft GmbH. From 3.1.0, the index is generated by tibia.sh's copy of tibiawiki-sql. Its releases page lists each release. That copy is based on tibiawiki-sql by Allan Galarza, the original project.

The JavaScript module in dist/ is MIT licensed. See LICENSE for both.

About

Prebuilt TibiaWiki SQLite index for @tibia.sh/tibiawiki-mcp. Major version tracks the server's schema.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages