infra-guard
infra-guard
Terraform と Dockerfile をスキャンして実際のセキュリティ設定ミス(オープンなセキュリティグループ、公開 S3 バケット、ワイルドカード IAM ポリシー、ハードコードされたシークレット、root で実行されるコンテナなど)を検出し、推測ではなく構造化された検出結果を返す MCP サーバーです。
Claude Code、Claude Desktop、Cursor にツールとして組み込めます。AI アシスタントにインフラコードのレビューを依頼すると、infra-guard を呼び出して Checkov から実際の検出結果を取得し、それを説明してくれます。
ブラウザで試す: infra-guard-frontend-production.up.railway.app — Terraform を貼り付けて Scan をクリックすると、実際の検出結果が表示されます。インストールは不要です。
MCP エンドポイント: https://infra-guard-production.up.railway.app/mcp
なぜ作ったのか
私は A.P. Moller–Maersk でクラウドインフラの仕事をしていました。Terraform、Docker、AWS のプロビジョニングを本番規模で行っていました。ほとんどのポートフォリオプロジェクトは普通の Web アプリですが、これは私が実際に存在してほしいと思っていたツールです。「自分の Terraform に明らかなセキュリティホールがないか」という問いに対し、AI アシスタントの当てずっぽうではなく、実際の構造化された回答を返すものです。
infra-guard は推測しません。ファイルを Checkov に通します。Checkov は数百の組み込みチェックを持つ実際の静的解析エンジンです。そして、実際の検出結果(チェック ID、タイトル、影響を受けるリソース、行範囲、コードスニペット)を返します。ホスト側の LLM(Claude など MCP 接続の反対側にいるモデル)がその検出結果をわかりやすい言葉で説明します。このツールの役割は、ただ正確であることです。
Related MCP server: MCP Security Scanner
仕組み
scanner.py → core engine: scan_terraform(...) / scan_dockerfile(...) -> structured dict
server.py → wraps both as MCP tools, served over stdio or Streamable HTTP
api.py → wraps both as a plain REST API (POST /api/scan, POST /api/scan-dockerfile)
frontend/ → React + Vite playground that calls api.py, with a Terraform/Dockerfile togglescanner.py は Checkov CLI をシェル経由で実行し、その JSON 出力を解析します。どのフレームワークから実行された場合でも、同じフォーマットで結果を返します。
{
"summary": { "passed": 14, "failed": 34, "total_checks": 48 },
"findings": [
{
"check_id": "CKV_AWS_24",
"title": "Ensure no security groups allow ingress from 0.0.0.0:0 to port 22",
"resource": "aws_security_group.app_sg",
"start_line": 6,
"end_line": 24,
"code_snippet": "resource \"aws_security_group\" \"app_sg\" { ... }"
}
]
}server.py は scan_terraform_file(file_content, filename) と scan_dockerfile_file(file_content, filename) の 2 つの MCP ツールを公開しています。独自の解釈層は持たず、構造化されたデータはセッションをホストしている LLM にそのまま渡されます。
insecure_example.tf には、意図的に仕込んだ 4 つの Terraform の問題(SSH インバウンドの全開放、公開かつ暗号化されていない S3 バケット、ワイルドカード IAM ポリシー、ハードコードされた RDS パスワード)があります。チェック結果は合格 14 / 不合格 34 です。insecure_example.Dockerfile には 5 つの問題(ベースイメージのバージョン未固定、COPY ではなく ADD、ポート 22 を公開、HEALTHCHECK なし、root で実行)があります — 合格 26 / 不合格 5 です。
ローカルで実行する
uv が必要です。
git clone https://github.com/SanjanaJanardhan/infra-guard.git
cd infra-guard
uv syncスキャナーを直接実行する:
uv run python3 scanner.pyMCP サーバーを stdio で実行する(Claude Code/Desktop などのローカルクライアント用):
uv run python3 server.pyStreamable HTTP で実行する(リモートクライアント用、またはデプロイ環境を再現する場合):
uv run python3 server.py --transport streamable-http --port 8000MCP クライアントに接続する
Claude Code / Claude Desktop — .mcp.json(プロジェクトレベル)またはグローバル MCP 設定に追加します:
{
"mcpServers": {
"infra-guard": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/infra-guard", "run", "python3", "server.py"]
}
}
}Streamable HTTP クライアント(上記の公開デプロイも含む)— 接続先は次のとおりです:
https://infra-guard-production.up.railway.app/mcpプレイグラウンドをローカルで実行する
# terminal 1 — API
uv run python3 api.py
# terminal 2 — frontend
cd frontend
npm install
npm run devフロントエンドは API のベース URL を VITE_API_URL から読み取ります(frontend/.env.local を参照)。デフォルトは http://localhost:8001 です。
デプロイ
Railway 上の 3 つのサービスです。すべて Docker/Nixpacks でビルドされ、手動のサーバー設定はありません。
MCP サーバー —
Dockerfile、Streamable HTTPREST API —
Dockerfile.api、同じscanner.pyコアを使用し、プレイグラウンドを支えますフロントエンド — Railway の Nixpacks ビルダーが
frontend/内の Vite アプリを自動検出します。VITE_API_URLはビルド時にデプロイ済み API の URL に設定されます
両方の Python サービスは環境変数 PORT を読み取るため、Railway が割り当てるポートに変更なしで対応できます。
技術スタック
Python · Checkov · MCP Python SDK · FastAPI · React · Vite · uv · Docker · Railway
ロードマップ
コアの Terraform スキャンエンジン
stdio で動作する MCP サーバー
Streamable HTTP トランスポート
Railway へのデプロイ
ライブプレイグラウンド付き Web フロントエンド
Dockerfile スキャン(プレイグラウンドの Terraform/Dockerfile 切り替えを含む)
検出結果のコスト影響の見積もり
ライセンス
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
- AlicenseAqualityDmaintenanceEnables AI assistants to scan project dependencies and Infrastructure as Code files for security vulnerabilities and misconfigurations. It also provides automated fixing capabilities to remediate identified security issues.183MIT

MCP Security Scannerofficial
AlicenseAqualityDmaintenanceIntegrates Checkov, Semgrep, Bandit, and ASH to provide comprehensive code security analysis for AI coding assistants.1515MIT No Attribution
shieldly-mcpofficial
AlicenseAqualityCmaintenanceEnables AI assistants to analyze AWS IAM policies and CloudFormation templates for security risks.243MIT- AlicenseNot gradedqualityAmaintenanceEnables AI agents to scan code for security and quality issues and receive machine-readable reports with suggested fixes and verification criteria.892MIT
Related MCP Connectors
Zero-config MCP security scanner for AI-generated apps. 25K+ vulnerability patterns.
CVE lookups (NVD) and dependency-manifest audits (OSV) for AI agents. No API keys.
CVE lookups (NVD) and dependency-manifest audits (OSV) for AI agents. No API keys.
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/SanjanaJanardhan/infra-guard'
If you have feedback or need assistance with the MCP directory API, please join our Discord server