safe-runbook-mcp
safe-runbook-mcp
運用ランブックのためのポリシーゲート付きMCPサーバー。AIが既知のコマンドを検査・実行できるようにしつつ、無制限のシェルは与えません。
存在理由
AIエージェントは運用に有用ですが、ターミナルを渡すことは大きな信頼の判断です。このプロジェクトは、有用な部分(反復可能な診断とメンテナンス)を、小さくレビュー可能な境界内に保ちます:
AIクライアント → プラン検査 → ポリシーチェック → 任意の人間による承認 → 正確なコマンド
Related MCP server: AgentPay MCP Server
安全モデル
ランブックはバージョン管理されたJSONです。AIがコマンドを発明することはできません。
実行はデフォルトで無効です。
実行可能ファイルは明示的に許可リストに登録する必要があります。
変数は正規表現で検証され、完全なプロセス引数になります。
コマンドはrealpathで制限されたワークスペース内で
shell: falseで実行されます。変更・破壊的なプランには、MCPの外部で作成された短命のHMAC承認トークンが必要です。
トークンはランブックと正確なプランハッシュに紐付けられるため、入力が変わると無効になります。
プロセスには時間と出力の制限があり、宣言されたシークレットは編集されます。
MCPツールアノテーションもクライアント向けに提供されますが、サーバー側のチェックが引き続き権威です。
スタック
TypeScript 7、Node.js 22、MCP TypeScript SDK v2、Zod 4、Vitest 4、Biome 2、Docker、GitHub Actions。このプロジェクトはオープンソースで、有料のAPI依存はありません。
クイックスタート
npm install
npm run cli -- list
npm run cli -- plan docker-service-status --var service=api
npm test実行は明示的に有効化する必要があります:
RUNBOOK_EXECUTION_ENABLED=true npm run cli -- run disk-usage変更を伴うランブックの場合は、MCP接続の外部で承認を生成し、承認と実行に同じ変数を使用します:
export RUNBOOK_EXECUTION_ENABLED=true
export RUNBOOK_APPROVAL_SECRET='replace-with-a-long-random-secret'
TOKEN=$(npm run --silent cli -- approve restart-compose-service --var service=api)
npm run cli -- run restart-compose-service --var service=api --approval "$TOKEN"MCPクライアントに接続する
一度ビルドしてから、このstdioサーバーをMCP互換クライアントに追加します。パスはお使いのマシンの絶対パスに置き換えてください。
{
"mcpServers": {
"safe-runbooks": {
"command": "node",
"args": ["/absolute/path/safe-runbook-mcp/dist/server.js"],
"env": {
"RUNBOOK_DIRECTORY": "/absolute/path/safe-runbook-mcp/runbooks",
"RUNBOOK_WORKSPACE": "/workspace/to/manage",
"RUNBOOK_EXECUTION_ENABLED": "false"
}
}
}
}サーバーが公開するもの:
list_runbooks— 利用可能なランブックとリスクレベルを発見します。inspect_runbook— 変数を解決し、正確なプランとそのハッシュを返します。execute_runbook— ポリシーチェック後に、すでに定義されたプランを実行します。runbook://catalog— 読み取り専用のカタログリソース。
ログはstderrに出力されます。stdoutはMCP JSON-RPCトラフィック用に予約されているためです。
ランブックを追加する
runbooks/にJSONファイルを作成します:
{
"id": "service-status",
"title": "Inspect a service",
"description": "Read one Compose service state.",
"risk": "diagnostic",
"variables": {
"service": {
"description": "Compose service name",
"pattern": "[a-zA-Z0-9][a-zA-Z0-9_-]{0,62}",
"required": true
}
},
"steps": [
{
"id": "status",
"title": "Read status",
"executable": "docker",
"args": ["compose", "ps", "{{service}}"]
}
]
}diagnostic、mutating、destructiveのいずれかを選択します。変数は"{{service}}"のような完全な引数を占める必要があります。文字列補間は意図的に拒否されます。
Docker
docker build -t safe-runbook-mcp .
docker run --rm -i \
-v "$PWD:/workspace:ro" \
-e RUNBOOK_WORKSPACE=/workspace \
-e RUNBOOK_DIRECTORY=/app/runbooks \
safe-runbook-mcp読み取り専用マウントでは実行を無効にしておきます。ランブックがDockerを必要とする場合は、その信頼境界を確認した上で、必要なソケットまたはリモートコンテキストのみをマウントします。
開発
npm run check
npm run typecheck
npm test
npm run buildブランチワークフローについてはCONTRIBUTING.mdを、コーディングエージェントが使用するリポジトリルールについてはAGENTS.mdを参照してください。
参考
ライセンス
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityAmaintenanceThe Control Plane for Autonomous AI Enforce policy before execution, require human approvals where risk demands it, and keep a full audit trail — from first action to final result.495
- FlicenseNot gradedqualityAmaintenanceProvides a trust and governance layer for AI agents, enabling secure API access, credential vaulting, paid execution with human approval, and automatic call resume.82
- FlicenseNot gradedqualityAmaintenanceGive AI agents Zero-Trust access to production infrastructure without the risks of granting them shell access. Actions are bounded by policy and an on-host runner.409

AgentsGateofficial
AlicenseNot gradedqualityAmaintenanceEnables AI agents to securely call MCP tools with risk scoring, checkpoints, rollback, and approval workflows.134MIT
Related MCP Connectors
Runtime permission, approval, and audit layer for AI agent tool execution.
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/PanuwatChinpratan/safe-runbook-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server