Skip to main content

GitHub MCP Server

The GitHub MCP server lets your AI agents interact with GitHub repositories, issues, pull requests, code, branches, and commits. Unlike other MCP server integrations that use traditional OAuth apps, GitHub uses a GitHub App, which provides fine-grained permissions and organization-level control over which repositories the app can access.

Capabilities

CategoryWhat Agents Can Do
RepositoriesList repos, search code, view file contents, create and manage branches, list commits and tags, fork repositories
IssuesSearch, create, update, and comment on issues
Pull RequestsCreate, review, update, and merge pull requests; list changed files; add review comments
Commit StatusView CI/CD build status for commits
TeamsList organization teams and their members

OAuth Setup

The GitHub integration uses a GitHub App for authentication. GitHub Apps provide finer-grained permissions than traditional OAuth apps — you choose exactly what the app can do, and organization admins control which repositories it can access.

📝 Note: GitHub Apps do not use scopes like other OAuth services. Instead, permissions are configured directly on the app when you create it. The OAuth token automatically inherits the permissions defined on the app.

Step 1: Create a GitHub App

  1. Go to github.com and click your profile picture > Settings.

  2. In the left sidebar, click Developer settings > GitHub Apps > New GitHub App.

    • To create under an organization: go to the organization's Settings > Developer settings > GitHub Apps > New GitHub App.
  3. Fill in the basic information:

FieldWhat to Enter
GitHub App nameA unique name, for example "Devs AI"
DescriptionOptional description of the integration
Homepage URLYour Devs.ai instance URL

Step 2: Configure the Callback URL

  1. Under Identifying and authorizing users, enter the Callback URL provided by your Devs.ai platform administrator.
  2. Check Request user authorization (OAuth) during installation.
  3. Leave Expire user authorization tokens checked (recommended for security).

Step 3: Disable Webhooks

Under Webhook, uncheck the Active checkbox. The MCP server does not require webhook events.

Step 4: Set Permissions

Under Permissions, configure the following and leave everything else as "No access":

Repository Permissions:

PermissionAccess LevelWhat It Enables
ContentsRead & WriteRead and write file contents, manage branches, list commits and tags
IssuesRead & WriteView, create, update, and comment on issues
Pull requestsRead & WriteCreate, review, update, and merge pull requests
Commit statusesRead-onlyView CI/CD build status
MetadataRead-onlyBasic repository information and search (automatically selected)

Organization Permissions:

PermissionAccess LevelWhat It Enables
MembersRead-onlyList teams and team members

Step 5: Set Installation Scope

Under Where can this GitHub App be installed?, select:

  • Any account — to allow other organizations to install the app.
  • Only on this account — if you only need it for your own organization.

Step 6: Create and Save Credentials

  1. Click Create GitHub App.
  2. On the app settings page, copy the Client ID (displayed under "About").
  3. Click Generate a new client secret and copy the secret immediately — it is only shown once.

Step 7: Install the App on Your Organization

  1. Go to https://github.com/apps/YOUR-APP-SLUG (the slug is the lowercase, hyphenated version of your app name).
  2. Click Install.
  3. Choose the organization.
  4. Select All repositories or Only select repositories to control access.
  5. Click Install.

📝 Note: An organization admin must install the GitHub App. The admin decides which repositories the app can access. This provides an additional layer of security beyond user-level permissions.

Step 8: Configure in Devs.ai

  1. Navigate to Organization > Connectors in Devs.ai.
  2. Find the GitHub template and click Enable.
  3. Select OAuth as the authentication type.
  4. Enter your Client ID and Client Secret from Step 6.
  5. Select the tools you want to make available.
  6. Click Save.

Token Expiration

GitHub App tokens can be configured to expire or persist:

SettingBehavior
Expiration enabled (default)Tokens expire after 8 hours. The platform automatically refreshes them using a refresh token.
Expiration opted outTokens never expire. No refresh is needed.

To change this setting, go to your GitHub App's settings > Optional features > User-to-server token expiration.

OAuth Configuration Reference

FieldValue
Authorization URLhttps://github.com/login/oauth/authorize
Token URLhttps://github.com/login/oauth/access_token
ScopesNone (permissions are set on the GitHub App)

Additional Resources

⌘J