Table of contents

Add secure integrations to your products and AI agents with ease via Merge.
Get a demo

How to connect to the GitHub MCP with Claude Code (5 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.

Prerequisites

Before getting started, you’ll need:

Related: A guide to using the Notion MCP in Claude Code

How it works

Merge Agent Handler functions as a secure intermediary between your agent and GitHub's API. 

You'll set up a Tool Pack (a scoped collection of connectors) and a Registered User (representing your agent's identity), which together generate a unique MCP URL that Claude Code communicates with via HTTP.

This URL, coupled with the API key you’d generate in Agent Handler, lets you craft the full command for connecting to our GitHub MCP server

Here’s how the command looks before adding your unique MCP URL and API key:

 {
 "mcpServers": {
   "agent-handler": {
     "command": "npx",
     "args": [
       "-y",
       "mcp-remote@latest",
       "https://ah-api-develop.merge.dev/api/v1/tool-packs/{TOOL_PACK_ID}/registered-users/{REGISTERED_USER_ID}/mcp",
       "--header",
       "Authorization: Bearer ${AUTH_TOKEN}"
     ],
     "env": {
       "AUTH_TOKEN": "yMt*****"
     }
   }
 }
}

Steps for connecting to the GitHub MCP

Take the following measures to get your MCP URL and API key and to access the GitHub MCP from Claude Code.

1. Create a Tool Pack

Navigate to the Merge Agent Handler dashboard, click on Tool Packs, and select Create Tool Pack. 

Provide a descriptive name like "Engineering Agent," add a description, and select GitHub as your connector. 

Giving a name to a Tool Pack with GitHub connector

You can specify which GitHub tools to include and choose between individual or shared authentication.

Selecting tools for GitHub connector

 2. Add a Registered User 

Go to the Registered Users section and click Add Registered User. This establishes the identity context for your agent's operations and generates the unique MCP URL that Claude Code will use.

Adding a Registered User

Step 3: Authenticate GitHub

From the Registered User details page, select Add Connector and complete the GitHub OAuth authentication process. 

Auth UI for GitHub

This grants your agent access to the repositories and organizations you authorize.

4. Gather your credentials 

Collect two items from Merge Agent Handler: 

  • MCP URL (from Tool Pack details):
https://ah-api.merge.dev/api/v1/tool-packs/{TOOL_PACK_ID}/registered-users/{REGISTERED_USER_ID}/mcp
  • API key (from Settings > API Keys > Create new key)
Creating an API key

5. Add GitHub MCP to Claude Code

Run the following command in your terminal, replacing the placeholders with your actual values: 

 {
 "mcpServers": {
   "agent-handler": {
     "command": "npx",
     "args": [
       "-y",
       "mcp-remote@latest",
       "https://ah-api-develop.merge.dev/api/v1/tool-packs/{TOOL_PACK_ID}/registered-users/{REGISTERED_USER_ID}/mcp",
       "--header",
       "Authorization: Bearer ${AUTH_TOKEN}"
     ],
     "env": {
       "AUTH_TOKEN": "yMt*****"
     }
   }
 }
}

Verify the connection by running <code class="blog_inline-code">claude mcp list</code>.

You should see agent-handler listed with a connected status.

How to check if connection is healthy

Once connected, you can prompt Claude Code to take action in GitHub directly. For example: "Search open issues in the backend repo labeled 'bug' and assign them to me.”

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

How to connect to the Notion MCP with Claude Code (5 steps)

AI

Sales intelligence MCP servers: overview, examples, and use cases

AI

LLM gateway: overview, benefits, and top platforms

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 Notion) 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