{"repo":"dzhng/mcp-client-auth","free":true,"listed":false,"github":"https://github.com/dzhng/mcp-client-auth","clone":"git clone https://github.com/dzhng/mcp-client-auth.git","description":"A TypeScript library providing OAuth2 authentication utilities for Model Context Protocol (MCP) clients. This library simplifies the process of adding OAuth authentication to MCP client implementations.","language":"TypeScript","stars":37,"topics":[],"license":"MIT","category":"mcp-servers","readme_excerpt":"MCP Client Auth A TypeScript library providing OAuth2 authentication utilities for Model Context Protocol (MCP) clients. This library simplifies the process of adding OAuth authentication to MCP client implementations. MCP OAuth is extra tricky because the dynamic client registration and metadata discovery steps are not supported by typical oauth implementations. This library simplifies everything to 2 function calls. If you like this project, please consider starring it and giving me a follow on X/Twitter. This project is sponsored by Aomni. Features Key capabilities: - 🔐 Complete OAuth2 Flow : Implements the standard OAuth2 authorization code flow with PKCE - 🚀 MCP Client Integration : Drop-in OAuth support for MCP clients - 📦 Zero Configuration : Automatic server metadata discovery and dynamic client registration - 🌐 Smart Transport Selection : Automatic fallback from StreamableHTTP to SSE transport for maximum compatibility - 🔄 Token Management : Automatic token refresh and secure storage (via pluggable storage interface) - 🎯 TypeScript First : Full type safety and IntelliSense support Installation Quick Start Using the High-Level MCP Client Init the client There are only 2 methods that are needed to connect to a MCP server (and handle OAuth if needed). Checking for auth status The isAuthRequired() method returns an AuthStatus object that indicates the authentication state. This status can be one of three types: 1. { isRequired: true, isAuthenticated: false, authori","default_branch":null,"files":null,"tree":[],"storefront":"/r/dzhng","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/dzhng/mcp-client-auth/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}