Back to MCP directory
publicPublicdnsLocal runtime

mcp-script-runner

MCP脚本运行器是一个本地脚本管理工具,通过配置JSON文件和添加脚本文件来快速运行自定义命令。

article

README

🚀 MCP 脚本运行器

MCP 脚本运行器是一个用于运行脚本的工具,通过简单配置即可快速启动脚本,支持多种环境设置和工具添加。

🚀 快速开始

🔧 先决条件

  • python: 例如 mise install python@3.13 && mise use python@3.13 -g
  • uv: 例如 brew install uv

⚙️ 配置

克隆项目仓库:

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

并在 mcp 配置中添加 mcp.json,如下所示:

{
  "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。
  • 执行权限对于文件是必需的(尽管有一个调整权限的过程)。
  • 这仅适用于本地使用,并且只有您理解的脚本才应放置在此处。
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client