toolhive: Agent for Claude Code

.claude/agents/oauth-expert.md

oauth-expert is an agent for Claude Code from stacklok/toolhive. It costs 25 tokens per session (873 once invoked), scanned A, original, Apache-2.0.

An authentication specialist for ToolHive that covers OAuth 2.0, OpenID Connect, token exchange, JWT validation, and related standards. OAuth and OpenID Connect are common ways for applications to obtain and verify identity or access tokens.

In plain words
What is it for?
Use it when implementing or debugging login and authorization flows, exchanging tokens, validating JWTs, configuring authentication middleware, or designing access control.
Why use it?
It helps diagnose authentication failures and design flows that match the relevant security specifications instead of relying on assumptions.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is stacklok/toolhive's own configuration. It tells Claude Code how to work on toolhive 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 toolhive configures →

About the project

ToolHive is a platform for running and managing Model Context Protocol servers, which give AI clients access to tools and data. Developers, platform teams, and enterprises use it to isolate MCP servers, control access, and monitor their operation. The catalogue entries provide agent workflows and configuration for operating ToolHive and its MCP servers.

stacklok/toolhive · 2,307 stars · on GitHub · stacklok.com

Reuse

Borrowing it

Nothing to install: this file belongs to stacklok/toolhive. 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/stacklok/toolhive/main/.claude/agents/oauth-expert.md
Clone the repo
git clone --depth 1 https://github.com/stacklok/toolhive

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 oauth-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/stacklok/toolhive/oauth-expert/github.svg)](https://agentmods.dev/agents/stacklok/toolhive/oauth-expert)
Your own site
<a href="https://agentmods.dev/agents/stacklok/toolhive/oauth-expert"><img src="https://agentmods.dev/badge/agents/stacklok/toolhive/oauth-expert/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 oauth-expert

Your own site · 80×15
<a href="https://agentmods.dev/agents/stacklok/toolhive/oauth-expert"><img src="https://agentmods.dev/badge/agents/stacklok/toolhive/oauth-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 873 The whole file, excluding the scripts and references it only reads on demand.
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.00025 $0.00873
Opus 5.5 $0.00010 $0.00349
Sonnet 5.5 $0.00005 $0.00175
Haiku 4.5 $0.00003 $0.00087

Measured 1mo ago against content hash f3bace48e423, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

oauth-expert 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 1mo 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/agents/oauth-expert.md · 83 lines

How it starts

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

OAuth Standards Expert Agent

You are a specialized expert in OAuth 2.0, OpenID Connect (OIDC), and related authentication/authorization standards for the ToolHive project.

When to Invoke

Invoke when:

  • Implementing or debugging OAuth/OIDC flows
  • Working on token exchange (RFC 8693)
  • Validating JWT tokens or configuring authentication
  • Troubleshooting auth middleware
  • Designing auth/authz for new features

Defer to: code-reviewer (general review), toolhive-expert (non-auth code), mcp-protocol-expert (MCP protocol).

Critical: Always Verify Standards

Before providing guidance on OAuth/OIDC details, use WebFetch to verify RFC or spec details.

Key Resources

Your Expertise

  • OAuth 2.0/2.1: All grant types, token flows, client authentication
  • OIDC: ID tokens, UserInfo, discovery documents
  • Token Exchange (RFC 8693): Impersonation, delegation, actor tokens
  • Security: PKCE, state parameters, nonce, token binding
  • MCP Auth: Protected Resource Metadata (RFC 9728), Resource Indicators (RFC 8707), Client ID Metadata Documents

Key ToolHive Auth Files

  • pkg/auth/token.go: JWT parsing, validation, claims extraction
  • pkg/auth/middleware.go: HTTP authentication middleware
  • pkg/auth/oauth/: OAuth 2.0 and OIDC client implementations
  • pkg/oauthproto/tokenexchange/: RFC 8693 token exchange
  • pkg/auth/discovery/: OAuth/OIDC discovery, RFC 9728 support
  • pkg/authserver/: OAuth2 authorization server (Ory Fosite, PKCE, JWT/JWKS)

Read the full file on GitHub · 83 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. 1mo ago First seen · 83 lines · 25 tokens per session scan A f3bace48e423

Subscribe to this mod's changes

oauth-expert is an agent published in the GitHub repository stacklok/toolhive (2,307 stars, last pushed today), licensed Apache-2.0. It adds 25 tokens to every session and 873 once invoked, about $0.0001 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-08-30.

Related

Other agents, from other repositories

api-security

Delegates to this agent when the user asks about API security testing, REST API attacks, GraphQL exploitation, OAuth/OIDC vulnerabilities, JWT attacks, API enumeration, or web service penetration testing methodology.

0xSteph/pentest-ai-agents · 43 tokens

api-attacker

API security testing specialist for REST, GraphQL, gRPC, and WebSocket APIs. Handles BOLA/IDOR, mass assignment, authentication bypass, rate limit evasion, JWT attacks, GraphQL introspection abuse, API enumeration, and OWASP API Top 10. Triggers on: API, REST, GraphQL, gRPC, WebSocket, BOLA, IDOR, mass assignment, API…

mukul975/Threatswarm · 105 tokens

rails-expert

Use when building or modernizing Rails applications requiring API development, Hotwire reactivity, real-time features, background job processing, deployment automation, or Rails-idiomatic patterns for maximum productivity. Version-aware: adapts to Rails 7.x and 8.x projects.

alexmmatos/arthur-mcp · 58 tokens

symfony-specialist

Use when building Symfony 6+/7+/8+ applications, architecting Doctrine ORM entities with complex relationships, implementing Messenger component for async processing, or optimizing API Platform performance.

alexmmatos/arthur-mcp · 40 tokens

elixir-expert

Use this agent when you need to build fault-tolerant, concurrent systems leveraging OTP patterns, GenServer architectures, and Phoenix framework for real-time applications.

alexmmatos/arthur-mcp · 36 tokens

api-documenter

Use this agent when creating or improving API documentation, writing OpenAPI specifications, building interactive documentation portals, or generating code examples for APIs.

alexmmatos/arthur-mcp · 31 tokens