home / mcp / github mcp server

GitHub MCP Server

Provides a remote MCP server authenticated via GitHub OAuth, exposing tools for interactive computation and user information.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "julian-figueroa-mcp-cloudflare-oauth": {
      "url": "https://mcp-github-oauth.<your-subdomain>.workers.dev/sse",
      "headers": {
        "GITHUB_CLIENT_ID": "<your-client-id> (set in production)",
        "GITHUB_CLIENT_SECRET": "<your-client-secret> (set in production)",
        "COOKIE_ENCRYPTION_KEY": "<random-string> (set in production)"
      }
    }
  }
}

This MCP server enables remote Model Context Protocol connections with GitHub OAuth built in. You can deploy it to your own Cloudflare account, connect users via GitHub login, and expose tools to MCP clients such as inspectors and chatbots. It provides a practical, self-hosted way to offer authenticated MCP tools to collaborators and applications.

How to use

Authenticate to your remote MCP server using GitHub. After signing in, you gain access to tools that your server exposes, with the specific tools and their access controlled by you. You can test the remote server with the Inspector to verify the server is reachable and that authentication flows complete correctly.

How to install

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

1) Install dependencies or create the remote MCP server project using the provided template.

2) Set up GitHub OAuth credentials in production. Create a GitHub OAuth App and note the Client ID and Client Secret. Also generate a random string for COOKIE_ENCRYPTION_KEY.

3) Configure secrets and KeeP KV namespace as shown.

4) Deploy and test using Wrangler and the provided commands.

Access and configuration notes

Access to the remote MCP server is controlled by GitHub OAuth. All authenticated GitHub users can access basic tools such as add and userInfoOctokit. The generateImage tool is restricted to specific GitHub usernames listed in ALLOWED_USERNAMES.

To use the server from Claude Desktop, you configure the MCP server in Claude’s settings and then sign in through the OAuth flow to grant Claude access. After authentication, the tools become available in Claude’s interface.

For local development, you can run a development OAuth flow with a local GitHub OAuth App and test against http://localhost:8788. You can test the local server with the Inspector using http://localhost:8788/sse.

Security and access control

The server uses OAuth to authenticate MCP clients and securely stores tokens in KV. Access to specific tools can be restricted by user identity, such as allowing image generation only for certain GitHub usernames.

Testing with Inspector and clients

Test the remote MCP server from the Inspector using the SSE endpoint. After you complete the OAuth flow, you can list available tools and verify responses.

Available tools

add

Add numbers or values as part of a tool operation available to authenticated users.

userInfoOctokit

Fetch authenticated user information using Octokit bindings.

generateImage

Generate images using a restricted tool available only to allowed GitHub usernames.