Docs
GitHub

GitHub MCP server

How GitHub tools and GitHub's official MCP server differ in how they're called, approved, scoped and hosted, and when to use each or both.

Beginner4 min read

GitHub tools and the GitHub MCP server both let a model call the GitHub API, in different places: GitHub tools is a TypeScript library whose tools run inside your own agent code, and the GitHub MCP server is a server that any Model Context Protocol client, such as VS Code, Cursor or Claude Desktop, connects to. Pick GitHub tools when you write the agent, and the MCP server when you want GitHub inside an MCP host you already use.

What each one is

GitHub tools (@github-tools/sdk) is an npm package. createGithubTools() returns 97 AI SDK tools that you pass to generateText, streamText, an agent, or one of the integrations. Each call runs in your process, with the token you give it, and your code decides which writes wait for a person.

The GitHub MCP server is maintained by GitHub and written in Go. GitHub hosts a remote version at https://api.githubcopilot.com/mcp/, and you can run it yourself from the ghcr.io/github/github-mcp-server Docker image or from source. Its tools are grouped into toolsets, such as repos, issues, pull_requests and actions, and an MCP client lists them and calls them over the protocol.

Call

YouAdd the bug label to issue 12.

GitHub tools3 hops

Model addLabels({ issueNumber: 12, … })
tool call
your process
Your agent code asks a person first
function call
GitHub tools typed tool, Zod input
HTTPS
GitHub API 200api.github.com

GitHub MCP server4 hops

Model a tool from the issues toolset
tool call
host process
MCP host its settings decide
inside the host
MCP client lists and calls tools
MCP, HTTP or stdio
separate process or remote
GitHub MCP server remote, Docker or Go binary
HTTPS
GitHub API 200api.github.com
Who decides approval. With GitHub tools the call stays in your process and your code asks a person; with the MCP server it crosses to a separate server and the MCP host decides.

Comparison

GitHub toolsGitHub MCP server
What you installAn npm package in your TypeScript appNothing for the remote server. Docker or a Go binary for the local one
How the model calls itAs AI SDK tools in your own agent loopThrough an MCP client, over HTTP, or over stdio for a local server
Who decides approvalYour code: every write asks by default, per tool, or a decision model approves routine writes. See ApprovalThe MCP host. The MCP specification recommends that hosts let a person deny tool calls
ScopingPresets for one job, single tools, or preset: 'auto'Toolsets and single tools, with --toolsets and --tools, or per-toolset URLs on the remote server
Read-onlyA read-only preset such as repo-explorer, or a token without write permissions--read-only, or a /readonly URL on the remote server
Untrusted contentrequireApproval: 'auto' asks a person when the user didn't ask for the writeLockdown mode hides public-repository content from users without push access
Output sizeShaped results, bodies cut to about 500 characters, diffs off by default, paged lists. See ToolsSet by each server tool
DurabilityEach tool call can be a Vercel Workflow step that retries and resumesA request to the server. Retries are up to the client
AuthA token, a function per call, or Vercel ConnectOAuth, a personal access token, or a GitHub App
Coverage97 operations: repositories, pull requests, issues, reactions, discussions, notifications, commits, gists, Actions, checks, releases, search and security alertsToolsets for areas GitHub tools doesn't cover, including Projects, organizations, users, Copilot and repository governance

When to pick GitHub tools

  • You write the agent in TypeScript, with the AI SDK, eve, TanStack AI, Vercel Workflow or Chat SDK.
  • Your code needs to decide which writes ask a person, show the request in your own UI, or let a model approve routine writes.
  • The agent runs unattended, in a webhook, a cron job or a durable workflow, where there is no MCP host to confirm a call.
  • You want results shaped for a model's context, and context tools such as getCiFailureContext that answer a question in one call.

When to pick the GitHub MCP server

  • You want GitHub inside an MCP host you already use, such as VS Code with Copilot, Cursor or Claude Desktop, without writing code.
  • Your agent isn't written in TypeScript, or its framework speaks MCP but not the AI SDK.
  • You need an area GitHub tools doesn't cover, such as Projects or organization settings.

Use both

An AI SDK agent can take tools from both. Connect to the remote server with @ai-sdk/mcp, and spread its tools next to a GitHub tools preset. This agent reads a GitHub Project through the MCP server, read-only, and labels issues with GitHub tools:

agent.ts
import { createMCPClient } from '@ai-sdk/mcp'
import { createGithubTools } from '@github-tools/sdk'
import { generateText, stepCountIs } from 'ai'

const projects = await createMCPClient({
  transport: {
    type: 'http',
    url: 'https://api.githubcopilot.com/mcp/x/projects/readonly',
    headers: { Authorization: `Bearer ${process.env.GITHUB_TOKEN}` },
  },
})

try {
  const { text } = await generateText({
    model: 'anthropic/claude-opus-5.5',
    tools: {
      ...await projects.tools(),
      ...createGithubTools({ preset: 'issue-triage' }),
    },
    stopWhen: stepCountIs(10),
    prompt: 'Which issues in the "Next release" project on my-org have no label? Suggest one for each.',
  })
  console.log(text)
}
finally {
  await projects.close()
}

The MCP tools run without approval, which is why the URL limits them to reads. The GitHub tools writes, such as addLabels, still return approval requests. Give each tool set only the toolsets or preset the job needs, so the model doesn't see two tools for the same operation.

FAQ