home / mcp / github mcp server

Github MCP Server

dnd mcp server

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ariencarnacion-dnd-mcp": {
      "url": "https://mcp-github-oauth.<your-subdomain>.workers.dev/sse",
      "headers": {
        "GITHUB_CLIENT_ID": "YOUR_GITHUB_CLIENT_ID",
        "GITHUB_CLIENT_SECRET": "YOUR_GITHUB_CLIENT_SECRET",
        "COOKIE_ENCRYPTION_KEY": "YOUR_COOKIE_ENCRYPTION_KEY"
      }
    }
  }
}

This MCP server provides remote MCP connections with built‑in GitHub OAuth, allowing users to sign in with their GitHub accounts and access tools hosted on your own secure Cloudflare Worker. It enables you to deploy a remote MCP server that clients can authenticate to and invoke tools from, while you control access via GitHub identities.

How to use

You connect to your MCP server from your MCP client by logging in with GitHub. Once authenticated, you can list available tools, run actions, and receive results from the server. Tools can be restricted by user identity, so you can control who has access to sensitive capabilities like image generation. To test your setup after deployment, use your MCP client to connect to the SSE endpoint provided by your server and complete the OAuth flow to unlock the tools.

How to install

Prerequisites: ensure you have Node.js and npm installed on your machine.

Install dependencies and set up your MCP server: - Install dependencies - Create a new Cloudflare-based project using the remote MCP template - Configure GitHub OAuth and KV storage - Deploy and test with the Inspector tool

Step-by-step commands you can run:

npm install

# Or create the remote MCP server scaffold locally
npm create cloudflare@latest -- my-mcp-server --template=cloudflare/ai/demos/remote-mcp-github-oauth

# Production setup involves creating a GitHub OAuth App, setting secrets, and deploying
# 1) Create GitHub OAuth App on GitHub with the appropriate URLs
# 2) Save client credentials as Wrangler secrets
wrangler secret put GITHUB_CLIENT_ID
wrangler secret put GITHUB_CLIENT_SECRET
wrangler secret put COOKIE_ENCRYPTION_KEY # add any random string here

# 3) Create a KV namespace for OAuth state storage
wrangler kv namespace create "OAUTH_KV"
# Update Wrangler config with the KV namespace ID

# 4) Deploy to Cloudflare Workers
wrangler deploy

# Optional: test with Inspector
npx @modelcontextprotocol/inspector@latest

# For local development
# 5) Run the server locally
wrangler dev

# 6) Test locally with Inspector
# open http://localhost:8788/sse in Inspector

Additional sections

Configuration and access control are described below. The server authenticates MCP clients via GitHub OAuth and restricts certain tools to specified users. The example shows how to allow a subset of GitHub usernames to access image generation while keeping general tools available to all authenticated users.

Security notes: store OAuth credentials securely as Wrangler secrets and use a strong cookie encryption key. When testing locally, mirror production URLs to ensure you cover the same flow and edge cases.

Testing workflow: deploy the server, connect with an MCP client using the SSE URL, complete OAuth authentication, and verify that the Tools become available and respond correctly. If a client shows authentication or tool access issues, recheck the GitHub OAuth App configuration, secrets, and the list of allowed usernames.

Available tools

add

Adds an item or value through the MCP server tools.

userInfoOctokit

Fetches authenticated user information using Octokit for the current session.

generateImage

Generates an image using the allowed GitHub users and configured image model.

inspector

Provides an interface to test and inspect MCP tools via the Inspector client.

Github MCP Server - ariencarnacion/dnd-mcp