mcp-access-oauth
Model Context Protocol (MCP) 서버 + Access OAuth
이것은 Access OAuth가 내장된 원격 MCP 연결을 지원하는 Model Context Protocol (MCP) 서버입니다.
자신의 Cloudflare 계정에 배포하고, Access for SaaS OIDC 앱을 생성한 후, 이를 기반으로 구축할 수 있는 완전한 기능의 원격 MCP 서버를 사용할 수 있습니다. 사용자는 연결된 Access Identity Provider로 로그인하여 MCP 서버에 연결할 수 있습니다.
MCP 서버(Cloudflare Workers 기반)는 다음과 같은 역할을 수행합니다:
MCP 클라이언트에 대한 OAuth 서버 역할
실제 OAuth 서버(이 경우 Access)에 대한 OAuth 클라이언트 역할
시작하기
저장소를 클론하고 종속성을 설치합니다: npm install
프로덕션용
새로운 Access for SaaS OIDC 앱을 생성합니다:
Authorization 콜백 URL에
https://mcp-access-oauth.<your-subdomain>.workers.dev/callback과 로컬 개발 시 사용할http://localhost:8788/callback을 지정합니다.클라이언트 ID와 클라이언트 시크릿을 기록합니다.
Wrangler를 통해 시크릿을 설정합니다.
wrangler secret put ACCESS_CLIENT_ID
wrangler secret put ACCESS_CLIENT_SECRET
wrangler secret put ACCESS_TOKEN_URL
wrangler secret put ACCESS_AUTHORIZATION_URL
wrangler secret put ACCESS_JWKS_URL
wrangler secret put COOKIE_ENCRYPTION_KEY # add any random string here e.g. openssl rand -hex 32KV 네임스페이스 설정
KV 네임스페이스를 생성합니다:
wrangler kv:namespace create "OAUTH_KV"Wrangler 파일을 KV ID로 업데이트합니다.
배포 및 테스트
MCP 서버를 배포하여 workers.dev 도메인에서 사용할 수 있게 합니다.
wrangler deploy
Inspector를 사용하여 원격 서버를 테스트합니다:
npx @modelcontextprotocol/inspector@latesthttps://mcp-access-oauth.<your-subdomain>.workers.dev/mcp를 입력하고 연결을 클릭합니다. 인증 흐름을 완료하면 Tools가 작동하는 것을 확인할 수 있습니다:
이제 원격 MCP 서버가 배포되었습니다!
접근 제어
이 MCP 서버는 인증을 위해 Access를 사용합니다. 모든 인증된 Access 사용자는 "add"와 같은 기본 도구에 접근할 수 있습니다.
"generateImage" 도구는 ALLOWED_USERNAMES 설정에 나열된 특정 Access 사용자로 제한됩니다:
// Add user emails for image generation access
const ALLOWED_EMAILS = new Set(["employee1@mycompany.com", "teammate1@mycompany.com"]);Claude Desktop에서 원격 MCP 서버에 접근하기
Claude Desktop을 열고 Settings -> Developer -> Edit Config로 이동합니다. 그러면 Claude가 접근할 수 있는 MCP 서버를 제어하는 설정 파일이 열립니다.
내용을 다음 설정으로 교체합니다. Claude Desktop을 다시 시작하면 OAuth 로그인 페이지가 있는 브라우저 창이 열립니다. 인증 흐름을 완료하여 Claude에 MCP 서버 접근 권한을 부여합니다. 권한을 부여하면 도구를 사용할 수 있게 됩니다.
{
"mcpServers": {
"math": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp-access-oauth.<your-subdomain>.workers.dev/mcp"
]
}
}
}Tools(🔨 아래)가 인터페이스에 나타나면 Claude에게 사용을 요청할 수 있습니다. 예: "수학 도구를 사용하여 23과 19를 더해줄래요?" 그러면 Claude가 도구를 호출하고 MCP 서버가 생성한 결과를 표시합니다.
로컬 개발용
MCP 서버를 반복적으로 개발하고 테스트하려면 로컬 개발 환경에서 수행할 수 있습니다.
Homepage URL에
http://localhost:8788을 지정합니다.Authorization 콜백 URL에
http://localhost:8788/callback을 지정합니다.클라이언트 ID를 기록하고 클라이언트 시크릿을 생성합니다.
프로젝트 루트에
.dev.vars파일을 생성하고 다음 내용을 입력합니다:
ACCESS_CLIENT_ID=<your client id>
ACCESS_CLIENT_SECRET=<your client secret>
ACCESS_TOKEN_URL=<your Access for SaaS token url>
ACCESS_AUTHORIZATION_URL=<your Access for SaaS authorization url>
ACCESS_JWKS_URL=<your Access for SaaS JWKS url>
COOKIE_ENCRYPTION_KEY=COOKIE_ENCRYPTION_KEY개발 및 테스트
서버를 로컬에서 실행하여 http://localhost:8788에서 사용할 수 있게 합니다.
wrangler dev
로컬 서버를 테스트하려면 Inspector에 http://localhost:8788/mcp를 입력하고 연결을 클릭합니다. 프롬프트를 따라가면 "List Tools"를 사용할 수 있습니다.
Claude 및 기타 MCP 클라이언트 사용
Claude를 사용하여 원격 MCP 서버에 연결할 때 일부 오류 메시지가 표시될 수 있습니다. 이는 Claude Desktop이 아직 원격 MCP 서버를 완전히 지원하지 않아 가끔 혼동하기 때문입니다. MCP 서버가 연결되었는지 확인하려면 Claude 인터페이스 오른쪽 하단의 🔨 아이콘 위에 마우스를 올리면 도구를 사용할 수 있는지 확인할 수 있습니다.
Cursor 및 기타 MCP 클라이언트 사용
Cursor를 MCP 서버에 연결하려면 Type: "Command"를 선택하고 Command 필드에 명령어와 인수를 하나로 결합하여 입력합니다(예: npx mcp-remote https://<your-worker-name>.<your-subdomain>.workers.dev/mcp).
Cursor는 HTTP+SSE 서버를 지원하지만 인증은 지원하지 않으므로 여전히 mcp-remote를 사용해야 합니다(그리고 HTTP 서버가 아닌 STDIO 서버를 사용해야 합니다).
Windsurf와 같은 다른 MCP 클라이언트에 MCP 서버를 연결하려면 클라이언트의 설정 파일을 열고 Claude 설정에 사용된 것과 동일한 JSON을 추가한 후 MCP 클라이언트를 다시 시작하면 됩니다.
Related MCP server: MCP Access OAuth Server
작동 방식
OAuth 제공자
OAuth 제공자 라이브러리는 Cloudflare Workers를 위한 완전한 OAuth 2.1 서버 구현체입니다. 토큰 발급, 검증 및 관리를 포함한 OAuth 흐름의 복잡성을 처리합니다. 이 프로젝트에서는 다음과 같은 이중 역할을 수행합니다:
서버에 연결하는 MCP 클라이언트 인증
Access의 OAuth 서비스에 대한 연결 관리
KV 스토리지에 토큰 및 인증 상태를 안전하게 저장
Durable MCP
Durable MCP는 Cloudflare의 Durable Objects로 기본 MCP 기능을 확장하여 다음을 제공합니다:
MCP 서버의 지속적인 상태 관리
요청 간 인증 컨텍스트의 안전한 저장
this.props를 통한 인증된 사용자 정보 접근사용자 신원에 기반한 조건부 도구 사용 가능 지원
MCP Remote
MCP Remote 라이브러리는 Inspector와 같은 MCP 클라이언트가 호출할 수 있는 도구를 서버가 노출할 수 있게 합니다:
클라이언트와 서버 간 통신 프로토콜 정의
도구를 정의하는 구조화된 방법 제공
요청 및 응답의 직렬화 및 역직렬화 처리
클라이언트와 서버 간 Server-Sent Events (SSE) 연결 유지
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
- Flicense-qualityDmaintenanceA reference MCP server for Cloudflare Workers that provides remote connection support with integrated GitHub OAuth authentication. It enables developers to build and deploy authenticated remote tools with user-specific access controls and persistent state management.
- Flicense-qualityCmaintenanceA Cloudflare Workers-based MCP server that enables secure remote connections using built-in OAuth authentication via Cloudflare Access. It provides identity-based access control for MCP tools and supports persistent state management through Durable Objects and SSE.
- Flicense-qualityDmaintenanceDeployable MCP server with Google OAuth for remote connections, enabling authenticated tool access via Cloudflare Workers.
- Flicense-qualityCmaintenanceRemote MCP server with built-in OAuth authentication via Cloudflare Access, enabling secure tool access and user identity-based restrictions.
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Cloudflare Workers MCP server: email-validator
Cloud-hosted MCP server for durable AI memory
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/rodolfostoicus/mcp-access-oauth'
If you have feedback or need assistance with the MCP directory API, please join our Discord server