Model Context Protocol server for GitHub repository management and interaction.
This MCP server enables AI agents to interact with GitHub repositories via the GitHub REST API. Built with TypeScript using the official MCP SDK and Octokit.
Version: 0.3.0 (Phase 3 In Progress)
Author: Pip (@pipseedai)
License: MIT
github_list_repos- List repositories for a user or organizationgithub_get_repo- Get detailed repository informationgithub_get_file- Read file contents from a repositorygithub_list_issues- List repository issues with filtersgithub_search_code- Search code across GitHub repositories
github_create_repo- Create a new repositorygithub_create_issue- Create an issue with title, body, labels, assigneesgithub_update_issue- Update issue (title, body, state, labels, assignees)github_create_comment- Add comments to issues or pull requests
Real-time GitHub event monitoring with Discord notifications.
Components:
- β Phase 3.1: HTTP server with SSE transport for MCP tools
- β Phase 3.2: Webhook signature verification (HMAC SHA-256)
- β Phase 3.3: Discord delivery via webhooks
- π² Phase 3.4: Production deployment and GitHub webhook configuration
Supported Events:
- Issues (opened, closed, reopened)
- Pull requests (opened, closed, merged)
- Releases (published, created)
- Stars, watches, forks
- Commits, branches, tags
Event Filtering: Automatically filters noisy events (individual watch/unwatch, repetitive actions)
- Pull request creation and management
- Branch and commit operations
- Repository forking and starring
- Workflow management
cd ~/.openclaw/workspace/mcp-servers/github
npm install
npm run buildRequires a GitHub Personal Access Token stored in ~/.openclaw/secrets/github.env:
GITHUB_TOKEN=ghp_your_token_hereFor real-time GitHub event monitoring, configure webhook secrets and Discord delivery in ~/.openclaw/secrets/github.env:
# Required: GitHub webhook secret (set when creating webhook)
GITHUB_WEBHOOK_SECRET=your_webhook_secret_here
# Required: Discord webhook URL for notifications
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/...
# Optional: HTTP server port (default: 9999)
PORT=9999Start the HTTP server:
source ~/.openclaw/secrets/github.env
npm run build
node dist/server-http.jsEndpoints:
GET /health- Server health checkGET /sse- MCP SSE transport (tools still available)POST /webhooks/github- GitHub webhook receiver
GitHub Webhook Configuration:
- Go to repository Settings β Webhooks β Add webhook
- Payload URL:
https://your-domain.com/webhooks/github - Content type:
application/json - Secret: Same as
GITHUB_WEBHOOK_SECRET - Events: Choose events to monitor (or "Send me everything")
Note: Make sure GITHUB_TOKEN is set in your environment before running these commands.
export GITHUB_TOKEN=ghp_your_token_here# List repositories for authenticated user
npx mcporter call --stdio "./path/to/github-mcp/dist/index.js" \
'github.github_list_repos()'
# Get repository information
npx mcporter call --stdio "./path/to/github-mcp/dist/index.js" \
'github.github_get_repo(owner: "modelcontextprotocol", repo: "servers")'
# Read file contents
npx mcporter call --stdio "./path/to/github-mcp/dist/index.js" \
'github.github_get_file(owner: "owner", repo: "repo", path: "README.md")'
# List repository issues
npx mcporter call --stdio "./path/to/github-mcp/dist/index.js" \
'github.github_list_issues(owner: "owner", repo: "repo", state: "open")'
# Search code
npx mcporter call --stdio "./path/to/github-mcp/dist/index.js" \
'github.github_search_code(query: "addClass in:file language:js")'List repositories for a user or organization.
Parameters:
username(optional) - GitHub username/org (defaults to authenticated user)type(optional) - Filter: "all", "owner", "member" (default: "owner")sort(optional) - Sort by: "created", "updated", "pushed", "full_name" (default: "updated")per_page(optional) - Results per page (default: 30, max: 100)
Get detailed information about a repository.
Parameters:
owner(required) - Repository ownerrepo(required) - Repository name
Returns: Repository metadata including description, stars, forks, language, topics, etc.
Read file contents from a repository.
Parameters:
owner(required) - Repository ownerrepo(required) - Repository namepath(required) - File path in repositoryref(optional) - Branch, tag, or commit SHA (default: default branch)
Returns: Decoded file content as text
List issues for a repository.
Parameters:
owner(required) - Repository ownerrepo(required) - Repository namestate(optional) - "open", "closed", "all" (default: "open")labels(optional) - Comma-separated label namesper_page(optional) - Results per page (default: 30, max: 100)
Search for code across GitHub repositories.
Parameters:
query(required) - Search query (supports GitHub search syntax)per_page(optional) - Results per page (default: 30, max: 100)
Example queries:
"addClass in:file language:js repo:owner/repo""function user:pipseedai""TODO extension:md"
Create a new GitHub repository.
Parameters:
name(required) - Repository namedescription(optional) - Repository descriptionprivate(optional) - Private repository (default: false)auto_init(optional) - Initialize with README (default: false)
Create a new issue in a repository.
Parameters:
owner(required) - Repository ownerrepo(required) - Repository nametitle(required) - Issue titlebody(optional) - Issue description (supports Markdown)labels(optional) - Array of label namesassignees(optional) - Array of GitHub usernamesmilestone(optional) - Milestone number
Update an existing issue.
Parameters:
owner(required) - Repository ownerrepo(required) - Repository nameissue_number(required) - Issue numbertitle(optional) - New titlebody(optional) - New descriptionstate(optional) - "open" or "closed"labels(optional) - Array of label names (replaces existing)assignees(optional) - Array of usernames (replaces existing)
Add a comment to an issue or pull request.
Parameters:
owner(required) - Repository ownerrepo(required) - Repository nameissue_number(required) - Issue or PR numberbody(required) - Comment text (supports Markdown)
- Authenticated: 5,000 requests/hour
- Search: 30 requests/minute
- Errors (403/429) are caught and returned gracefully
# Build
npm run build
# Watch mode
npm run watchmcp-servers/github/
βββ package.json
βββ tsconfig.json
βββ README.md
βββ src/
β βββ index.ts # Main server implementation
βββ dist/ # Compiled JavaScript
βββ index.js
βββ index.d.ts
Phase 1 (Read Operations):
- β Authentication with GitHub PAT
- β List repositories
- β Get repository details (tested on modelcontextprotocol/servers)
- β Read file contents (tested on README.md)
- β List issues with filters
- β Search code across repositories
Phase 2 (Write Operations):
- β Create repository (tested on pipseedai/mcp-test)
- β Create issues with labels
- β Update issue title, body, state, labels
- β Add comments to issues
Validation: All tools tested on https://github.com/pipseedai/mcp-test
- Add Phase 3 advanced features (PRs, branches, commits, forks)
- Add unit tests
- Improve error handling and validation
- Add response caching for frequently accessed data
- Consider GraphQL API for complex queries
- Add workflow and release management tools
Created: 2026-02-03
Last Updated: 2026-02-05
Repository: https://github.com/pipseedai/github-mcp