osrs-mcp

osrs-mcp

Combines screen vision, RuneLite HTTP API, click coordinates, OSRS Wiki lookups, and Grand Exchange prices to give AI agents eyes and knowledge for playing Old School RuneScape. Enables game state analysis, skill tracking, item/NPC lookup, and interactive automation.

Category
访问服务器

README

osrs-mcp

MCP server for Old School RuneScape. Gives an AI agent eyes and knowledge for OSRS by combining:

  • Screen vision — captures the RuneLite window and uses Claude or a local vision LLM to analyze game state
  • RuneLite HTTP API — reads exact skill levels, inventory, and equipment directly from the game client (no vision needed)
  • Click coordinates — resolves pixel positions for inventory slots, sidebar tabs, and UI regions
  • OSRS Wiki — item, NPC, quest, and page lookups
  • Grand Exchange prices — real-time prices, history, and profit calculator
  • Skill training tools — XP calculations and items-to-level planning

Setup

cp .env.example .env
# Edit .env — set ANTHROPIC_API_KEY and optionally VISION_PROVIDER

npm install
npm run build

Vision provider

The vision tools support two backends, configured via .env:

Option A — Anthropic API (default)

ANTHROPIC_API_KEY=your-api-key-here

Option B — Local AI via LM Studio (or any Anthropic-compatible server)

Your local model must be vision/multimodal capable (e.g. qwen2-vl-7b-instruct, gemma-4, llava). Text-only models cannot analyze screenshots.

VISION_PROVIDER=local
LOCAL_AI_BASE_URL=http://localhost:1234
LOCAL_AI_API_KEY=lmstudio
LOCAL_AI_DETAIL_MODEL=your-vision-model-name
LOCAL_AI_FAST_MODEL=your-vision-model-name
LOCAL_AI_THINKING=0   # set to 1 if your model supports reasoning

RuneLite HTTP Server plugin

The get_stats, get_inventory, and get_equipment tools read live game data directly from RuneLite without using vision. To enable them:

  1. Open RuneLite → Plugin Hub → search HTTP Server → install and enable it
  2. The plugin exposes http://localhost:8080/stats, /inv, and /equip
  3. No extra configuration needed — the MCP connects on startup

These tools are more reliable and faster than their vision equivalents. Use them when you need ground-truth data (skill XP, exact item IDs, equipment slots).

macOS window capture

The screenshot tools use screencapture -l <CGWindowID> to capture just the RuneLite window. Window ID detection uses Swift + CGWindowListCopyWindowInfo — no extra tools required.

Fallback: If window ID detection fails, the full screen is captured. Vision analysis still works as long as RuneLite is visible.


Claude Desktop / Claude Code config

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "osrs": {
      "command": "node",
      "args": ["/absolute/path/to/osrs-mcp/dist/index.js"]
    }
  }
}

The server reads .env from the project root for ANTHROPIC_API_KEY / VISION_PROVIDER. You can also inline env vars in the config:

{
  "mcpServers": {
    "osrs": {
      "command": "node",
      "args": ["/absolute/path/to/osrs-mcp/dist/index.js"],
      "env": { "ANTHROPIC_API_KEY": "sk-..." }
    }
  }
}

Or with tsx for development (no build step needed):

{
  "mcpServers": {
    "osrs": {
      "command": "npx",
      "args": ["tsx", "/absolute/path/to/osrs-mcp/src/index.ts"]
    }
  }
}

Tools

RuneLite HTTP API

Requires the HTTP Server plugin running on port 8080. Faster and more reliable than vision for these reads.

Tool Description
get_stats All skill levels (base + boosted) and XP from /stats
get_inventory Inventory items — item ID, quantity, slot 0-27 — from /inv
get_equipment Equipped items by slot name (weapon, head, body…) from /equip

Screen capture

Tool Description
find_osrs_window Check if RuneLite is running and get its window ID
capture_screen Take a screenshot of the RuneLite window

Vision analysis

Uses Claude vision (Opus for detail, Haiku for fast reads). Falls back to local model if VISION_PROVIDER=local.

Tool Description
analyze_screen Analyze the screen with vision (focus: inventory / stats / chat / minimap / full / bank / shop / npc)
analyze_inventory List all items in the 28-slot inventory
read_chat Extract all visible chat messages
read_stats Read HP, Prayer, Run energy, Special attack from status bars
read_minimap Read compass bearing and nearby entity counts
get_game_state Full composite game state in one call
detect_dialog Read NPC dialog, option menus, or level-up popups
detect_combat_state Read combat indicators: XP drops, enemy HP bar, poison/venom, overhead prayers
detect_loot Identify ground items visible after a kill

Click coordinates

Returns pixel positions for UI elements. Layout is auto-detected from screenshot dimensions by default.

Tool Description
detect_layout Detect whether RuneLite is in fixed (765×503) or resizable mode
get_tab_coords Pixel coordinates to click a sidebar tab (prayer, inventory, skills, magic, combat_options, etc.)
inventory_slot_coords Pixel center of an inventory slot 0–27
get_clickable_regions Bounding boxes for major UI panels: minimap, inventory, chat box, compass
find_npc_on_screen Locate a named NPC in the current screenshot, returns {screen_x, screen_y, confidence}
find_object_on_screen Locate an interactable object (bank chest, tree, ladder…), returns {screen_x, screen_y, confidence}

Layout detection: fixed mode is identified by the exact dimensions 765×503 (or 1530×1006 on Retina). All other sizes are treated as resizable. Resizable coordinates are edge-anchored (inventory to bottom-right, chat to bottom-left) and computed from the actual captured dimensions.

Tab names (top row): combat_options · skills · quests · inventory · equipment · prayer · magic
Tab names (bottom row): clan_chat · friends · account_management · logout · settings · emotes · music

OSRS Wiki

Tool Description
wiki_search Search the OSRS wiki
wiki_page Get the intro/summary of a wiki page
wiki_item_info Item details (alch values, members, weight, GE limit, etc.)
wiki_npc_info NPC details (combat level, HP, attack styles, aggressive/poisonous)
wiki_quest_info Quest details (difficulty, length, members, requirements, rewards)

Grand Exchange

Tool Description
ge_price Current GE price by item name or ID
ge_price_history Price chart data (timestep: 5m / 1h / 6h / 24h)
ge_mapping Full item name→ID mapping, filterable by name substring
calculate_profit Flip profit calculator — applies 1% GE tax, returns per-item and total profit + ROI

Utilities

Tool Description
skill_xp_info XP required for a target level, or current level from an XP value
calc_items_to_level How many actions/items to reach a target level given XP per action

Development

npm run dev       # Run directly via tsx (no build needed)
npm run build     # Compile TypeScript → dist/
npm run inspect   # Interactive tool tester via MCP Inspector
npm test          # Run test suite (vitest)
npm run test:watch  # Watch mode

Related

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选