-
Notifications
You must be signed in to change notification settings - Fork 0
Usage
This page explains how to use GitHub CLI MCP to enable AI assistants to interact with GitHub.
Start the GitHub CLI MCP server:
gh-cli-mcpThis starts the server using stdio transport.
GitHub CLI MCP supports the following command line options:
OPTIONS:
-h, --help Show this help message
-v, --version Show version information
-c, --config <path> Path to configuration file
--session-timeout <ms> Session timeout in milliseconds
Show help:
gh-cli-mcp --helpStart with a custom configuration file:
gh-cli-mcp --config ./my-config.jsonSet a custom session timeout:
gh-cli-mcp --session-timeout 3600000GitHub CLI MCP can be used with any AI assistant that supports the Model Context Protocol. Here's how to integrate it with your assistant:
- Start the GitHub CLI MCP server
- Configure your AI assistant to communicate with the server via stdio
- Use the Model Context Protocol to invoke GitHub CLI tools
-
Start the GitHub CLI MCP server in one terminal:
gh-cli-mcp
-
In another terminal, start Claude Code with the MCP flag:
claude --mcp "gh-cli-mcp:github-cli:stdio:http://localhost:8888" -
Now you can ask Claude to interact with GitHub. Examples:
- "List my open pull requests"
- "Create a new issue titled 'Fix navbar styling'"
- "Show me the details of PR #123"
-
Start the GitHub CLI MCP server:
gh-cli-mcp
-
In Claude Desktop, ensure you've added the MCP integration in Settings.
-
Then you can ask Claude to perform GitHub tasks similar to the examples above.
Here are some examples of how to invoke GitHub CLI MCP tools:
{
"name": "gh_pr_list",
"input": {
"state": "open"
}
}{
"name": "gh_pr_view",
"input": {
"number": 123,
"repo": "owner/repo"
}
}{
"name": "gh_issue_create",
"input": {
"title": "Bug: Application crashes on startup",
"body": "When starting the application, it crashes with the following error...",
"repo": "owner/repo"
}
}- Check the Configuration guide for advanced configuration options
- See Available Tools for a comprehensive list of available tools
GitHub CLI MCP - Making GitHub CLI accessible to AI assistants via Model Context Protocol