﻿---
title: GitHub connector
description: Use the GitHub data source to search code, issues, and pull requests, retrieve file contents, and access repository metadata using the GitHub API.
url: https://docs-v3-preview.elastic.dev/elastic/kibana/pull/280898/reference/connectors-kibana/github-action-type
products:
  - Kibana
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview since 9.4
---

# GitHub connector
The GitHub data source connects to GitHub through the GitHub MCP server. It provides search across code, repositories, issues, pull requests, and users. It also provides access to commits, branches, tags, releases, teams, and file contents. It supports two authentication methods: Bearer token (personal access token) and OAuth Authorization Code.

## Create connectors in Kibana

You can create connectors in **Stack Management > Connectors**.

### Connector configuration

GitHub connectors have the following configuration properties:
<definitions>
  <definition term="MCP Server URL">
    The URL of the GitHub MCP server. Defaults to `https://api.githubcopilot.com/mcp/`.
  </definition>
  <definition term="Authentication">
    Choose one of the following authentication methods:
    - **Bearer Token**: A GitHub personal access token. Refer to [Get API credentials](#github-api-credentials) for instructions.
    - **OAuth Authorization Code**: Connects via GitHub's OAuth flow. Requires a GitHub OAuth App with an authorization URL (`https://github.com/login/oauth/authorize`) and token URL (`https://github.com/login/oauth/access_token`). The default scope is `repo`. Refer to [OAuth credentials](#github-oauth-credentials) for setup instructions.
  </definition>
</definitions>


## Test connectors

You can test connectors when you create or edit the connector in Kibana.
The GitHub connector exposes the following actions:
<definitions>
  <definition term="getMe">
    Get the authenticated GitHub user's profile information.
  </definition>
  <definition term="searchCode">
    Search for code across GitHub repositories.
  </definition>
  <definition term="searchRepositories">
    Search for GitHub repositories.
  </definition>
  <definition term="searchIssues">
    Search for issues across GitHub repositories.
  </definition>
  <definition term="searchPullRequests">
    Search for pull requests across GitHub repositories.
  </definition>
  <definition term="searchUsers">
    Search for GitHub users.
  </definition>
  <definition term="listIssues">
    List issues in a repository. Uses cursor-based pagination.
  </definition>
  <definition term="listPullRequests">
    List pull requests in a repository. Uses cursor-based pagination.
  </definition>
  <definition term="listCommits">
    List commits in a repository. Uses cursor-based pagination.
  </definition>
  <definition term="listBranches">
    List branches in a repository. Uses cursor-based pagination.
  </definition>
  <definition term="listTags">
    List tags in a repository. Uses cursor-based pagination.
  </definition>
  <definition term="listReleases">
    List releases in a repository. Uses cursor-based pagination.
  </definition>
  <definition term="getCommit">
    Get details of a specific commit.
  </definition>
  <definition term="getLatestRelease">
    Get the latest release for a repository.
  </definition>
  <definition term="pullRequestRead">
    Read the details of a specific pull request.
  </definition>
  <definition term="getFileContents">
    Get the contents of a file or directory from a GitHub repository.
  </definition>
  <definition term="getIssue">
    Get details of a specific issue in a repository.
  </definition>
  <definition term="getIssueComments">
    Get comments for a specific issue in a repository.
  </definition>
  <definition term="listTools">
    List all tools available on the GitHub MCP server. Use this to discover available capabilities.
  </definition>
  <definition term="callTool">
    Call any tool on the GitHub MCP server directly by name. Use this as an escape hatch when a specific tool is not yet exposed as a named action.
  </definition>
</definitions>


## Connector networking configuration

Use the [Action configuration settings](/elastic/kibana/pull/280898/reference/configuration-reference/alerting-settings#action-settings) to customize connector networking, such as proxies, certificates, or TLS settings. You can set configurations that apply to all your connectors or use `xpack.actions.customHostSettings` to set per-host configurations.

## Get API credentials

To use the GitHub connector with a personal access token:
1. Log in to [GitHub](https://github.com/).
2. Go to **Settings** > **Developer settings** > **Personal access tokens** > **Fine-grained tokens** (or [create one directly](https://github.com/settings/personal-access-tokens/new)).
3. Select **Generate new token**.
4. Configure the token:
   - Set a descriptive name (for example, "Kibana data source").
- Select an expiration period.
- Select the repositories you want to grant access to.
- Under **Permissions**, grant read access to the resources you need (for example, **Contents**, **Issues**, **Pull requests**, **Metadata**).
5. Select **Generate token**.
6. Copy the token and store it securely. Use this value as the **Bearer Token** when configuring the GitHub connector in Kibana.

<note>
  Classic personal access tokens also work. When using a classic token, select the `repo` scope for full repository access, or `public_repo` for public repositories only.
</note>


## Get OAuth credentials

To use the GitHub connector with OAuth:
1. Log in to [GitHub](https://github.com/).
2. Go to **Settings** > **Developer settings** > **OAuth Apps** > **New OAuth App** (or [create one directly](https://github.com/settings/applications/new)).
3. Configure the application:
   - Set a descriptive name (for example, "Kibana GitHub Connector").
- Set the **Authorization callback URL** to your Kibana OAuth redirect URI.
4. After creating the app, copy the **Client ID** and generate a **Client Secret**.
5. In Kibana, select **OAuth Authorization Code** as the authentication method and enter the Client ID and Client Secret.