ai icon indicating copy to clipboard operation
ai copied to clipboard

Remote MCP Server with Atlassian OAuth Integration

Open eleiton opened this issue 3 months ago • 1 comments

Summary

This PR introduces a comprehensive demo implementation of a remote Model Context Protocol (MCP) server with integrated Atlassian OAuth authentication, deployed on Cloudflare Workers.

What's Added

New Demo Directory: demos/remote-mcp-atlassian-oauth/

A complete working example that demonstrates:

  • Remote MCP Server: A production-ready MCP server that can be deployed to Cloudflare Workers
  • OAuth Integration: Full OAuth 2.0 flow implementation using Atlassian as the identity provider
  • Authentication: Secure user authentication with token management via Cloudflare KV storage
  • Tool Implementation: Sample MCP tools including user information retrieval from Confluence

Key Components

  1. Main Server (src/index.ts): MCP server implementation with tool definitions
  2. OAuth Handler (src/atlassian-handler.ts): Atlassian-specific OAuth client implementation
  3. OAuth Utils (src/workers-oauth-utils.ts): OAuth provider utilities for Cloudflare Workers
  4. Configuration: Complete deployment configuration for Cloudflare Workers

Features

  • Dual OAuth Role: Acts as both OAuth server (for MCP clients) and OAuth client (for Atlassian)
  • Secure Token Storage: Uses Cloudflare KV for persistent authentication state
  • Production Ready: Includes both development and production deployment configurations
  • Client Integration: Compatible with Claude Desktop, Cursor, and other MCP clients
  • Comprehensive Documentation: Detailed setup and deployment instructions

Tools Provided

  • add: Demo tool for adding two numbers
  • getUserInfo: Retrieves current user information from Confluence

Technical Implementation

  • Built on Cloudflare Workers for serverless deployment
  • Uses @cloudflare/workers-oauth-provider for OAuth 2.1 server implementation
  • Integrates with MCP SDK for protocol compliance
  • Server-Sent Events (SSE) for real-time client communication
  • TypeScript with comprehensive type definitions

Use Cases

This demo serves as a reference implementation for:

  • Building remote MCP servers with OAuth authentication
  • Integrating third-party OAuth providers with MCP
  • Deploying MCP servers on Cloudflare Workers
  • Creating secure, multi-tenant MCP services

Files Changed

  • 11 new files added
  • 13,542 total lines added
  • Complete new demo directory structure

This implementation provides a solid foundation for developers looking to create secure, remotely accessible MCP servers with enterprise authentication.

eleiton avatar Aug 13 '25 21:08 eleiton