mcp-auth-kit: Instructions file for Claude Code

CLAUDE.md

mcp-auth-kit CLAUDE.md is an instructions file for Claude Code from bradburch/mcp-auth-kit. It costs 585 tokens per session, scanned A, original, MIT.

A set of Claude Code instructions for developing and checking an OAuth-protected MCP server library written in TypeScript. OAuth is a standard way to let users grant limited access without sharing a password.

In plain words
What is it for?
Use it while editing, building, formatting, linting, type-checking, or testing the mcp-auth-kit project.
Why use it?
It gives the coding agent the project's required commands, protocol version, request handling rules, and boundaries between the library and its software dependencies. This reduces the risk of changing the server in ways that break its checks or protocol.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md.

This is bradburch/mcp-auth-kit's own configuration. It tells Claude Code how to work on mcp-auth-kit itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-auth-kit configures →

Reuse

Borrowing it

Nothing to install: this file belongs to bradburch/mcp-auth-kit. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/bradburch/mcp-auth-kit/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/bradburch/mcp-auth-kit

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mcp-auth-kit CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/bradburch/mcp-auth-kit/claude-md/github.svg)](https://agentmods.dev/instructions/bradburch/mcp-auth-kit/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/bradburch/mcp-auth-kit/claude-md"><img src="https://agentmods.dev/badge/instructions/bradburch/mcp-auth-kit/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mcp-auth-kit CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/bradburch/mcp-auth-kit/claude-md"><img src="https://agentmods.dev/badge/instructions/bradburch/mcp-auth-kit/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 585 This file is loaded in full into every session.
When invoked 585 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00585 $0.00585
Opus 5.5 $0.00234 $0.00234
Sonnet 5.5 $0.00117 $0.00117
Haiku 4.5 $0.00059 $0.00059

Measured 8d ago against content hash 6c601e9d2658, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mcp-auth-kit CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 44 lines

How it starts

The opening of the file, as written. The whole thing — 44 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

mcp-oauth-kit: a library that builds an OAuth-protected MCP server as a Hono app (createMcpServer). Published to npm from dist/; examples in examples/.

Commands

npm run typecheck && npm run lint && npm run format:check && npm run build && npm test

That is the full CI gate (Node 22/24/26). npm run format fixes formatting. Lint no-explicit-any warnings in tests are pre-existing and accepted.

Protocol and SDK

  • Targets MCP spec 2026-07-28 on the v2 TypeScript SDK (@modelcontextprotocol/server). Don't reintroduce @modelcontextprotocol/sdk (v1).
  • POST /mcp (src/transport.ts) runs on createMcpHandler: modern requests carry a _meta envelope + MCP-Protocol-Version/Mcp-Method/Mcp-Name headers; claim-less 2025-era requests hit the SDK's stateless legacy fallback, which answers as one-event SSE.
  • The SDK owns header validation, the body cap (maxRequestBodySize), and per-tool insufficient_scope 403s (scopeChallenge). The kit owns Origin exact-match, Bearer verification against its own authorization server (src/oauth/), and rate limiting. Don't re-implement SDK-owned checks.
  • Every tool is listed in tools/list regardless of granted scopes (step-up discovery); scope gating happens at dispatch via scopeChallengeFor in src/two-phase.ts.

Tests

  • Use test/helpers.ts: getToken (full OAuth flow), mcpRequest (modern request), readRpc (parses JSON or SSE bodies), callTool (strips wire-only _meta/resultType).
  • Security-relevant changes (OAuth, PKCE, tokens, rate limiting, two-phase confirm) need tests for both the intended behavior and the failure being prevented.

Conventions

  • Zod 4 only (^4.2); tool inputSchema must be a z.object.
  • Raw tool errors never reach clients — only ToolError messages pass through (two-phase.ts).
  • Public API changes: update the README reference tables and CHANGELOG.md (Unreleased).
  • Conventional commits (feat:, fix:, docs:, chore:); DEFAULT_SERVER_VERSION in src/server.ts must match package.json on release.
  • docs/superpowers/plans/ holds historical implementation plans; don't treat them as current.

Read the full file on GitHub · 44 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 44 lines · 585 tokens per session scan A 6c601e9d2658

Subscribe to this mod's changes

mcp-auth-kit CLAUDE.md is an instructions file published in the GitHub repository bradburch/mcp-auth-kit (0 stars, last pushed 5d ago), licensed MIT. It adds 585 tokens to every session, about $0.0023 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-20.

Related

Other instructions, from other repositories