GitHub MCP server
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.
YouAdd the bug label to issue 12.
GitHub tools3 hops
GitHub MCP server4 hops
Comparison
| GitHub tools | GitHub MCP server | |
|---|---|---|
| What you install | An npm package in your TypeScript app | Nothing for the remote server. Docker or a Go binary for the local one |
| How the model calls it | As AI SDK tools in your own agent loop | Through an MCP client, over HTTP, or over stdio for a local server |
| Who decides approval | Your code: every write asks by default, per tool, or a decision model approves routine writes. See Approval | The MCP host. The MCP specification recommends that hosts let a person deny tool calls |
| Scoping | Presets 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-only | A read-only preset such as repo-explorer, or a token without write permissions | --read-only, or a /readonly URL on the remote server |
| Untrusted content | requireApproval: 'auto' asks a person when the user didn't ask for the write | Lockdown mode hides public-repository content from users without push access |
| Output size | Shaped results, bodies cut to about 500 characters, diffs off by default, paged lists. See Tools | Set by each server tool |
| Durability | Each tool call can be a Vercel Workflow step that retries and resumes | A request to the server. Retries are up to the client |
| Auth | A token, a function per call, or Vercel Connect | OAuth, a personal access token, or a GitHub App |
| Coverage | 97 operations: repositories, pull requests, issues, reactions, discussions, notifications, commits, gists, Actions, checks, releases, search and security alerts | Toolsets 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
getCiFailureContextthat 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:
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
requireApproval.api.github.com.Self-improving agent
Give an eve GitHub agent read access to its own production runs through the Vercel MCP, so every week it finds what slowed it down and opens a pull request on its own repository to fix it.
Octokit and gh CLI
When to call GitHub with Octokit or the gh CLI instead of GitHub tools, how they differ for an AI agent, and how to combine them.