DevOps & Cloud Code Auditor

io.github.Ansarii由 GitHub 帳號 Ansarii 發布v1.0.0更新於 Oct 25, 2026

Detects database migration table locks, terraform cost leaks, and OWASP API flaws.

已驗證Streamable HTTP可網頁執行資料庫雲端與基礎設施安全與監控

概覽

AI 產生的概覽

一個靜態分析 MCP 伺服器,用來稽核 Terraform、PostgreSQL 遷移與 Next.js API 程式碼中的成本浪費、資料表鎖定和 OWASP 類缺陷。

可以做什麼
稽核 Terraform、PostgreSQL 遷移或 Next.js 程式碼片段,回傳結構化問題清單與建議修正,檔案類型可自動判斷或手動指定。複製並掃描公開 Git 儲存庫,可限定子目錄,回傳問題清單與 Markdown 報告。掃描主機上的本機目錄,用於送出 PR 或部署到預備環境前檢查,並提供嚴重程度分布。檢查範圍涵蓋雲端成本規則、遷移鎖定風險與 API 安全規則。
適用情境
適合在基礎設施或遷移變更進入正式環境前,由助理協助審查,例如檢查 PostgreSQL 遷移中的鎖定語句、Terraform 設定中的成本浪費,或 Next.js 伺服器端程式碼中外洩的密鑰與缺少的驗證。適用於合併前或部署前檢查,而非執行期監控。
執行需求
清單標示為遠端 streamable HTTP 端點,未宣告驗證、環境變數或請求標頭。README 則說明可用 python3 或 Docker 在本機執行;儲存庫稽核工具需要網路存取以複製公開 Git 位址。
安裝前請注意
儲存庫工具會複製公開 Git 位址,本機目錄工具會讀取主機上絕對路徑的檔案,請只指向你願意被檢查的程式碼。結果是靜態樣式比對,可能漏報或誤報,採取行動前應人工複核。README 稱其僅做靜態分析,不執行程式碼也不連線資料庫。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 DevOps & Cloud Code Auditor,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.Ansarii%2Fdevops-code-auditor/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "devops-cloud-code-auditor": {
      "type": "http",
      "url": "https://neon_innovation_lab--devops-code-auditor.apify.actor/mcp"
    }
  }
}

README

DevOps & Cloud Code Auditor (MCP Server)

[Model Context Protocol] [Glama Quality Score] [Python 3.12] [License: MIT] [Transport: stdio]

A production-ready Model Context Protocol (MCP) Server providing AI coding assistants (Claude Desktop, Cursor, Windsurf, Cline) with automated static analysis tools to prevent production outages, cloud cost leaks, and security vulnerabilities.


🌟 Capabilities & Audited Rule Sets

This server inspects codebases across three mission-critical engineering vectors:

  1. Cloud Cost Leaks (Terraform / HCL / AWS):

    • EBS_GP2: Identifies legacy gp2 EBS volumes (gp3 provides equal durability with ~20% baseline cost reduction and higher baseline IOPS).
    • PUBLIC_IP: Flags unneeded associate_public_ip_address = true incurring hourly AWS IPv4 charges ($0.005/hr/IP).
    • CW_NO_RETENTION: Catches aws_cloudwatch_log_group missing retention policies (preventing infinite unbudgeted log ingestion costs).
    • S3_NO_LIFECYCLE: Detects S3 buckets lacking Glacier lifecycle transitions.
    • RDS_MULTIAZ_NONPROD & RDS_PROVISIONED_IOPS_NONPROD: Flags doubled database infrastructure costs on development and staging environments.
  2. PostgreSQL Migration Table Lock Hazards:

    • INDEX_NOT_CONCURRENT: Detects CREATE INDEX missing CONCURRENTLY (which acquires an EXCLUSIVE lock and halts table writes in production).
    • NOT_NULL_VOLATILE_DEFAULT: Catches ADD COLUMN ... NOT NULL DEFAULT <func()> rewriting every table row under an ACCESS EXCLUSIVE lock.
    • FK_NO_INDEX: Flags unindexed foreign key constraints causing cascading table-level sequential lock scans on parent updates/deletes.
    • FOR_UPDATE_UNBOUNDED: Catches SELECT ... FOR UPDATE missing LIMIT or SKIP LOCKED, preventing deadlocks.
  3. OWASP & Full-Stack Next.js API Security:

    • NEXT_PUBLIC_SECRET_LEAK: Flags sensitive tokens and private API keys prefixed with NEXT_PUBLIC_ that leak into public client browser bundles.
    • NEXTJS_SERVER_ACTION_NO_AUTH: Flags Next.js 14/15 Server Actions exporting mutations without explicit session auth verification.
    • SQLI_RAW_INTERPOLATION: Identifies raw SQL query templates using string interpolation instead of parameterized inputs.
    • SSRF_UNVALIDATED_FETCH: Catches external fetch calls consuming user inputs without protocol/hostname validation.

🛠️ MCP Tools Exposed

This server implements the official Model Context Protocol specification (tools/list and tools/call):

1. audit_devops_repository

Clones a public Git repository shallowly without executing hooks, performs AST and regex static syntax audits, and returns structured findings and a formatted Markdown report.

  • Parameters:
    • repository_url (string, required): Public Git URL of the repository to audit (e.g. https://github.com/example/cloud-infra).
    • sub_directory (string, optional): Specific subdirectory within the repository to inspect (e.g. terraform/ or prisma/migrations/).
  • Returns:
    • status: "success" | "error"
    • total_findings: Number of detected issues
    • findings: Array of detailed vulnerability records (file, line number, rule ID, severity, message, fix code)
    • markdown_report: Human-readable summary table

2. audit_devops_code

Directly audits a raw code snippet of Terraform (HCL), PostgreSQL migration (SQL), or Next.js API/Server Action code.

  • Parameters:
    • code (string, required): The source code string to audit.
    • file_type (string, optional, default: "auto"): One of "terraform", "postgres", "nextjs", or "auto".
  • Returns: Structured JSON findings with exact drop-in code fixes.

3. audit_local_devops_directory

Audits a local filesystem directory on the host machine before submitting a Pull Request or deploying to staging.

  • Parameters:
    • directory_path (string, required): Absolute filesystem path to the target folder.
  • Returns: Structured JSON findings and severity breakdown.

🚀 Client Configuration & Quickstart

1. Claude Desktop Setup

Add the server to your claude_desktop_config.json:

json
{  "mcpServers": {    "devops-code-auditor": {      "command": "python3",      "args": ["/path/to/devops-code-auditor/server.py"]    }  }}

2. Cursor IDE / Windsurf Setup

In Cursor, navigate to Settings → Features → MCP → Add New MCP Server:

  • Name: devops-code-auditor
  • Type: command
  • Command: python3 /absolute/path/to/devops-code-auditor/server.py

3. Docker Execution

Run the isolated container via Docker:

json
{  "mcpServers": {    "devops-code-auditor": {      "command": "docker",      "args": [        "run",        "-i",        "--rm",        "ghcr.io/ansarii/devops-code-auditor"      ]    }  }}

💻 Example Agent Usage

Once connected, your AI assistant can evaluate migration files and cloud manifests on demand:

text
User: "Check this PostgreSQL migration before I run it on production:CREATE INDEX idx_orders_user_id ON orders (user_id);"
Claude (Tool Call):audit_devops_code({  "code": "CREATE INDEX idx_orders_user_id ON orders (user_id);",  "file_type": "postgres"})
Result:{  "status": "success",  "total_findings": 1,  "findings": [    {      "suite": "postgres-locks",      "rule": "INDEX_NOT_CONCURRENT",      "severity": "high",      "file": "migration.sql",      "line": 1,      "message": "CREATE INDEX on \"orders\" without CONCURRENTLY blocks table writes during build.",      "fix": "CREATE INDEX CONCURRENTLY idx_orders_user_id ON orders (user_id);"    }  ]}

🔒 Security Guarantee: Zero Execution

This server executes 100% static analysis using AST pattern matching and regex verification. It never executes untrusted shell commands, arbitrary Python code, or database connections on your machine.


📜 License

MIT License — Copyright (c) 2026 Neon Innovation Lab. Maintained by Neon Innovation Lab.

來源:README.md,提交 fdf7639

工具

0
SourceWeft 尚未讀取此伺服器的工具。

版本歷史

1
  1. v1.0.0最新Sep 16, 2026

評分

已滿足適用檢查項的 85%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分