文档搜索服务器

一个MCP服务器,为AI工具提供对HytaleModding.dev文档的访问,支持文档搜索和内容获取功能。

  • by jmrapp1
  • TypeScript
  • 本地部署
  • 2 星标
  • 更新于
在 GitHub 查看 jmrapp1/HytaleModding.dev-MCP-Server

使用说明

HytaleModding.dev MCP服务器

MCP(模型上下文协议)服务器,为AI工具提供访问 HytaleModding.dev文档。在本地运行它,并将其连接到Claude Desktop、Cursor、Windsurf或任何兼容MCP的客户端。

观看Claude如何使用它构建用户界面: HytaleModding MCP服务器演示

工具

search_docs

搜索文档索引。返回按页面分组的匹配页面和部分,包括URL和面包屑路径。

参数 类型 必填 默认 说明
query string yes 搜索查询文本
locale string 否 "en" 区域代码
limit 编号 否 10 限制返回的页数

get_doc

获取文档页面的完整内容,将其从HTML转换为可读文本。

参数 类型 必填 说明
path string yes 页面路径,例如。 /en/docs/official-documentation/custom-ui/markup

先决条件

  • Node.js 18+
  • npm

设置

npm install
npm run build

运行服务器

MCP服务器使用JSON-RPC通过stdio(stdin/stdout)进行通信,这就是MCP客户端启动和与之通信的方式,因此 不需要有一个永远运行的服务器。AI客户端将直接触发针对 dist/index.js 文件(参考 转到手动测试部分)。

客户端配置

克劳德桌面版

添加到您的 claude_desktop_config.json:

a

光标

首选 光标设置>工具和集成>MCP工具 并添加:

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

帆板运动

打开 命令面板>Windsurf MCP配置面板 并添加与上述相同的JSON块。

克劳德代码

从任何目录运行此命令:

claude mcp add hytalemodding-docs node /absolute/path/to/hytalemodding-mcp-server/dist/index.js

发展

监视模式在文件更改时重新编译:

npm run dev

手动测试

您可以通过stdio将JSON-RPC消息传输到服务器进行测试:

# Initialize and list tools
printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}\n{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}\n' | node dist/index.js 2>/dev/null

# Search for documentation
printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}\n{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"search_docs","arguments":{"query":"NPC template"}}}\n' | node dist/index.js 2>/dev/null

# Fetch a specific doc page
printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}\n{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_doc","arguments":{"path":"/en/docs/quick-start"}}}\n' | node dist/index.js 2>/dev/null