GitHub MCP Server
Provides tools for creating GitHub repositories, with more features like commits, pushes, and pull request comments planned.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@GitHub MCP Servercreate a private repository named my-new-project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
GitHub MCP Server
A Model Context Protocol (MCP) server for GitHub operations, written in TypeScript.
Features
Create and manage pull requests
Comment on PRs
List and get PR details
Merge pull requests
Automated PR review with security and quality checks
Related MCP server: forgejo-mcp
Installation & Setup
For End Users (via npm)
# Install globally
npm install -g github-mcp
# Or install locally in your project
npm install github-mcpThe package comes pre-built with compiled JavaScript - no TypeScript setup needed!
For Contributors (from source)
If you're developing or contributing to this project:
Create a GitHub Personal Access Token:
Create a fine-grained token with:
Repository access: All repositories
Permissions: Administration (RW), Contents (RW), Pull Requests (RW)
Create
.envfile:GITHUB_TOKEN=your-token-hereInstall dependencies:
npm installBuild the TypeScript project:
npm run build
Usage
As an npm package (recommended for end users):
After installing via npm, configure in your MCP client:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "github-mcp"],
"env": {
"GITHUB_TOKEN": "your-token-here"
}
}
}
}From source (for contributors):
Development mode (TypeScript with hot reload):
npm run devProduction mode (compiled JavaScript):
npm run build
npm startConfigure with Claude Code (local development):
Add to .claude/.mcp.json:
{
"mcpServers": {
"github": {
"command": "node",
"args": ["C:/code/github-mcp/dist/index.js"],
"env": {
"GITHUB_TOKEN": "your-token-here"
}
}
}
}Available Tools
create_pr- Create a pull requestowner(required): Repository owner (username or org)repo(required): Repository nametitle(required): Pull request titlebody(optional): Pull request descriptionhead(required): Branch containing changesbase(optional): Branch to merge into (default: "main")
comment_on_pr- Add a comment to a pull requestowner(required): Repository owner (username or org)repo(required): Repository namepr_number(required): Pull request numberbody(required): Comment text (supports Markdown)
get_pr- Get details about a pull requestowner(required): Repository owner (username or org)repo(required): Repository namepr_number(required): Pull request number
list_prs- List pull requests for a repositoryowner(required): Repository owner (username or org)repo(required): Repository namestate(optional): Filter by state - "open", "closed", or "all" (default: "open")
merge_pr- Merge a pull requestowner(required): Repository owner (username or org)repo(required): Repository namepr_number(required): Pull request numbermerge_method(optional): "merge", "squash", or "rebase" (default: "merge")commit_title(optional): Custom merge commit titlecommit_message(optional): Custom merge commit message
Contributing
Development Setup
Clone the repository
Install dependencies:
npm installBuild TypeScript:
npm run buildRun in dev mode:
npm run dev
Testing
This project uses Vitest for unit testing:
58 test cases covering happy paths, error handling, and edge cases
100% coverage on core API functions
Security pattern detection tests for SQL injection, XSS, command injection
Fast execution with Vitest's modern test runner
Run tests:
npm test # Run all tests
npm run test:watch # Watch mode for development
npm run test:coverage # Generate coverage report
npm run test:ui # Interactive test UICI/CD
This project uses GitHub Actions for continuous integration:
Automated testing with coverage reports on all PRs
Automated builds on all PRs and pushes to main
Type checking to catch TypeScript errors
Multi-version testing (Node 18.x, 20.x, 22.x)
Automated PR reviews with security and quality checks
The CI workflows are for repo contributors only - end users receive pre-built packages.
Scripts
npm run build- Compile TypeScript to JavaScriptnpm run dev- Run with tsx (no build needed)npm run clean- Remove build and coverage artifactsnpm start- Run compiled JavaScriptnpm run review-pr- Run PR review toolnpm test- Run test suitenpm run test:watch- Run tests in watch modenpm run test:coverage- Run tests with coverage reportnpm run test:ui- Run tests with interactive UI
Package Distribution
When published to npm:
✅ Pre-built JavaScript included (
dist/directory)✅ TypeScript definitions included (
.d.tsfiles)❌ Source TypeScript excluded
❌ CI workflows excluded
❌ Development files excluded
End users get a ready-to-use package with no build step required!
Future Extensions
This library currently focuses on core PR and merging workflows. Potential future extensions include:
Core Workflow Operations
Branch Management:
create_branch,list_branches,delete_branch,compare_branchesIssue Management:
create_issue,list_issues,update_issue,close_issue,add_issue_commentCommit Operations:
get_commit,list_commitswith filteringRepository Content:
get_file,update_file,get_directoryfor direct file operations
CI/CD Integration
GitHub Actions:
trigger_workflow,get_workflow_runs,get_run_logsCommit Status API:
create_commit_status,get_commit_statusesfor external CIEnhanced PR Details:
get_pr_files,get_pr_commits,request_reviewers
Advanced Features
Release Management:
create_release,list_releases,create_tagRepository Search:
search_code,search_issues,search_commitsSecurity:
list_security_advisories,get_dependabot_alerts
The automated PR review tool (review-pr.ts) serves as a CI/CD quality gate and is intentionally separate from the core MCP library.
Development Retrospective
This project was built through human-AI collaboration using Claude Code. Key learnings:
What Required Human Guidance
1. Git Workflow Discipline
Issue: AI initially committed directly to
mainbranchFix: User enforced branch-first workflow, set up branch protection via GitHub API
Lesson: AI needs explicit constraints on destructive/risky operations
2. Code Quality & Performance
Issue: Initial test code was verbose (385 lines for github-api tests)
Iterations: 3 self-audit rounds reduced to 227 lines (-41%) while maintaining 100% coverage
Approach: User requested "performance/cleanup audit" prompts
Lesson: AI benefits from explicit optimization passes after generation
3. Scope Management
Issue: AI wanted to add lint rules, prettier, complex tooling
Fix: User kept scope minimal ("we don't need that")
Lesson: AI tends toward over-engineering; human judgment keeps it practical
4. Test Strategy
Issue: Initial approach tried to test implementation files with actual logic
Pivot: User guided toward testing the extracted pure logic (patterns, analysis)
Result: 100% coverage on
github-api.ts, meaningful tests onreview-pr.tsLesson: AI can test effectively when given clear architectural direction
5. CI Pipeline Architecture
Issue: Initial single test job combined unit tests + coverage
Improvement: User requested split into fast unit test job + coverage job
Result: 13s fast feedback vs 16s+ combined, parallel execution
Lesson: AI implements well but human insight drives architectural improvements
What Worked Without Changes
1. TypeScript Migration
AI correctly converted JS → TS with proper types
Type definitions for GitHub API were accurate
No type errors after initial conversion
2. Test Infrastructure Setup
Vitest configuration with coverage was correct first try
Test patterns (mocking, helpers, DRY principles) were sound
Coverage thresholds appropriately set
3. GitHub API Integration
API request patterns were correct
Error handling was appropriate
Token authentication worked as expected
4. Documentation
README updates were comprehensive
Code examples were accurate
Installation instructions were clear
Collaboration Pattern
Effective workflow:
User provides high-level requirement ("add unit testing")
AI implements full solution
User requests optimization ("cleanup audit round")
AI refactors with metrics (LoC reduction, coverage maintained)
User approves or redirects
Key principle: AI is thorough but needs human judgment on:
When to stop adding features
When "good enough" beats "perfect"
What trade-offs to make (verbosity vs DRY, speed vs completeness)
Metrics
Project Duration: ~3 days of iterative development
Test Coverage: 100% on core API, 100% on review logic
Code Quality: 227 lines of tests (from 385), optimized CI pipeline
Git Discipline: 14 PRs, 0 direct main commits after enforcement
CI Performance: 20% pipeline speedup with parallel jobs
Available Tools
5 toolscomment_on_prB
Add a comment to a pull request
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | Comment text (supports Markdown) | |
| repo | Yes | Repository name | |
| owner | Yes | Repository owner (username or org) | |
| pr_number | Yes | Pull request number |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must disclose behavioral traits but only states the obvious action. It does not mention side effects, permissions, idempotency, or any side effects beyond adding a comment, which is insufficient for a mutation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence that effectively communicates the core purpose without redundancy. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite the simple action and complete parameter schema, the description lacks behavioral context, usage guidance, and return value information. With no annotations and no output schema, a more complete description is needed to guide the agent effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
All parameters are fully documented in the schema (100% coverage), so the description does not need to add parameter details. The description adds no extra meaning, but the schema already provides the necessary semantics, yielding the baseline score.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (add) and the resource (comment to a pull request), distinguishing it from sibling tools like get_pr and merge_pr. It is specific and unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. There is no mention of prerequisites, context, or exclusions, despite the presence of sibling tools for PR operations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
create_prB
Create a pull request
| Name | Required | Description | Default |
|---|---|---|---|
| base | No | Branch to merge into | main |
| body | No | Pull request description | |
| head | Yes | Branch containing changes | |
| repo | Yes | Repository name | |
| owner | Yes | Repository owner (username or org) | |
| title | Yes | Pull request title |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It only mentions 'create', implying a write operation, but discloses no side effects, prerequisites, or return behavior. This is minimal and mirrors the mid-tier example that scored 2.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with zero filler words. It is highly concise and clearly structured, making it easy to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite a complete schema, the description lacks essential context such as what a pull request is, what inputs are needed, or expected outcomes. With no annotations and no output schema, this minimal description is insufficient for a tool with six parameters.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage for all six parameters, so the schema already provides parameter semantics. The description adds no extra meaning beyond the schema, matching the baseline of 3 for high coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Create a pull request' uses a specific verb and resource, clearly stating the tool's action and target. It distinguishes itself from sibling tools like get_pr, merge_pr, list_prs, and comment_on_pr by implying a creation operation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to use this tool vs. alternatives. The description simply states the action without context, exclusions, or comparison to sibling tools, so the agent gets no explicit usage direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_prB
Get details about a pull request
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | Repository name | |
| owner | Yes | Repository owner (username or org) | |
| pr_number | Yes | Pull request number |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full responsibility for behavioral disclosure. It merely says 'Get details about a pull request' without detailing what 'details' include, whether the operation is read-only, any potential side effects, or the response format. This is a significant gap for a tool with no output schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that gets straight to the point with the verb front-loaded. It wastes no words, though it is sparse. It earns a 4 for effectively communicating the core purpose without unnecessary verbiage.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple get tool with no output schema and no annotations, the description should provide at least some context about the returned data or usage context. The current description is a restatement of the tool name and does not explain what 'details' means, leaving the agent to guess about response structure and edge cases.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already provides 100% documentation for all three parameters (owner, repo, pr_number). The description adds no additional meaning beyond what the schema states, so it neither improves nor detracts from parameter clarity. Baseline of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly uses a specific verb ('Get') and resource ('details about a pull request'), making the tool's purpose immediately obvious. It also distinguishes from sibling tools like list_prs (which lists multiple PRs) and create_pr/comment_on_pr/merge_pr (which perform actions), by focusing on retrieval of a single PR's details.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided about when to use this tool versus alternatives such as list_prs. The description only states what the tool does, not the scenarios in which it should be preferred, nor any exclusions or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_prsB
List pull requests for a repository
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | Repository name | |
| owner | Yes | Repository owner (username or org) | |
| state | No | Filter by state: open, closed, or all | open |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It only says 'list', implying a read operation, but does not explicitly state that it is non-mutating, nor does it mention return format, pagination, ordering, or default state. The description adds little beyond the tool name and schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, front-loaded with the key verb and resource. Every word earns its place with no unnecessary filler or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is minimal and does not explain return values, pagination, or any behavior beyond listing. While the schema covers parameters well, the absence of output schema and annotations leaves room for more context. However, for a simple list tool with well-defined parameters, this is adequate but not complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides descriptions for all three parameters (owner, repo, state) with 100% coverage. The description does not add any additional meaning to the parameters. Baseline 3 is appropriate since the schema already documents the parameters adequately.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (List) and the resource (pull requests) for a repository. This distinguishes it from sibling tools like get_pr (single PR), create_pr, comment_on_pr, and merge_pr, which have different purposes. The verb+resource pair is specific and unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to use this tool versus alternatives. No mention of, for example, 'use get_pr to retrieve details of a single PR' or 'use create_pr to open a new PR'. The description simply states what it does without context or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
merge_prC
Merge a pull request
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | Repository name | |
| owner | Yes | Repository owner (username or org) | |
| pr_number | Yes | Pull request number | |
| commit_title | No | Title for the merge commit (optional) | |
| merge_method | No | Merge method to use | merge |
| commit_message | No | Message for the merge commit (optional) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Given that annotations are entirely absent, the description carries the full burden of behavioral disclosure. It only says 'Merge a pull request'—a minimal restatement of the tool's name—without mentioning side effects like branch deletion, permission requirements, or potential merge conflicts. This adds no transparency beyond the name itself.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence with zero waste. It states the essential purpose directly and is front-loaded. While it may be too brief for other dimensions, conciseness is a strength here.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 6 parameters, no annotations, and no output schema, this description is severely under-specified. It does not explain merge behavior, default method, possible outcomes, or any constraints. The single sentence is insufficient for an agent to understand when and how to invoke the tool correctly beyond what the name already suggests.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema covers 100% of the parameters with descriptions, so per baseline rules a score of 3 is appropriate. The description itself adds no parameter-specific semantics, but the schema already documents all six parameters, including optional commit_title, commit_message, and merge_method.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Merge a pull request' clearly states the action (merge) and the resource (pull request), which distinguishes it from sibling tools like create_pr, get_pr, and list_prs. However, it lacks any qualifying detail about scope or variant (e.g., merge into default branch), so it's clear but not maximally informative.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. It does not mention prerequisites like approvals or CI status, nor does it reference sibling tools or alternative merge strategies. The description is purely definitional and offers no usage context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
5 tool updates
v1.0.0- First observed
comment_on_pr - First observed
create_pr - First observed
get_pr - First observed
list_prs - First observed
merge_pr
TDQS
Each tool targets a distinct PR operation: create, comment, get, list, and merge. There is no overlap or ambiguity between the actions.
The naming follows a predictable verb_noun/reference pattern (create_pr, get_pr, list_prs, merge_pr), with the only minor deviation being comment_on_pr using an extra preposition. Overall, the convention is consistent and readable.
With 5 tools focused entirely on pull request management, the count is well-scoped for a single-purpose server. Each tool serves a clear need without redundancy.
The core PR lifecycle is covered: create, read, list, comment, and merge. Missing operations like updating a PR or closing without merging are minor gaps that agents can work around, but the surface is mostly complete.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Create, deploy, and operate MCP servers directly from your GitHub repositories.
A MCP server built for developers enabling Git based project management with project and personal…
A basic MCP server to operate on the Postman API.
Related MCP Servers
- -licenseNot gradedqualityAmaintenanceMCP Server for the GitHub API, enabling file operations, repository management, search functionality, and more.117,29690,042MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server for managing your repositories on Forgejo/Gitea server.66Mozilla Public 2.0
- FlicenseNot gradedqualityDmaintenanceStandalone MCP server for GitHub that enables repository management, branch operations, pull request handling, and commit retrieval via tools listed in the README.1-
- FlicenseNot gradedqualityDmaintenanceA simple MCP server that provides repository information (list repos, get repo details) using GitHub's public REST API, without needing any API keys or tokens.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/attila-batky-epam/github-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server