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 分