mcp-oauth2-token-provider
mcp-oauth2-token-provider
AI IDE와 원격 MCP 엔드포인트 간의 인증 프록시 역할을 하는 범용 MCP(Model Context Protocol) 서버입니다. OAuth2 client_credentials 토큰 생성을 내부적으로 처리하고 모든 프록시 요청에 bearer 토큰을 투명하게 주입합니다.
기능
투명한 OAuth2 프록시 — 토큰 획득, 캐싱, 자동 갱신
동적 도구 검색 — 하드코딩된 도구 스키마 없음; 원격 MCP 엔드포인트에서 도구 검색
401 자동 재시도 — 세션 중 토큰이 만료되면 갱신 후 한 번 재시도
시작 시 상태 확인 — 연결 전에 원격 MCP에 접근 가능한지 확인하고, 명확한 오류 메시지와 함께 빠르게 실패
토큰 영속화 — 프로세스 재시작 후에도 유지되도록 토큰을
~/.oauth2-token-provider/token.json에 디스크로 캐싱코드 내 설정 불필요 — 모든 설정은 환경 변수로 처리
SSE 및 JSON 응답 지원 — 원격의 Streamable HTTP와 일반 JSON-RPC를 모두 처리
Related MCP server: MCP OAuth Proxy
설치
npx mcp-oauth2-token-provider또는 전역 설치:
npm install -g mcp-oauth2-token-providerKiro / VS Code MCP에서 사용
.kiro/settings/mcp.json(또는 이에 상응하는 파일)에 다음을 추가하세요:
{
"mcpServers": {
"my-remote-server": {
"command": "npx",
"args": ["mcp-oauth2-token-provider"],
"env": {
"REMOTE_MCP_URL": "https://your-server.com/mcp",
"OAUTH2_TOKEN_URL": "https://your-sso.com/token.oauth2",
"OAUTH2_CLIENT_ID": "your-client-id",
"OAUTH2_CLIENT_SECRET": "your-client-secret"
}
}
}
}환경 변수
변수 | 필수 | 설명 |
| 예 | 프록시할 원격 MCP 엔드포인트 URL |
| 예 | OAuth2 토큰 엔드포인트(client_credentials 권한 부여) |
| 예 | OAuth2 클라이언트 ID |
| 예 | OAuth2 클라이언트 시크릿 |
| 아니요 | 기본 인증 사용자 이름(이중 자격 증명 SSO용) |
| 아니요 | 기본 인증 비밀번호(이중 자격 증명 SSO용) |
작동 방식
AI IDE ←stdio→ [mcp-oauth2-token-provider] ←HTTP+Bearer→ [Remote MCP Server]
│
├─ Acquires OAuth2 token (client_credentials)
├─ Caches in memory + ~/.oauth2-token-provider/token.json
├─ Injects Bearer header on every request
├─ Auto-refreshes on expiry (60s safety margin)
└─ Retries once on 401 with fresh token시작 시 원격 MCP 엔드포인트에 접근 가능한지 확인합니다(MCP
initialize전송)원격에 접근할 수 없으면 오류와 함께 종료합니다(IDE에 "Failed" 상태 표시)
상태가 정상이면 stdio를 통해 IDE에 연결하고 원격에서 도구를 검색합니다
모든 도구 호출은 bearer 토큰과 함께 투명하게 프록시됩니다
토큰 캐싱
토큰은 두 계층으로 캐싱됩니다:
인메모리 — 가장 빠르며, 프로세스 재시작 시 손실
디스크 —
~/.oauth2-token-provider/token.json, 재시작 후에도 유지
토큰은 다음 경우에 갱신됩니다:
만료 60초 이내인 경우
원격에서 401 응답을 받은 경우
이중 자격 증명 SSO(선택 사항)
일부 SSO 제공업체는 다음을 모두 요구합니다:
요청 본문에
client_id+client_secret서비스 계정 자격 증명이 포함된 Basic Auth 헤더
이 패턴을 활성화하려면 OAUTH2_BASIC_USERNAME 및 OAUTH2_BASIC_PASSWORD를 설정하세요.
라이선스
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceProxies MCP requests from Cursor IDE to a custom HTTP server, enabling custom tool integrations.121ISC
- Alicense-qualityBmaintenanceActs as a secure OAuth 2.0/2.1 proxy gateway for MCP servers, enabling integration with Claude and ChatGPT platforms.12MIT
- Alicense-qualityCmaintenanceAuthenticating reverse proxy for MCP servers providing credential isolation, OAuth2 token management, and composite tool aggregation.BSD Zero Clause
- Alicense-qualityCmaintenanceProvides a Streamable HTTP MCP proxy for VS Code Copilot and Claude Code, using JWT client assertion to securely access NetSuite APIs.MIT
Related MCP Connectors
MCP server for Argo RPG Platform — connects AI assistants to campaign data via OAuth2
MCP server for verifying EUDI/Talao wallet data via OIDC4VP (pull) for AI agents.
MCP Hub: AI service discovery, per-user OAuth, and multi-service workflow orchestration
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/codezerowork/mcp-oauth2-token-provider'
If you have feedback or need assistance with the MCP directory API, please join our Discord server