Grey Hack脚本开发服务器

用于Grey Hack游戏开发的MCP服务器,提供代码搜索、脚本转换、API验证和脚本生成功能。

  • by chromewillow
  • TypeScript
  • 本地部署
  • 2 星标
  • 更新于
在 GitHub 查看 chromewillow/greyhack-mcp-server

使用说明

灰色哈克MCP服务器

用于Grey Hack游戏开发的模型上下文协议(MCP)服务器,旨在与Cursor IDE和其他MCP兼容工具配合使用。

特性

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

安装

先决条件

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

从NPM安装

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

手动安装

克隆存储库并安装依赖项:

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

使用Cursor IDE

使用配置文件

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

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

光标中的手动配置

  1. 打开光标设置(Cmd/Ctrl+,)
  2. 导航到功能→ 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代码示例:

Use the search_greyhack_code tool to find examples of port scanners in Grey Hack

2.Greybel JS转换

将GreyScript代码转换为JavaScript:

Use the transpile_greyscript tool to convert this Grey Hack code to JavaScript:
get_shell.host_computer.File("/home/user/test.txt")

3.GreyScript API验证

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

Use the validate_greyscript tool to check if this code is valid in Grey Hack 0.8.0:
router = get_router
ip = router.local_ip

4.脚本生成

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

Use the generate_greyhack_script tool to create a port scanner for Grey Hack 0.8.0

可用脚本类型:

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

发展

从源头构建

npm run build

以开发模式运行

npm run dev

许可证

麻省理工学院

致谢

本项目使用:

  • 模型上下文协议TypeScript SDK
  • Smithery GitHub客户端
  • Axios用于HTTP请求