PyGithub MCP Server

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
GITHUB_PERSONAL_ACCESS_TOKENYesYour GitHub Personal Access Token for authenticating with the GitHub API

Schema

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Tools

Functions exposed to the LLM to take actions

NameDescription
create_issue

Create a new issue in a GitHub repository.

Args: params_dict: Parameters for creating an issue including: - owner: Repository owner (user or organization) - repo: Repository name - title: Issue title - body: Issue description (optional) - assignees: List of usernames to assign - labels: List of labels to add - milestone: Milestone number (optional) Returns: Created issue details from GitHub API
list_issues

List issues from a GitHub repository.

Args: params: Parameters for listing issues including: - owner: Repository owner (user or organization) - repo: Repository name - state: Issue state (open, closed, all) - labels: Filter by labels - sort: Sort field (created, updated, comments) - direction: Sort direction (asc, desc) - since: Filter by date - page: Page number for pagination - per_page: Number of results per page (max 100) Returns: List of issues from GitHub API
get_issue

Get details about a specific issue.

Args: params: Parameters for getting an issue including: - owner: Repository owner (user or organization) - repo: Repository name - issue_number: Issue number to retrieve Returns: Issue details from GitHub API
update_issue

Update an existing issue.

Args: params: Parameters for updating an issue including: - owner: Repository owner (user or organization) - repo: Repository name - issue_number: Issue number to update - title: New title (optional) - body: New description (optional) - state: New state (optional) - labels: New labels (optional) - assignees: New assignees (optional) - milestone: New milestone number (optional) Returns: Updated issue details from GitHub API
add_issue_comment

Add a comment to an issue.

Args: params: Parameters for adding a comment including: - owner: Repository owner (user or organization) - repo: Repository name - issue_number: Issue number to comment on - body: Comment text Returns: Created comment details from GitHub API
list_issue_comments

List comments on an issue.

Args: params: Parameters for listing comments including: - owner: Repository owner (user or organization) - repo: Repository name - issue_number: Issue number - since: Filter by date (optional) - page: Page number (optional) - per_page: Results per page (optional) Returns: List of comments from GitHub API
update_issue_comment

Update an issue comment.

Args: params: Parameters for updating a comment including: - owner: Repository owner (user or organization) - repo: Repository name - issue_number: Issue number containing the comment - comment_id: Comment ID to update - body: New comment text Returns: Updated comment details from GitHub API
delete_issue_comment

Delete an issue comment.

Args: params: Parameters for deleting a comment including: - owner: Repository owner (user or organization) - repo: Repository name - issue_number: Issue number containing the comment - comment_id: Comment ID to delete Returns: Empty response on success
add_issue_labels

Add labels to an issue.

Args: params: Parameters for adding labels including: - owner: Repository owner (user or organization) - repo: Repository name - issue_number: Issue number - labels: Labels to add Returns: Updated list of labels from GitHub API
remove_issue_label

Remove a label from an issue.

Args: params: Parameters for removing a label including: - owner: Repository owner (user or organization) - repo: Repository name - issue_number: Issue number - label: Label to remove Returns: Empty response on success or error if label doesn't exist
get_repository

Get details about a GitHub repository.

Args: params: Dictionary with repository parameters - owner: Repository owner (username or organization) - repo: Repository name Returns: MCP response with repository details
create_repository

Create a new GitHub repository.

Args: params: Dictionary with repository creation parameters - name: Repository name - description: Repository description (optional) - private: Whether the repository should be private (optional) - auto_init: Initialize repository with README (optional) Returns: MCP response with created repository details
fork_repository

Fork an existing GitHub repository.

Args: params: Dictionary with fork parameters - owner: Repository owner (username or organization) - repo: Repository name - organization: Organization to fork to (optional) Returns: MCP response with forked repository details
search_repositories

Search for GitHub repositories.

Args: params: Dictionary with search parameters - query: Search query - page: Page number for pagination (optional) - per_page: Results per page (optional) Returns: MCP response with matching repositories
get_file_contents

Get contents of a file in a GitHub repository.

Args: params: Dictionary with file parameters - owner: Repository owner (username or organization) - repo: Repository name - path: Path to file/directory - branch: Branch to get contents from (optional) Returns: MCP response with file content data
create_or_update_file

Create or update a file in a GitHub repository.

Args: params: Dictionary with file parameters - owner: Repository owner (username or organization) - repo: Repository name - path: Path where to create/update the file - content: Content of the file - message: Commit message - branch: Branch to create/update the file in - sha: SHA of file being replaced (for updates, optional) Returns: MCP response with file creation/update result
push_files

Push multiple files to a GitHub repository in a single commit.

Args: params: Dictionary with file parameters - owner: Repository owner (username or organization) - repo: Repository name - branch: Branch to push to - files: List of files to push, each with path and content - message: Commit message Returns: MCP response with file push result
create_branch

Create a new branch in a GitHub repository.

Args: params: Dictionary with branch parameters - owner: Repository owner (username or organization) - repo: Repository name - branch: Name for new branch - from_branch: Source branch (optional, defaults to repo default) Returns: MCP response with branch creation result
list_commits

List commits in a GitHub repository.

Args: params: Dictionary with commit parameters - owner: Repository owner (username or organization) - repo: Repository name - page: Page number (optional) - per_page: Results per page (optional) - sha: Branch name or commit SHA (optional) Returns: MCP response with list of commits