OAuth 2.1, Dynamic Client Registration & Agent Token Lifecycle for Remote MCP
How modern remote MCP servers secure AI agents with OAuth 2.1, RFC 9728 Protected Resource Metadata, Dynamic Client Registration, scoped revocable tokens, and server-side credential injection.
Stop pasting static supplier API keys into local MCP configs—issue short-lived, revocable OAuth 2.1 agent tokens while keeping upstream credentials sealed inside a server-side encrypted vault.
Why static API keys fail for team AI agents
Copying raw GitHub, Supabase, or data-vendor keys into ~/.cursor/mcp.json or ~/.claude.json on every laptop breaks least privilege, leaves stale secrets when teammates leave, and exposes keys to prompt injection.
- Local plaintext files cannot be rotated centrally across developer machines.
- Agents with direct upstream credentials can exceed intended scopes or leak tokens into transcripts.
- Auditing which agent made which external call is impossible when everyone shares one static vendor key.
How OAuth 2.1 + Protected Resource Metadata works in MCP
When an MCP client connects to https://api.duang.ai/mcp without a token, the server responds with HTTP 401 and a WWW-Authenticate header pointing to RFC 9728 resource metadata. The client discovers the authorization server, registers dynamically, and opens a browser consent flow where a human chooses the team and approves access.
curl -s https://api.duang.ai/.well-known/oauth-protected-resource/mcpTwo-tier token boundary & instant revocation
Duang separates the agent's revocable session token from the team's encrypted supplier credentials. Upstream keys are decrypted only on the server during outbound dispatch and can be disconnected in one click—with zero silent fallback to another account or paid wallet if a team connection expires.
Try live capabilities right now.
Connect to your AI agent in 60 seconds.
Read https://duang.ai/SKILL.md and use duang to run google.serp.organic.
Frequently asked questions
Does Duang support OAuth 2.1 Dynamic Client Registration?
Yes. Duang exposes RFC 9728 resource metadata and an OAuth 2.1 registration endpoint so Claude Code, Cursor, and Claude Desktop connect with one URL and no manual OAuth app setup.
Can I revoke an agent's access without rotating all our provider keys?
Yes. Revoking an agent grant or team key immediately cuts off that client while your encrypted upstream provider connections stay untouched.
What happens if a team OAuth connection expires while an agent is running?
Duang halts the call and returns a reconnect link for a human teammate. It never silently switches to another provider or charges your prepaid cloud wallet.