c

chromewillow

@chromewillow/greyhack-mcp-server
0 Stars 344 次浏览 chromewillow 更新于 2026-08-23

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "@greyhack-mcp-server": {
      "args": [
        "-y",
        "@smithery/cli@latest",
        "run",
        "@chromewillow/greyhack-mcp-server",
        "--config",
        "{GITHUB_TOKEN:your-github-token-here}"
      ],
      "command": "npx"
    }
  }
}

服务介绍

Grey Hack MCP 服务器

一个为 Grey Hack 游戏开发设计的 Model Context Protocol (MCP) 服务器,旨在与 Cursor IDE 和其他兼容 MCP 的工具一起使用。

功能

  • GitHub 代码搜索:从 GitHub 仓库中查找 Grey Hack 代码示例
  • Greybel-JS 转译:将 GreyScript 转换为 JavaScript
  • GreyScript API 验证:根据官方 Grey Hack API 验证代码
  • 脚本生成:为常见的游戏任务生成模板脚本

安装

前提条件

  • 已安装 Node.js 18+
  • Cursor IDE 或其他兼容 MCP 的编辑器
  • GitHub API 令牌(用于代码搜索功能)

通过 NPM 安装

bash
npm install -g @chromewillow/greyhack-mcp-server

手动安装

克隆仓库并安装依赖项:

bash
git clone https://github.com/chromewillow/greyhack-mcp-server.git
cd greyhack-mcp-server
npm install
npm run build

与 Cursor IDE 一起使用

使用配置文件

在工作区中创建一个 .cursor/mcp.json 文件,并包含以下内容:

json
{
"mcpServers": {
"@greyhack-mcp-server": {
"command": "npx",
"args": [
"-y",
"@smithery/cli@latest",
"run",
"@chromewillow/greyhack-mcp-server",
"--config",
"{"GITHUB_TOKEN":"your-github-token-here"}"
]
}
}
}

在 Cursor 中手动配置

  1. 打开 Cursor 设置 (Cmd/Ctrl + ,)
  2. 导航到 Features → MCP
  3. 点击 "+ 添加新的 MCP 服务器"
  4. 输入以下详细信息:
    • 名称: greyhack-mcp-server
    • 命令: npx
    • 参数: -y @smithery/cli@latest run @chromewillow/greyhack-mcp-server
    • 环境变量: GITHUB_TOKEN=your-github-token-here

可用工具

1. GitHub 代码搜索

在 GitHub 上搜索 Grey Hack 代码示例:

使用 search_greyhack_code 工具来查找 Grey Hack 中端口扫描器的示例

2. Greybel-JS 转译

将 GreyScript 代码转换为 JavaScript:

使用 transpile_greyscript 工具将以下 Grey Hack 代码转换为 JavaScript:
get_shell.host_computer.File("/home/user/test.txt")

3. GreyScript API 验证

根据 Grey Hack API 验证您的代码:

使用 validate_greyscript 工具检查此代码是否在 Grey Hack 0.8.0 中有效:
router = get_router
ip = router.local_ip

4. 脚本生成

为常见的游戏任务生成模板脚本:

使用 generate_greyhack_script 工具为 Grey Hack 0.8.0 创建一个端口扫描器

可用脚本类型:

  • port_scanner:网络端口扫描工具
  • password_cracker:密码破解工具
  • file_browser:文件浏览和操作工具
  • ssh_tool:SSH 连接工具
  • custom:自定义脚本模板(需要描述)

开发

从源码构建

bash
npm run build

以开发模式运行

bash
npm run dev

许可证

MIT

致谢

该项目使用了:

  • Model Context Protocol TypeScript SDK
  • Smithery GitHub Client
  • Axios for HTTP requests

相关 MCP 服务