An SDK and REST API wrapper for the Old School RuneScape Wiki providing structured access to wiki content via the MediaWiki API — with an MCP server for Claude Code integration.
Disclaimer: This SDK, REST API wrapper, and MCP server is an unofficial tool created for educational purposes only. It is not affiliated with, maintained, or endorsed by Jagex or the Old School RuneScape Wiki.
npm install @deansasek/osrs-wiki-apiThe SDK provides a typed, class-based interface organized by resource.
import { OSRSWikiClient } from '@deansasek/osrs-wiki-api/sdk';
const client = new OSRSWikiClient();
// Search
const results = await client.search.query({ query: 'dragon slayer' });
// Autocomplete
const suggestions = await client.search.autocomplete({ query: 'drag' });
// Fetch a wiki page
const page = await client.page.getPage('Dragon Slayer II');
// Plain-text intro
const extract = await client.page.getExtract('Abyssal whip');
// Render an image as ASCII art
const ascii = await client.page.renderImage('Abyssal whip', 64);| Resource | Methods |
|---|---|
client.search |
query(), autocomplete() |
client.page |
getPage(), getExtract(), getImageUrl(), renderImage() |
Flat function exports for direct API access.
import { search, autocomplete, getPage, getExtract, renderImage } from '@deansasek/osrs-wiki-api';Full-text wiki search with snippets.
const results = await search('dragon slayer', { limit: 10, offset: 0 });Fast autocomplete/typeahead suggestions.
const suggestions = await autocomplete('drag', { limit: 5 });Fetch a wiki page with full HTML, wikitext, categories, and links.
const page = await getPage('Dragon Slayer II');
// Returns: { pageid, title, html, wikitext, categories, links, images, timestamp }Fetch the plain-text intro of a wiki page.
const extract = await getExtract('Abyssal whip');
// Returns: "The abyssal whip is a level 70 melee weapon..."Render a wiki page's first image as ASCII art.
const ascii = await renderImage('Abyssal whip', 64);
// Returns:
// Abyssal whip
// ════════════════════════════════════════════════════════
// ░░▒▒▓▓████▒▒░░ ...| Function | Description |
|---|---|
createClient(options?) |
Create a custom client with options |
getImageUrl(filename) |
Resolve a raw image filename to its CDN URL |
The MCP server enables Claude Code to interact with the OSRS Wiki directly.
Claude Code automatically detects .mcp.json:
{
"mcpServers": {
"@deansasek/osrs-wiki-api-mcp": {
"command": "node",
"args": ["dist/mcp/server.js"]
}
}
}| Tool | Description |
|---|---|
osrs_search |
Full-text wiki search with snippets |
osrs_autocomplete |
Fast typeahead suggestions |
osrs_get_page |
Fetch a wiki page (HTML, wikitext, categories, links) |
osrs_get_extract |
Plain-text page intro |
osrs_render_image |
Render a wiki page image as ASCII art |
User: Search for dragon slayer quest on the OSRS wiki
Claude uses: osrs_search with query="dragon slayer"
User: What items are in the Fight Arena quest?
Claude uses: osrs_get_page with title="Fight Arena"
User: Give me a quick summary of the Kal'gerion demon
Claude uses: osrs_get_extract with title="Kalphite Queen"
User: Show me the Abyssal whip as ASCII art
Claude uses: osrs_render_image with title="Abyssal whip", width=64
npm run build # Compile TypeScript
npm run clean # Remove dist folder
npm run dev # Run server.ts directly
npm run mcp # Run MCP server directly- Node.js 18+ recommended
- TypeScript with strict mode
This project is dedicated to the public domain under the Unlicense.