脚本运行工具

MCP Script Runner是一个本地脚本运行工具,用于管理和执行自定义脚本,支持环境变量配置和权限管理。

  • by ktrysmt
  • Python
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 ktrysmt/mcp-script-runner

使用说明

MCP脚本运行程序

先决条件

  • python:例如。 mise install python@3.13 && mise use python@3.13 -g
  • 紫外线:例如。 brew install uv

配置

git clone https://github.com/ktrysmt/mcp-script-runner
cd ./mcp-script-runner
uv sync

并添加 mcp.json 到你的mcp配置如下:

{
  "mcpServers": {
    "mcp-script-runner": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/mcp-script-runner",
        "run",
        "main.py"
      ]
    }
  }
}

更改命令目录:

{
  "mcpServers": {
    "mcp-script-runner": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/mcp-script-runner",
        "run",
        "main.py"
      ],
      "env": {
        "COMMAND_DIRECTORY": "/path/to/your/dir"
      }
    }
  }
}

使用dotenv:

cd ./mcp-script-runner
$EDITOR .env

添加工具

cd ./mcp-script-runner
$EDITOR ./commands/command_name.sh

并重新加载mcp。

注意事项

  • 由于文件是直接执行的,所以不要忘记在每个文件中包含shebang。
  • 文件需要执行权限(尽管其中包含调整权限的过程)。
  • 这仅供本地使用,只有您理解的脚本才应该放在这里。