GitHub MCP Server

GitHub MCP Server

Enables AI agents to interact with GitHub repositories through the GitHub REST API for managing files, issues, and repository metadata. It supports both read operations like searching code and write operations such as creating repositories and updating issue comments.

Category
访问服务器

README

GitHub MCP Server

Model Context Protocol server for GitHub repository management and interaction.

Overview

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.2.0 (Phase 2 Complete)
Author: Pip (@pipseedai)
License: MIT

Features

Phase 1: Read Operations ✅

  • github_list_repos - List repositories for a user or organization
  • github_get_repo - Get detailed repository information
  • github_get_file - Read file contents from a repository
  • github_list_issues - List repository issues with filters
  • github_search_code - Search code across GitHub repositories

Phase 2: Write Operations ✅

  • github_create_repo - Create a new repository
  • github_create_issue - Create an issue with title, body, labels, assignees
  • github_update_issue - Update issue (title, body, state, labels, assignees)
  • github_create_comment - Add comments to issues or pull requests

Phase 3: Advanced Features (Future)

  • Pull request creation and management
  • Branch and commit operations
  • Repository forking and starring
  • Workflow and release management

Installation

cd ~/.openclaw/workspace/mcp-servers/github
npm install
npm run build

Authentication

Requires a GitHub Personal Access Token stored in ~/.openclaw/secrets/github.env:

GITHUB_TOKEN=ghp_your_token_here

Usage

Via mcporter CLI

# List repositories for authenticated user
npx mcporter call --stdio "/home/saff/.openclaw/workspace/scripts/github-mcp-wrapper.sh" \
  'github.github_list_repos()'

# Get repository information
npx mcporter call --stdio "/home/saff/.openclaw/workspace/scripts/github-mcp-wrapper.sh" \
  'github.github_get_repo(owner: "modelcontextprotocol", repo: "servers")'

# Read file contents
npx mcporter call --stdio "/home/saff/.openclaw/workspace/scripts/github-mcp-wrapper.sh" \
  'github.github_get_file(owner: "owner", repo: "repo", path: "README.md")'

# List repository issues
npx mcporter call --stdio "/home/saff/.openclaw/workspace/scripts/github-mcp-wrapper.sh" \
  'github.github_list_issues(owner: "owner", repo: "repo", state: "open")'

# Search code
npx mcporter call --stdio "/home/saff/.openclaw/workspace/scripts/github-mcp-wrapper.sh" \
  'github.github_search_code(query: "addClass in:file language:js")'

Available Tools

github_list_repos

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)

github_get_repo

Get detailed information about a repository.

Parameters:

  • owner (required) - Repository owner
  • repo (required) - Repository name

Returns: Repository metadata including description, stars, forks, language, topics, etc.

github_get_file

Read file contents from a repository.

Parameters:

  • owner (required) - Repository owner
  • repo (required) - Repository name
  • path (required) - File path in repository
  • ref (optional) - Branch, tag, or commit SHA (default: default branch)

Returns: Decoded file content as text

github_list_issues

List issues for a repository.

Parameters:

  • owner (required) - Repository owner
  • repo (required) - Repository name
  • state (optional) - "open", "closed", "all" (default: "open")
  • labels (optional) - Comma-separated label names
  • per_page (optional) - Results per page (default: 30, max: 100)

github_search_code

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"

github_create_repo

Create a new GitHub repository.

Parameters:

  • name (required) - Repository name
  • description (optional) - Repository description
  • private (optional) - Private repository (default: false)
  • auto_init (optional) - Initialize with README (default: false)

github_create_issue

Create a new issue in a repository.

Parameters:

  • owner (required) - Repository owner
  • repo (required) - Repository name
  • title (required) - Issue title
  • body (optional) - Issue description (supports Markdown)
  • labels (optional) - Array of label names
  • assignees (optional) - Array of GitHub usernames
  • milestone (optional) - Milestone number

github_update_issue

Update an existing issue.

Parameters:

  • owner (required) - Repository owner
  • repo (required) - Repository name
  • issue_number (required) - Issue number
  • title (optional) - New title
  • body (optional) - New description
  • state (optional) - "open" or "closed"
  • labels (optional) - Array of label names (replaces existing)
  • assignees (optional) - Array of usernames (replaces existing)

github_create_comment

Add a comment to an issue or pull request.

Parameters:

  • owner (required) - Repository owner
  • repo (required) - Repository name
  • issue_number (required) - Issue or PR number
  • body (required) - Comment text (supports Markdown)

Rate Limits

  • Authenticated: 5,000 requests/hour
  • Search: 30 requests/minute
  • Errors (403/429) are caught and returned gracefully

Development

# Build
npm run build

# Watch mode
npm run watch

File Structure

mcp-servers/github/
├── package.json
├── tsconfig.json
├── README.md
├── src/
│   └── index.ts          # Main server implementation
└── dist/                 # Compiled JavaScript
    ├── index.js
    └── index.d.ts

Testing

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

Next Steps

  • [ ] 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

References


Created: 2026-02-03
Last Updated: 2026-02-05
Repository: https://github.com/pipseedai/github-mcp

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选