A Model Context Protocol server for GitHub management
This TypeScript-based MCP server provides tools for managing GitHub organizations, repositories, and collaborators through the GitHub API.
Features
list_orgs
: List GitHub organizations the authenticated user belongs to
list_repos
: List repositories in a specified organization
create_repo
: Create a new repository in an organization
add_collaborator
: Add a collaborator to a repository
update_repo_settings
: Update repository settings
Development
Installation
npm install
Build
npm run build
Development with Auto-rebuild
npm run watch
Testing
Run unit tests:
npm test
Run tests with coverage:
npm run test:coverage
Configuration
Environment Variables
GITHUB_TOKEN
: GitHub personal access token with required scopes
MCP Server Installation
To use with Claude Desktop, add the server config:
On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"github-manager": {
"command": "/path/to/github-manager/build/index.js",
"env": {
"GITHUB_TOKEN": "your_github_token_here"
}
}
}
}
Debugging
We recommend using the MCP Inspector, which is available as a package script:
npm run inspector
The Inspector will provide a URL to access debugging tools in your browser.
[
{
"description": "List GitHub organizations the authenticated user belongs to",
"inputSchema": {
"properties": {},
"required": [],
"type": "object"
},
"name": "list_orgs"
},
{
"description": "List repositories in an organization",
"inputSchema": {
"properties": {
"org": {
"description": "Organization name",
"type": "string"
}
},
"required": [
"org"
],
"type": "object"
},
"name": "list_repos"
},
{
"description": "Create a new repository in an organization",
"inputSchema": {
"properties": {
"description": {
"description": "Repository description",
"type": "string"
},
"name": {
"description": "Repository name",
"type": "string"
},
"org": {
"description": "Organization name",
"type": "string"
},
"private": {
"description": "Whether the repository should be private",
"type": "boolean"
}
},
"required": [
"org",
"name"
],
"type": "object"
},
"name": "create_repo"
},
{
"description": "Add a collaborator to a repository",
"inputSchema": {
"properties": {
"org": {
"description": "Organization name",
"type": "string"
},
"permission": {
"description": "Permission level (pull, push, admin)",
"enum": [
"pull",
"push",
"admin"
],
"type": "string"
},
"repo": {
"description": "Repository name",
"type": "string"
},
"username": {
"description": "GitHub username to add",
"type": "string"
}
},
"required": [
"org",
"repo",
"username",
"permission"
],
"type": "object"
},
"name": "add_collaborator"
},
{
"description": "Update repository settings",
"inputSchema": {
"properties": {
"org": {
"description": "Organization name",
"type": "string"
},
"repo": {
"description": "Repository name",
"type": "string"
},
"settings": {
"description": "Repository settings to update",
"properties": {
"allow_merge_commit": {
"description": "Allow merge commits",
"type": "boolean"
},
"allow_rebase_merge": {
"description": "Allow rebase merging",
"type": "boolean"
},
"allow_squash_merge": {
"description": "Allow squash merging",
"type": "boolean"
},
"has_issues": {
"description": "Enable issues",
"type": "boolean"
},
"has_projects": {
"description": "Enable projects",
"type": "boolean"
},
"has_wiki": {
"description": "Enable wiki",
"type": "boolean"
}
},
"type": "object"
}
},
"required": [
"org",
"repo",
"settings"
],
"type": "object"
},
"name": "update_repo_settings"
}
]