github-oauth-mcp

github-oauth-mcp

4

This project provides a minimal example of a Model Context Protocol (MCP) server implementing GitHub OAuth. It is not suitable for production usage, and users must ensure secure practices when adopting this implementation.

🔒 Minimal GitHub OAuth-enabled MCP Server

Minimal MCP server showing how to potentially implement GitHub OAuth with an MCP server.

[!IMPORTANT] This repository has been archived. Refer to the reference collection for latest samples and best practices.

[!WARNING] This is not intended for production use. If you are to adopt any of the practices in this implementation, ensure that you are implementing proper caching and secure token/credential handling practices.

GitHub application registration

Prior to using this MCP server, make sure that you have a GitHub App you can use for testing. You can register one in your GitHub settings.

Registering an application in GitHub

Once the app is registered, make sure to generate a new secret.

Generate a new secret for your GitHub application

With the client ID and secret handy, create a new .env file in the root of this project, and add:

GITHUB_CLIENT_ID=YOUR_CLIENT_ID
GITHUB_CLIENT_SECRET=YOUR_SECRET

Run server

npm install
npm run build
npm run start

Testing

You will need to use MCP Inspector or a tool that supports HTTP+SSE transport for MCP servers and authentication.