OSRS MCP 服务器
MCP 服务器用于与 Old School RuneScape (OSRS) Wiki API 和数据文件交互。该服务器提供搜索 OSRS Wiki 和通过模型上下文协议 (MCP) 访问游戏数据定义的工具。
工具
该服务器实现了以下工具:
OSRS Wiki 方法
osrs_wiki_search
- 在 OSRS Wiki 中搜索与搜索词匹配的页面osrs_wiki_get_page_info
- 获取有关 OSRS Wiki 上特定页面的信息osrs_wiki_parse_page
- 获取特定 OSRS Wiki 页面的已解析 HTML 内容
游戏数据搜索方法
search_varptypes
- 在 varptypes.txt 文件中搜索存储玩家状态和进度的玩家变量 (varps)search_varbittypes
- 在 varbittypes.txt 文件中搜索存储 varps 中各个位的变量位 (varbits)search_iftypes
- 在 iftypes.txt 文件中搜索游戏 UI 中使用的接口定义search_invtypes
- 在 invtypes.txt 文件中搜索游戏中的库存类型定义search_loctypes
- 在 loctypes.txt 文件中搜索游戏世界中的位置/对象类型定义search_npctypes
- 在 npctypes.txt 文件中搜索 NPC(非玩家角色)定义search_objtypes
- 在 objtypes.txt 文件中搜索游戏中的对象/物品定义search_rowtypes
- 在 rowtypes.txt 文件中搜索各种接口中使用的行定义search_seqtypes
- 在 seqtypes.txt 文件中搜索动画序列定义search_soundtypes
- 在 soundtypes.txt 文件中搜索游戏中的音效定义search_spottypes
- 在 spottypes.txt 文件中搜索点动画(图形效果)定义search_spritetypes
- 在 spritetypes.txt 文件中搜索界面中使用的精灵图像定义search_tabletypes
- 在 tabletypes.txt 文件中搜索接口选项卡定义
通用数据文件方法
search_data_file
- 在数据目录中的任何文件中搜索匹配的条目get_file_details
- 获取数据目录中文件的详细信息list_data_files
- 列出数据目录中可用的数据文件
安装
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 mcp-osrs:
npx @smithery/cli@latest install @jayarrowz/mcp-osrs --client claude
先决条件
- Node.js(v16 或更高版本)
- npm 或 yarn
安装包
# Clone the repository
git clone https://github.com/jayarrowz/mcp-osrs.git
cd mcp-osrs
# Install dependencies
npm install
# Build the package
npm run build
与 Claude Desktop 一起使用
将以下内容添加到您的claude_desktop_config.json
中:
使用 npx
{
"mcpServers": {
"osrs": {
"command": "npx",
"args": ["-y", "@jayarrowz/mcp-osrs"]
}
}
}
直接 Node.js
{
"mcpServers": {
"osrs": {
"command": "node",
"args": ["/path/to/mcp-osrs/dist/index.js"]
}
}
}
将/path/to/mcp-osrs
替换为您的存储库的实际路径。
示例
搜索 OSRS Wiki
// Search for information about the Abyssal whip
const result = await callTool("osrs_wiki_search", {
search: "Abyssal whip"
});
获取页面信息
// Get information about a specific wiki page
const pageInfo = await callTool("osrs_wiki_get_page_info", {
titles: "Abyssal_whip"
});
搜索游戏数据
// Search for items in the object definitions
const items = await callTool("search_objtypes", {
query: "dragon",
page: 1,
pageSize: 10
});
列出可用的数据文件
// Get a list of all data files
const files = await callTool("list_data_files", {});
发展
# Install dependencies
npm install
# Start the server in development mode
npm start
# Build the server
npm run build
执照
此 MCP 服务器采用 MIT 许可证。这意味着您可以自由使用、修改和分发该软件,但须遵守 MIT 许可证的条款和条件。更多详情,请参阅项目仓库中的 LICENSE 文件。