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。
- 文件需要执行权限(尽管其中包含调整权限的过程)。
- 这仅供本地使用,只有您理解的脚本才应该放在这里。
