# remote-mcp-server-with-auth

remote-mcp-server-with-auth is a Claude Code skill for building and deploying a Cloudflare Workers MCP server with GitHub OAuth and PostgreSQL. It supports role-based permissions.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 168 installs · ★ 9 repo stars
- Author: reason-machines
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/reason-machines/mcp-skills/tree/HEAD/skills/remote-mcp-server-with-auth/SKILL.md
- Updated: 2026-10-09
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/remote-mcp-server-with-auth

## What it does

This skill guides you through a Cloudflare Workers MCP server where users authenticate through GitHub OAuth and tools can access PostgreSQL. Clients can connect over streamable HTTP at `/mcp` or the legacy SSE endpoint at `/sse`. Tool implementations live in separate files under `src/tools/`; the examples include schema inspection and read-only queries.

A GitHub username allowlist in `src/index.ts` controls database write access. Query checks restrict the read-only tool, and the database connection is shared across tool calls. Deployment requires GitHub OAuth credentials, a cookie encryption key, `DATABASE_URL`, and a Cloudflare login through `wrangler login`. The server cannot authenticate users or connect to the database until those credentials and secrets are configured.

## Requirements
- Works with: GitHub, PostgreSQL

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill remote-mcp-server-with-auth -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/remote-mcp-server-with-auth/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/remote-mcp-server-with-auth/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill remote-mcp-server-with-auth -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/remote-mcp-server-with-auth/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill remote-mcp-server-with-auth -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/remote-mcp-server-with-auth/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install reason-machines/mcp-skills skills/remote-mcp-server-with-auth
```

2. **Manually: put the files in place**
- File: `.github/skills/remote-mcp-server-with-auth/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill remote-mcp-server-with-auth -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/reason-machines/mcp-skills --path skills/remote-mcp-server-with-auth
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/remote-mcp-server-with-auth/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill remote-mcp-server-with-auth -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/reason-machines/mcp-skills/tree/HEAD/skills/remote-mcp-server-with-auth/SKILL.md

## When to use it
- deploy a remote MCP server on Cloudflare Workers
- add GitHub OAuth sign-in to an MCP server
- limit PostgreSQL write access by GitHub username
- separate database tools into individual files
- offer HTTP and SSE endpoints for MCP clients

## Example prompts
- Create a remote MCP server with GitHub sign-in and PostgreSQL access.
- Set up an MCP server on Cloudflare Workers with HTTP transport and a GitHub username allowlist for writes.
- Add an MCP tool that lists the PostgreSQL schema and describe how to connect to it.

## Similar
- [better-auth](https://affpapa.org/en/nevibecode/skills/better-auth.md) — skill · 3800 installs
- [neon-auth-specialist](https://affpapa.org/en/nevibecode/agents/neon-auth-specialist.md) — subagent · 387 installs
- [neon-auth](https://affpapa.org/en/nevibecode/skills/neon-auth.md) — skill · 38600 installs
- [backend-development](https://affpapa.org/en/nevibecode/skills/backend-development.md) — skill · 2400 installs
- [briq](https://affpapa.org/en/nevibecode/mcp/briq.md) — MCP server · ★ 2 repo stars
- [wren](https://affpapa.org/en/nevibecode/skills/wren.md) — skill · 1700 installs

From the same set: [reason-machines/mcp-skills](https://affpapa.org/en/nevibecode/by/reason-machines/mcp-skills.md) — 98 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
