src.integrations.github_mcp_interface module#

GitHub MCP Interface.

Wrapper for GitHub MCP tools to provide a clean interface for the quality assessor and other components that need GitHub data.

class src.integrations.github_mcp_interface.GitHubMCPInterface[source]#

Bases: object

Interface for GitHub MCP operations.

Provides a clean API for components that need to interact with GitHub through the MCP server, abstracting away the specific tool calls.

__init__(mcp_caller)[source]#

Initialize the GitHub MCP interface.

Parameters:

mcp_caller (Callable[..., Any]) – Function to call MCP tools (e.g., from kanban_client)

Return type:

None

async list_commits(owner, repo, since=None, until=None, author=None, path=None, per_page=100)[source]#

List commits for a repository.

Parameters:
  • owner (str) – Repository owner

  • repo (str) – Repository name

  • since (Optional[str]) – Only commits after this date (ISO 8601 format)

  • until (Optional[str]) – Only commits before this date (ISO 8601 format)

  • author (Optional[str]) – GitHub username or email

  • path (Optional[str]) – Only commits touching this path

  • per_page (int) – Results per page (max 100)

Returns:

Response with commits list

Return type:

Dict[str, Any]

async search_issues(query, sort=None, order=None, per_page=100)[source]#

Search for issues and pull requests.

Parameters:
  • query (str) – Search query using GitHub’s search syntax

  • sort (Optional[str]) – Sort field (comments, reactions, reactions-+1, etc.)

  • order (Optional[str]) – Sort order (asc or desc)

  • per_page (int) – Results per page (max 100)

Returns:

Response with items list

Return type:

Dict[str, Any]

async list_pr_reviews(owner, repo, pr_number, per_page=100)[source]#

List reviews for a pull request.

Parameters:
  • owner (str) – Repository owner

  • repo (str) – Repository name

  • pr_number (int) – Pull request number

  • per_page (int) – Results per page (max 100)

Returns:

Response with reviews list

Return type:

Dict[str, Any]

async get_repository_content(owner, repo, path='', ref=None)[source]#

Get repository content at a specific path.

Parameters:
  • owner (str) – Repository owner

  • repo (str) – Repository name

  • path (str) – Path to file or directory

  • ref (Optional[str]) – Branch, tag, or commit SHA

Returns:

Response with content data

Return type:

Dict[str, Any]

async get_pull_request(owner, repo, pr_number)[source]#

Get a specific pull request.

Parameters:
  • owner (str) – Repository owner

  • repo (str) – Repository name

  • pr_number (int) – Pull request number

Returns:

Pull request data

Return type:

Dict[str, Any]

async list_pr_commits(owner, repo, pr_number, per_page=100)[source]#

List commits for a pull request.

Parameters:
  • owner (str) – Repository owner

  • repo (str) – Repository name

  • pr_number (int) – Pull request number

  • per_page (int) – Results per page (max 100)

Returns:

Response with commits list

Return type:

Dict[str, Any]

async get_repository_stats(owner, repo)[source]#

Get repository statistics.

Parameters:
  • owner (str) – Repository owner

  • repo (str) – Repository name

Returns:

Repository statistics

Return type:

Dict[str, Any]