mcp-oauth-triage
Skill này làm gì
Skill này giúp chẩn đoán các kết nối bị hỏng giữa trợ lý AI và một dịch vụ trực tuyến dùng đăng nhập OAuth. Skill dành cho lập trình viên có connector đột ngột trả về lỗi đăng nhập hoặc hiển thị dữ liệu của tài khoản khác.
Khi nào nên dùng
- ✓Khi một connector hôm qua còn chạy nay lại lỗi đăng nhập dù không có gì thay đổi.
- ✓Khi connector nhận được đăng nhập đúng nhưng lỗi ở yêu cầu đầu tiên sau khi làm mới.
- ✓Khi connector hiển thị dữ liệu thuộc về một tài khoản khác.
Liên kết skill
https://github.com/alirezarezvani/claude-skills/blob/main/engineering/skills/mcp-oauth-triage/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Connector AI của tôi tới dịch vụ thanh toán bắt đầu báo lỗi 401 sau khi làm mới đăng nhập. Giúp tôi tìm nguyên nhân.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill thu thập ba thông tin về lỗi và chạy một script phân loại để xếp vấn đề vào một nguyên nhân có khả năng cao, để việc sửa nhắm đúng vấn đề thật.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Vì sao không đăng nhập lại cho xong?
Đăng nhập lại có thể che giấu vấn đề trong một thời gian, và lỗi thường quay lại khi token hết hạn.
Nó có sửa lỗi giúp tôi không?
Nó xác định loại lỗi để bạn sửa đúng chỗ; việc sửa vẫn do bạn quyết định.
Nó chỉ dùng cho một dịch vụ thôi sao?
Không, nó áp dụng cho mọi connector dùng đăng nhập OAuth và máy chủ MCP.
Chi tiết
Mô tả gốc của tác giả
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.
Độ phổ biến
- Sao GitHub
- 29k
- Vị trí xếp hạng
- #9590
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agent-launcher-orchestrator
29kGiúp agent của bạn lên kế hoạch, xây dựng, kiểm thử và lên lịch một Claude managed agent trong tài khoản riêng, từng bước một, bắt đầu từ một mục tiêu rõ ràng.
grade-iterate
29kCho phép agent của bạn chấm kết quả một managed AI agent theo bảng tiêu chí và cải thiện qua số vòng cố định, nên không bao giờ lặp vô tận.
interview
29kCho phép agent của bạn phỏng vấn bạn về ý tưởng agent AI và biến câu trả lời thành một kế hoạch xây dựng đơn giản trước khi khởi chạy bất cứ điều gì.
run-without-you
29kGiúp agent của bạn thiết lập một managed AI agent chạy theo lịch hoặc khi có sự kiện xảy ra, với thời gian cron được kiểm tra trước khi khởi chạy.
Skill tương tự
mcporter
394kGiúp agent của bạn liệt kê, gọi và kiểm tra các máy chủ MCP cùng công cụ của chúng qua HTTP hoặc stdio, và quản lý cài đặt đăng nhập.
fastmcp
260kGiúp bạn xây dựng, kiểm thử và triển khai một máy chủ MCP bằng Python, cấp cho trợ lý AI quyền truy cập API, cơ sở dữ liệu hoặc file của bạn dưới dạng công cụ.
mcp-oauth-remote-gateway
260kHướng dẫn bạn đăng nhập OAuth cho máy chủ MCP từ xa khi Hermes chạy trên máy chủ, nơi đăng nhập bằng trình duyệt thông thường không thể truy cập được.