Agent skill

MCP Security Audit

by boshi-xixixi in boshi-xixixi/TraeSkill

Audit MCP (Model Context Protocol) server configurations for security issues.

MITAuto-check passedAgent Workflows

Install MCP Security Audit

skills CLI
$ npx skills add boshi-xixixi/TraeSkill --skill mcp-security-audit -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install boshi-xixixi/TraeSkill mcp-security-audit --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/boshi-xixixi/TraeSkill.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.trae/Skills/.agents/skills/mcp-security-audit .claude/skills/mcp-security-audit && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mcp-security-audit
GitHub stars
276
Token cost
~2.2k tokens
SKILL.md length
185 words
Files
1
Skills in repo
16
Repo updated
First seen
Licence
MIT

At a glance

Audit MCP (Model Context Protocol) server configurations for security issues.

  • : - Reviewing .mcp.json files for security risks - Checking MCP server args for hardcoded secrets
  • SKILL.md covers Overview, When to Use, Audit Check 1: Hardcoded Secrets and Audit Check 2: Shell Injection…, plus 4 more sections
  • Needs API_KEY
  • Tasks that involve MCP servers

What it does

MCP Security Audit is an agent skill from boshi-xixixi/TraeSkill. Audit MCP (Model Context Protocol) server configurations for security issues. Use this skill when: - Reviewing .mcp.json files for security risks - Checking MCP server args for hardcoded secrets or shell injection patterns - Validating that MCP servers use pinned versions (not @latest) - Detecting unpinned dependencies in MCP server configurations - Auditing which MCP servers a project registers and whether they're on an approved list - Checking for environment variable usage vs. hardcoded credentials in MCP…

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering MCP servers, Security review and Secrets management. It works with Model Context Protocol. The repository describes itself as: 为 Trae IDE 打造的全流程标准化 AI 开发技能库,内置调度分发与多角色研发技能,一键导入规范 AI 编码工作流 🚀. The licence is MIT.

When your agent uses it

  • : - Reviewing .mcp.json files for security risks - Checking MCP server args for hardcoded secrets
  • Tasks that involve MCP servers
  • Tasks that involve Security review

Example prompts

  • “is my MCP config secure?”
  • “audit my MCP servers”
  • “check .mcp.json”
  • “/mcp-security-audit”

Requirements

  • Python 3
  • Node.js
  • A credential in API_KEY
  • A credential in MY_API_KEY

What it can do on your machine

Read from SKILL.md and the folder at commit 9cf38e6. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python and json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • modelcontextprotocol.io
    • github.com
    • owasp.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

MCP Security Audit loads about 2.2k tokens when it runs. Until then it costs about 179 tokens; SKILL.md has 185 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~179
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from boshi-xixixi/TraeSkill at commit 9cf38e6, republished under its MIT licence (© boshi-xixixi). 185 words, ~2,211 tokens.

Download SKILL.mdSave it as .claude/skills/mcp-security-audit/SKILL.md (or your agent's skills folder).
name
mcp-security-audit
description
Audit MCP (Model Context Protocol) server configurations for security issues. Use this skill when: - Reviewing .mcp.json files for security risks - Checking MCP server args for hardcoded secrets or shell injection patterns - Validating that MCP servers use pinned versions (not @latest) - Detecting unpinned dependencies in MCP server configurations - Auditing which MCP servers a project registers and whether they're on an approved list - Checking for environment variable usage vs. hardcoded credentials in MCP configs - Any request like "is my MCP config secure?", "audit my MCP servers", or "check .mcp.json" keywords: [mcp, security, audit, secrets, shell-injection, supply-chain, governance]

MCP Security Audit

Audit MCP server configurations for security issues — secrets exposure, shell injection, unpinned dependencies, and unapproved servers.

Overview

MCP servers give agents direct tool access to external systems. A misconfigured .mcp.json can expose credentials, allow shell injection, or connect to untrusted servers. This skill catches those issues before they reach production.

.mcp.json → Parse Servers → Check Each Server:
  1. Secrets in args/env?
  2. Shell injection patterns?
  3. Unpinned versions (@latest)?
  4. Dangerous commands (eval, bash -c)?
  5. Server on approved list?
→ Generate Report

When to Use

  • Reviewing any .mcp.json file in a project
  • Onboarding a new MCP server to a project
  • Auditing all MCP servers in a monorepo or plugin marketplace
  • Pre-commit checks for MCP configuration changes
  • Security review of agent tool configurations

Audit Check 1: Hardcoded Secrets

Scan MCP server args and env values for hardcoded credentials.

python
import json
import re
from pathlib import Path

SECRET_PATTERNS = [
    (r'(?i)(api[_-]?key|token|secret|password|credential)\s*[:=]\s*["\'][^"\']{8,}', "Hardcoded secret"),
    (r'(?i)Bearer\s+[A-Za-z0-9\-._~+/]+=*', "Hardcoded bearer token"),
    (r'(?i)(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{30,}', "GitHub token"),
    (r'sk-[A-Za-z0-9]{20,}', "OpenAI API key"),
    (r'AKIA[0-9A-Z]{16}', "AWS access key"),
    (r'-----BEGIN\s+(RSA\s+)?PRIVATE\s+KEY-----', "Private key"),
]

def check_secrets(mcp_config: dict) -> list[dict]:
    """Check for hardcoded secrets in MCP server configurations."""
    findings = []
    raw = json.dumps(mcp_config)
    for pattern, description in SECRET_PATTERNS:
        matches = re.findall(pattern, raw)
        if matches:
            findings.append({
                "severity": "CRITICAL",
                "check": "hardcoded-secret",
                "message": f"{description} found in MCP configuration",
                "evidence": f"Pattern matched: {pattern}",
                "fix": "Use environment variable references: ${ENV_VAR_NAME}"
            })
    return findings

Good practice — use env var references:

json
{
  "mcpServers": {
    "my-server": {
      "command": "node",
      "args": ["server.js"],
      "env": {
        "API_KEY": "${MY_API_KEY}",
        "DB_URL": "${DATABASE_URL}"
      }
    }
  }
}

Bad — hardcoded credentials:

json
{
  "mcpServers": {
    "my-server": {
      "command": "node",
      "args": ["server.js", "--api-key", "sk-abc123realkey456"],
      "env": {
        "DB_URL": "postgresql://admin:password123@prod-db:5432/main"
      }
    }
  }
}

Audit Check 2: Shell Injection Patterns

Detect dangerous command patterns in MCP server args.

python
import json
import re

DANGEROUS_PATTERNS = [
    (r'\$\(', "Command substitution $(...)"),
    (r'`[^`]+`', "Backtick command substitution"),
    (r';\s*\w', "Command chaining with semicolon"),
    (r'\|\s*\w', "Pipe to another command"),
    (r'&&\s*\w', "Command chaining with &&"),
    (r'\|\|\s*\w', "Command chaining with ||"),
    (r'(?i)eval\s', "eval usage"),
    (r'(?i)bash\s+-c\s', "bash -c execution"),
    (r'(?i)sh\s+-c\s', "sh -c execution"),
    (r'>\s*/dev/tcp/', "TCP redirect (reverse shell pattern)"),
    (r'curl\s+.*\|\s*(ba)?sh', "curl pipe to shell"),
]

def check_shell_injection(server_config: dict) -> list[dict]:
    """Check MCP server args for shell injection risks."""
    findings = []
    args_text = json.dumps(server_config.get("args", []))
    for pattern, description in DANGEROUS_PATTERNS:
        if re.search(pattern, args_text):
            findings.append({
                "severity": "HIGH",
                "check": "shell-injection",
                "message": f"Dangerous pattern in MCP server args: {description}",
                "fix": "Use direct command execution, not shell interpolation"
            })
    return findings

Audit Check 3: Unpinned Dependencies

Flag MCP servers using @latest in their package references.

python
def check_pinned_versions(server_config: dict) -> list[dict]:
    """Check that MCP server dependencies use pinned versions, not @latest."""
    findings = []
    args = server_config.get("args", [])
    for arg in args:
        if isinstance(arg, str):
            if "@latest" in arg:
                findings.append({
                    "severity": "MEDIUM",
                    "check": "unpinned-dependency",
                    "message": f"Unpinned dependency: {arg}",
                    "fix": f"Pin to specific version: {arg.replace('@latest', '@1.2.3')}"
                })
            # npx with unversioned package
            if arg.startswith("-y") or (not "@" in arg and not arg.startswith("-")):
                pass  # npx flag or plain arg, ok
    # Check if using npx without -y (interactive prompt in CI)
    command = server_config.get("command", "")
    if command == "npx" and "-y" not in args:
        findings.append({
            "severity": "LOW",
            "check": "npx-interactive",
            "message": "npx without -y flag may prompt interactively in CI",
            "fix": "Add -y flag: npx -y package-name"
        })
    return findings

Good — pinned version:

json
{ "args": ["-y", "my-mcp-server@2.1.0"] }

Bad — unpinned:

json
{ "args": ["-y", "my-mcp-server@latest"] }

Audit Check 4: Full Audit Runner

Combine all checks into a single audit.

python
def audit_mcp_config(mcp_path: str) -> dict:
    """Run full security audit on an .mcp.json file."""
    path = Path(mcp_path)
    if not path.exists():
        return {"error": f"{mcp_path} not found"}

    config = json.loads(path.read_text(encoding="utf-8"))
    servers = config.get("mcpServers", {})
    results = {"file": str(path), "servers": {}, "summary": {}}
    total_findings = []

    # Run secrets check once on the whole config (not per-server)
    config_level_findings = check_secrets(config)
    total_findings.extend(config_level_findings)

    for name, server_config in servers.items():
        if not isinstance(server_config, dict):
            continue
        findings = []
        findings.extend(check_shell_injection(server_config))
        findings.extend(check_pinned_versions(server_config))
        results["servers"][name] = {
            "command": server_config.get("command", ""),
            "findings": findings,
        }
        total_findings.extend(findings)

    # Summary
    by_severity = {}
    for f in total_findings:
        sev = f["severity"]
        by_severity[sev] = by_severity.get(sev, 0) + 1

    results["summary"] = {
        "total_servers": len(servers),
        "total_findings": len(total_findings),
        "by_severity": by_severity,
        "passed": len(total_findings) == 0,
    }
    return results

Usage:

python
results = audit_mcp_config(".mcp.json")
if not results["summary"]["passed"]:
    for server, data in results["servers"].items():
        for finding in data["findings"]:
            print(f"[{finding['severity']}] {server}: {finding['message']}")
            print(f"  Fix: {finding['fix']}")

Output Format

MCP Security Audit — .mcp.json
═══════════════════════════════
Servers scanned: 5
Findings: 3 (1 CRITICAL, 1 HIGH, 1 MEDIUM)

[CRITICAL] my-api-server: Hardcoded secret found in MCP configuration
  Fix: Use environment variable references: ${ENV_VAR_NAME}

[HIGH] data-processor: Dangerous pattern in MCP server args: bash -c execution
  Fix: Use direct command execution, not shell interpolation

[MEDIUM] analytics: Unpinned dependency: analytics-mcp@latest
  Fix: Pin to specific version: analytics-mcp@2.1.0

© boshi-xixixi, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .trae/Skills/.agents/skills/mcp-security-audit of boshi-xixixi/TraeSkill.

Open the folder on GitHubat commit 9cf38e6

Compare with similar skills

MCP Security Audit next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

MCP Security Audit compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
MCP Security Audit this skillboshi-xixixi/TraeSkill276—~2.2kAutomated safety check: PassMIT
MCP Security Auditgithub/awesome-copilot40k—~3.1kAutomated safety check: PassMIT
Security Reviewktnyt/cclsp675—~565Automated safety check: PassMIT
Security Scanaffaan-m/ECC276k5 repos~1.1kAutomated safety check: PassMIT
Warp GUI to Agent CLI Migrationwarpdotdev/warp65k1 repos~2.1kAutomated safety check: PassAGPL-3.0
Keeljoseconti/declaracion-renta-espana190—~11kAutomated safety check: WarnGPL-3.0-or-later

Similar skills

  • MCP Security Audit

    github/awesome-copilot

    Official

    Audit MCP (Model Context Protocol) server configurations for security issues.

    40k GitHub stars~3.1k tokensUpdated yesterday
    SecurityAuto-check passed
  • Security Review

    ktnyt/cclsp

    Request a security expert assessment for code changes that touch child process spawning, file system access, configuration loading, or environment variable handling.

    675 GitHub stars~565 tokensUpdated 7 mo ago
    SecurityAuto-check passed
  • Security Scan

    affaan-m/ECC

    Scan your Claude Code configuration (.claude/ directory) for security vulnerabilities, misconfigurations, and injection risks using AgentShield.

    276k GitHub starsUsed in 5 repos~1.1k tokens
    Agent WorkflowsAuto-check passed
  • Migrates the compatible subset of settings and global file-based MCP servers from the Warp desktop app into Warp Agent CLI without exposing credentials or state.

    65k GitHub starsUsed in 1 repo~2.1k tokens
    Agent WorkflowsAuto-check passed
  • Keel

    joseconti/declaracion-renta-espana

    A skill your agent uses for ANY new software project from idea to release — websites, WordPress/WooCommerce plugins, MCP servers, web apps, components, or libraries.

    190 GitHub stars~11k tokensUpdated 2 mo ago
    SecurityAuto-check: warnings
  • Chorus CLI

    Chorus-AIDLC/Chorus

    How to install, configure, and use the chorus CLI — install it, manage agents with chorus agents (add/remove/list), the connection environment variables, and MCP operations via chorus mcp.

    1.2k GitHub stars~1.2k tokensUpdated yesterday
    Agent WorkflowsAuto-check: notes

More from boshi-xixixi/TraeSkill

All 16 skills in this repo
  • AI Team Orchestration

    boshi-xixixi/TraeSkill

    Bootstrap and run a multi-agent AI development team. An agent skill from boshi-xixixi/TraeSkill.

    276 GitHub stars~1.4k tokensUpdated 5 mo ago
    Auto-check passed
  • Arize Instrumentation

    boshi-xixixi/TraeSkill

    INVOKE THIS SKILL when adding Arize AX tracing or observability to an app for the first time, or when the user wants to instrument their LLM app or get started with LLM observability.

    276 GitHub stars~5.1k tokensUpdated 5 mo ago
    Auto-check: notes
  • Dotnet MCP Builder

    boshi-xixixi/TraeSkill

    Build Model Context Protocol (MCP) servers in C/.NET against the current ModelContextProtocol 1.x NuGet packages.

    276 GitHub stars~1.7k tokensUpdated 5 mo ago
    Auto-check passed
  • Skill Creator

    boshi-xixixi/TraeSkill

    当用户需要创建新 Skill 或更新现有 Skill 时使用。此 Skill 提供技能创建的完整工作流指导,包括需求分析、编写规范、工程化构建、质量评估和迭代优化。

    276 GitHub stars~3.9k tokensUpdated 5 mo ago
    Auto-check passed
  • Trae Project Setup

    boshi-xixixi/TraeSkill

    Trae 项目规范化配置专家。用于快速初始化 Trae 项目配置文件、生成项目规则、用户偏好设置和 Skill 模板。当用户需要:(1) 初始化新项目的 Trae 配置 (2) 生成 .trae 目录结构 (3) 创建 USERPREFERENCES.md 用户偏好文件 (4) 创建 projectrules.md 项目规则文件 (5) 创建新的 Skill 模板 时使用此 Skill。

    276 GitHub stars~708 tokensUpdated 5 mo ago
    Auto-check: notes
  • Web Coder

    boshi-xixixi/TraeSkill

    Expert 10x engineer with comprehensive knowledge of web development, internet protocols, and web standards.

    276 GitHub starsUsed in 1 repo~5.2k tokens
    Auto-check passed

Questions about MCP Security Audit

What does MCP Security Audit do?

Audit MCP (Model Context Protocol) server configurations for security issues. MCP Security Audit is an agent skill from boshi-xixixi/TraeSkill. Audit MCP (Model Context Protocol) server configurations for security issues.

When should I use MCP Security Audit?

MCP Security Audit fits situations like: : - Reviewing .mcp.json files for security risks - Checking MCP server args for hardcoded secrets; tasks that involve MCP servers; tasks that involve Security review.

How do I install MCP Security Audit in Claude Code?

Run `npx skills add boshi-xixixi/TraeSkill --skill mcp-security-audit -a claude-code`. Or copy the skill folder (.trae/Skills/.agents/skills/mcp-security-audit in boshi-xixixi/TraeSkill) into .claude/skills/mcp-security-audit in your project. Claude Code loads it when a task matches its description.

How do I install MCP Security Audit in Codex?

Run `npx skills add boshi-xixixi/TraeSkill --skill mcp-security-audit -a codex`. Or copy the skill folder (.trae/Skills/.agents/skills/mcp-security-audit in boshi-xixixi/TraeSkill) into .agents/skills/mcp-security-audit in your project. Codex loads it when a task matches its description.

Can I use MCP Security Audit in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add boshi-xixixi/TraeSkill --skill mcp-security-audit -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mcp-security-audit, .gemini/skills/mcp-security-audit, .github/skills/mcp-security-audit and .opencode/skills/mcp-security-audit in your project.

What does MCP Security Audit need to run?

Going by SKILL.md and its folder, MCP Security Audit needs credentials named API_KEY. Our summary lists: Python 3; Node.js; A credential in API_KEY; A credential in MY_API_KEY.

Does MCP Security Audit access the network?

SKILL.md names 3 domains. As links in the text: modelcontextprotocol.io, github.com and owasp.org. This is read from the text; nothing was executed.

Is MCP Security Audit safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does MCP Security Audit use?

MCP Security Audit is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does MCP Security Audit use?

About 2.2k tokens (SKILL.md is roughly 8.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to MCP Security Audit?

Skills that share tags, products or a category with MCP Security Audit: MCP Security Audit (github/awesome-copilot, 40k stars), Security Review (ktnyt/cclsp, 675 stars), Security Scan (affaan-m/ECC, 276k stars) and Warp GUI to Agent CLI Migration (warpdotdev/warp, 65k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains MCP Security Audit?

boshi-xixixi (a GitHub user) maintains it in boshi-xixixi/TraeSkill, which has 276 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on May 12, 2026.

Source: boshi-xixixi/TraeSkill on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.