Table of contents

Thousands of companies trust Merge to accelerate AI from PoC to production.
Get a demo

How to connect to the GitHub MCP with Claude Code (4 steps)

Jon Gitlin
Senior Content Marketing Manager
at Merge

By using Merge Agent Handler's GitHub connector with Claude Code, your agents can create and manage issues, search across repositories, add comments, update workflows and more directly from the terminal.

This guide walks through the set up.

How it works

Merge Agent Handler acts as the layer between Claude Code and GitHub's API. You install the Merge CLI, log in once, and register the connection with a single terminal command. Agent Handler stores your GitHub OAuth credentials and handles token refresh so none of that lives in your local environment.

Here's the command that registers the connection:

merge setup claude-code

Prerequisites

Before getting started, you'll need the following:

  • A Merge Agent Handler account
  • Claude Code installed (run claude --version to confirm)
  • pipx installed (run pipx --version to confirm, or install via pip install pipx)
  • A GitHub account with appropriate repository permissions

If you want to connect Merge Agent Handler's GitHub MCP with internal or customer-facing agentic products, you can follow the steps in our docs.

1. Install the Merge CLI

Install with pipx: pipx install merge-api

How to add pipx install merge-api in Claude Code

Confirm the install completed: merge --version

Related: How to use a GitHub MCP in Cursor

2. Configure the CLI and log in

Start with the interactive configuration: merge configure

This prompts you for your Merge API key and sets your default workspace preferences, linking the CLI to your Merge Agent Handler account.

Then authenticate: merge login

Once you log in, the CLI can make authorized API requests on your behalf.

3. Add Agent Handler to Claude Code

To add Agent Handler to Claude Code, run:

merge setup claude-code

Or register manually with:

claude mcp add 
--transport http agent-handler https://ah-api.merge.dev/mcp

Verify the connection registered. Open Claude Code and run: /mcp

agent-handler should appear under Local MCPs with a connected status.

Verifying the connection registered

Related: How to use the Google Drive MCP in Claude Code

4. Authenticate GitHub

Open a Claude Code session and test it with: "Search open issues in the backend repo labeled 'bug' and assign them to me."

The first time you use a GitHub tool, a Magic Link will appear to authenticate the connector.

Auth UI for GitHub

You should then see an output like the following:

Example of how you can prompt Claude Code to take action in GitHub directly

Or get updates from GitHub: What’s the latest on the issue in the API repo titled 'Rate limiter not resetting on token refresh?"

prompt Claude Code to get updates from GitHub

{{this-blog-only-cta}}

GitHub MCP FAQ

In case you have more questions about connecting GitHub to Claude Code or using it in the terminal, we've answered a few more below.

What can agents do with a GitHub MCP server?

  • Risk and policy enforcement: Automatically require the right approvals/checks for sensitive changes (auth/billing/infra), and enforce PR hygiene (linked ticket, changelog, labels, signed commits, etc.)
  • CI/build failure triage: Summarize failures, identify likely culprit commits/owners, and route fixes fast with smart alerts instead of noisy pings
  • Release readiness and release notes automation: Roll up merged PRs into ship-ready checklists and customer-friendly changelog/release note drafts, then publish updates to Slack/Notion
  • Issue SLA and escalation management: Track aging/stale issues (bugs, security, escalations), auto-retriage, and escalate based on priority/time-in-state with clear owner asks
  • Incident response coordination: When severity spikes, auto-create the incident workflow (channel, roles, timeline), and keep status updates synced from GitHub activity

Why use Merge Agent Handler's GitHub MCP server?

Merge Agent Handler's GitHub connector includes enterprise-grade security controls, data loss prevention, and real-time observability over every tool call. You can scope exactly which repositories your agent can access and set custom guardrails to control what it can read or write.

Why connect GitHub MCP to Claude Code?

GitHub is where engineering work is tracked, and Claude Code is where engineers already are. Connecting the two means your agents can surface relevant issues, log new bugs, update existing tickets as part of your coding workflows, and more without switching tabs or losing context.

Jon Gitlin
Senior Content Marketing Manager
@Merge

Jon Gitlin is the Managing Editor of Merge's blog. He has several years of experience in the integration and automation space; before Merge, he worked at Workato, an integration platform as a service (iPaaS) solution, where he also managed the company's blog. In his free time he loves to watch soccer matches, go on long runs in parks, and explore local restaurants.

Read more

Employee agents: overview, use cases, and implementation steps

AI

Gateway's Build Your Own Router: define exactly how Gateway picks your LLMs

Company

Multi-model routing: how to implement it successfully

AI

Subscribe to the Merge Blog

Get stories from Merge straight to your inbox

Subscribe

Connect your agents to thousands of tools in minutes

Use Merge Agent Handler’s 150+ connectors (including Google Drive) to power reliable, secure, and powerful agents.

Get started
But Merge isn’t just a Unified 
API product. Merge is an integration platform to also manage customer integrations.  gradient text
But Merge isn’t just a Unified 
API product. Merge is an integration platform to also manage customer integrations.  gradient text
But Merge isn’t just a Unified 
API product. Merge is an integration platform to also manage customer integrations.  gradient text
But Merge isn’t just a Unified 
API product. Merge is an integration platform to also manage customer integrations.  gradient text