Skip to content
Skillpedia
Connectors (MCP)29k · #9590

mcp-oauth-triage

What it does

This skill helps diagnose broken connections between an AI assistant and an online service that uses OAuth login. It is for developers whose connector suddenly returns login errors or shows another account's data.

When to use it

  • ✓When a connector that worked yesterday now fails with login errors and nothing changed.
  • ✓When a connector returns the right login but then fails on the first request after a refresh.
  • ✓When a connector shows data that belongs to a different account.

Skill link

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/skills/mcp-oauth-triage/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/alirezarezvani/claude-skills/blob/main/engineering/skills/mcp-oauth-triage/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“My AI connector to our billing service started giving 401 errors after it refreshed the login. Help me find out why.”

5 new skills a week. 1 minute to read.

How it works

It collects three pieces of information about the failure and runs a classifier script that sorts the problem into a likely cause, so the fix targets the real issue.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

MCP OAuth Triage

Tier: POWERFUL · Category: Engineering · Domain: AI / Auth / Connectors

Overview

An OAuth-backed MCP connector rarely fails at the exchange. It fails somewhere between storing what the exchange returned and reading it back on the next call, so the visible symptom is a wall of 401s while every dashboard says the connection is healthy.

The cost of guessing is high because five common faults share one symptom and need opposite fixes. Rotating a client secret does nothing when the real fault is a writer and a reader disagreeing about which key holds the token. Re-authenticating cures a poisoned auth cache for a day and hides the actual defect. This skill exists to stop that guessing: collect three artifacts, run one classifier, fix the class you actually have.

Use it before touching code, and again before declaring the fix done.

When to Use

  • A connector that authenticated yesterday returns 401 or 403 today with no configuration change.
  • The token endpoint returns 200, but the first tool call after a refresh fails.
  • Re-authenticating fixes the symptom, and the failure returns within one token lifetime.
  • A multi-account install returns data belonging to the wrong account.
  • A "needs auth" state persists after a successful login.
  • A refresh loop hammers the token endpoint (429s, rotation churn) while the connector stays down.

Do not use this skill for first-time setup that never worked. That is a scopes, redirect URI, or client registration problem, and it belongs with mcp-server-builder. This skill assumes a working state existed and was lost.

Features

One classifier covers five fault classes. Each row names the discriminator that separates it from its neighbours, because the fixes are destructive to each other.

Detector Fires on Confirmed by
Envelope check token stored one level below where the reader looks reader key list vs record key list
Expiry check fractional TTL, zero sentinel, seconds/milliseconds confusion failure gap equals token lifetime
Rotation check more than one exchange per credential per window stored refresh token vs last exchange result
Binding check audience, issuer, or account-key mismatch claims vs the surface's protected-resource metadata
Cache check auth marker that survives a successful login clearing the marker alone restores service

The classifier also reports what it could not check, so a clean exit is read as "not proven broken" rather than "proven working".

Usage

# Classify from a record and a log
python3 scripts/oauth_triage.py --token-file ./token.json --log ./connector.jsonl

# Machine-readable verdict for a ticket or CI
python3 scripts/oauth_triage.py --token-file ./token.json --log ./connector.jsonl --json

# Redact a record before it goes into a ticket or a chat
python3 scripts/oauth_triage.py --token-file ./token.json --redact

# Assert the reader's expectations explicitly
python3 scripts/oauth_triage.py --token-file ./token.json --expect-flat --expect-absolute-expiry
Exit Meaning
0 No defect signals found in the supplied artifacts
1 Suspect findings only, worth a second probe
2 A defect class is confirmed by the artifacts

Exit 0 is not a health check. If the symptom is live and the classifier is clean, the artifacts are wrong, and Step 1 of the workflow is where to go back to.

Workflow

Step 1: Collect three artifacts

Artifact What it is Why
Token record the stored JSON the connector reads back, exactly as written reveals envelope, field types, sentinels
Connector log ordered events with timestamps: exchange, store, load, call, error reveals order, races, which side failed
Timing how long after a successful call the failure appears separates expiry semantics from binding faults

Redact secrets. The classifier needs key names, value types, and timestamps, never the token value.

Step 2: Run the classifier

python3 scripts/oauth_triage.py --token-file ./token.json --log ./connector.jsonl --json

Step 3: Match the class to its fix

Each class has one cheap confirmation and one fix. Apply the confirmation before the fix, because the fixes are destructive to each other: rotating credentials while the real fault is a shape mismatch produces a second, harder incident.

Class A: Envelope mismatch

The exchange returns a nested payload

FAQ

Why not just log in again?

Logging in again may hide the problem for a while, and the failure often comes back when the token expires.

Does it fix the problem for me?

It identifies the type of fault so you can fix the right thing; the fix itself is up to you.

Is it only for one service?

No, it applies to any connector that uses OAuth login and an MCP server.

Details

Original description by the author

Use when an MCP connector that used to authenticate now fails (tool calls 401 after a good token exchange, breaks after refresh, returns another account's data), before changing code. Classifies the fault with oauth_triage.py.

repo: alirezarezvani/claude-skills

Popularity

GitHub stars
29k
Ranking position
#9590
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills