oauth-mcp-server

dgmulei/oauth-mcp-server

3.2

If you are the rightful owner of oauth-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A minimal OAuth-compliant MCP server designed to work with Claude Web's 'Connect' button.

Tools
2
Resources
0
Prompts
0

OAuth MCP Server

A minimal OAuth-compliant MCP (Model Context Protocol) server designed to work with Claude Web's "Connect" button.

Goal

Get Claude Web to connect via the "Connect" button and show "Connected" status.

Architecture

  • Platform: Cloudflare Workers
  • Transport: Server-Sent Events (SSE)
  • Authentication: OAuth 2.0 with PKCE
  • Protocol: MCP (Model Context Protocol)

Project Structure

oauth-mcp-server/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ index.ts           # Main worker entry point
│   ā”œā”€ā”€ oauth/             # OAuth implementation
│   │   ā”œā”€ā”€ endpoints.ts   # OAuth endpoints (/authorize, /token, etc.)
│   │   └── utils.ts       # JWT utilities, crypto functions
│   ā”œā”€ā”€ mcp/               # MCP protocol implementation
│   │   ā”œā”€ā”€ protocol.ts    # MCP message handling
│   │   ā”œā”€ā”€ tools.ts       # Minimal tools (echo, ping)
│   │   └── transport.ts   # SSE transport layer
│   └── types.ts           # TypeScript type definitions
ā”œā”€ā”€ wrangler.toml          # Cloudflare Workers configuration
ā”œā”€ā”€ package.json           # Dependencies and scripts
ā”œā”€ā”€ tsconfig.json          # TypeScript configuration
└── deployment.md          # Deployment instructions for Windsurf

Development Setup

  1. Install dependencies:

    npm install
    
  2. Set up Cloudflare environment:

    npx wrangler login
    
  3. Set secrets:

    npx wrangler secret put JWT_SECRET
    
  4. Run locally:

    npm run dev
    
  5. Deploy:

    npm run deploy
    

Testing with Claude Web

  1. Deploy the worker to get your URL
  2. In Claude Web, click "Connect"
  3. Use your worker URL as the server endpoint
  4. Complete OAuth flow
  5. Verify "Connected" status appears

Next Steps for Windsurf

See deployment.md for detailed deployment and testing instructions.