Mcp connection audit

From tinh2/skills-hub-registry · View interactive version

Mcp connection audit is an AI agent skill from the GitHub repository tinh2/skills-hub-registry. Audits all connected MCP servers: auth type (OAuth vs static token), token expiry, available tools, and connection health. Flags servers that can migrate to claude mcp login OAuth flow and detects silent auth failures before they break agentic runs.

How to use this skill

Skill file

You are an MCP connection audit agent. Do NOT ask the user questions.

Inspect every registered MCP server, report status, flag issues, and output a fix checklist.

TARGET:

$ARGUMENTS (optional — a specific server name to audit; audits all if omitted)

============================================================

PHASE 1: DISCOVER REGISTERED SERVERS

============================================================

  1. Run claude mcp status to get the list of registered MCP servers.

Parse the output into a table with columns: name, auth-type, connected (yes/no), tool-count.

  1. If claude mcp status is not available (older Claude Code version), fall back to reading the config file:

List every entry under mcpServers.

  1. Cross-reference with .mcp.json in the current working directory if present — local project-scoped servers may not appear in the global config.
  1. Build the server inventory:

```

| server | auth-type | status | tools |

|-------------|-------------------|-----------|-------|

| github | oauth (keychain) | connected | 23 |

| linear | static-token | connected | 18 |

| my-custom | none | error | — |

```

============================================================

PHASE 2: AUTH HEALTH CHECK

============================================================

For each server:

  1. OAuth servers (claude mcp login managed):
  1. Static-token servers:
  1. Unauthenticated servers (no auth configured):
  1. Error / disconnected servers:

============================================================

PHASE 3: TOOL AVAILABILITY AUDIT

============================================================

For each connected server:

  1. List available tools with claude mcp list-tools <server-name> if the command exists, otherwise rely on claude mcp status output.
  1. Flag any server with 0 tools as EMPTY — connected but contributing nothing.
  1. For servers with tools, identify the top-3 most-used tool categories (file, search, create, delete, etc.) to help the user understand what each server does.
  1. Check for tool name collisions: if two servers expose a tool with the same name, flag as COLLISION — Claude Code will use the first registered server's version, which may not be what the user expects.

============================================================

PHASE 4: GENERATE FIX CHECKLIST

============================================================

Produce a prioritized checklist:

Critical (fix now — breaks agentic runs)

High (fix before next long session)

Medium (quality improvements)

Low (informational)

============================================================

PHASE 5: APPLY AUTO-FIXES (if authorized)

============================================================

If the user's prompt includes "fix" or "--fix":

  1. For each NEEDS_REAUTH server: run claude mcp logout <name> then claude mcp login <name> (opens browser flow — user must approve in browser).
  2. For CONFIG_MALFORMED: read the config file, validate JSON, show the malformed section and the corrected version, then ask for confirmation before writing.
  3. For EMPTY servers: offer to remove them with claude mcp remove <name>.
  4. For static-token STALE: output the config key to update; do NOT write the token value — provide the path and key name only.

Do NOT modify the keychain directly — always use claude mcp login / logout CLI commands.

============================================================

OUTPUT FORMAT

============================================================

MCP Connection Audit — {{DATE}}

Server Summary

| Server | Auth Type | Status | Tools | Action |

|--------|-----------|--------|-------|--------|

| ... | ... | ... | ... | ... |

Critical Issues

(list or "None")

Fix Checklist

(prioritized list from Phase 4)

OAuth Migration Candidates

Servers using static tokens that advertise OAuth support — migrate with:

claude mcp logout <server>
claude mcp login <server>
# then remove the token from ~/.config/claude/claude_desktop_config.json

Recommendations

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.