Skip to content

Releases: onamfc/mcp-github-integration

v1.0.0 - Initial Release

20 Nov 22:50

Choose a tag to compare

GitHub MCP API Client

I am excited to announce the first stable release of the GitHub MCP API Client - a TypeScript package for interacting with the GitHub API through Model Context Protocol (MCP) server integration.

Highlights

This initial release provides a production-ready GitHub API client with 129 MCP tools covering all major GitHub operations. Built with TypeScript for type safety and designed for both direct use and MCP server integration.

Features

Core Functionality

  • 129 MCP Tools - Comprehensive coverage of GitHub API operations
  • Full TypeScript Support - Complete type definitions for all operations
  • MCP Server Integration - Built-in MCP protocol server implementation
  • Direct API Client - Use independently without MCP protocol
  • Robust Error Handling - Custom error types with detailed status codes
  • Structured Logging - Built-in logging with @onamfc/developer-log

Supported GitHub Operations

  • Repository Management - Create, update, delete, search, settings, administration
  • Issue Tracking - Create, update, close, comments, search
  • Pull Requests - Create, merge, list, get details
  • Branch Operations - Create, delete, list, protect
  • Commit Operations - List, get, compare
  • Release Management - Create, update, delete, assets
  • Content Operations - Read, write, delete files
  • GitHub Actions - Workflows, runs, artifacts
  • Webhooks - Create, update, delete, deliveries, redelivery
  • Teams & Collaborators - Add, remove, permissions
  • Search - Repositories, issues, PRs, code, commits, users, topics, labels
  • Security - Dependabot, vulnerability alerts
  • Repository Statistics - Insights and metrics

Installation

npm install @onamfc/mcp-github-integration

Quick Start

As Direct API Client

import { GitHubClient } from '@onamfc/mcp-github-integration';

const client = new GitHubClient({
  token: process.env.GITHUB_TOKEN
});

// Get repository information
const repo = await client.getRepository('owner', 'repo');

// Create an issue
const issue = await client.createIssue({
  owner: 'owner',
  repo: 'repo',
  title: 'Bug report',
  body: 'Description of the issue',
  labels: ['bug']
});

As MCP Server

import { MCPServer } from '@onamfc/mcp-github-integration';

const server = new MCPServer(process.env.GITHUB_TOKEN);

// Handle MCP requests
const response = await server.handleRequest({
  method: 'github_create_issue',
  params: {
    owner: 'owner',
    repo: 'repo',
    title: 'Bug report',
    body: 'Description'
  }
});

Examples

Two complete working examples are included:

  1. basic-usage.ts - Demonstrates core operations
  2. setup-new-repo.ts - Automated repository setup with best practices

Run examples:

npm run build
GITHUB_TOKEN=your_token npm run example:basic
GITHUB_TOKEN=your_token npm run example:setup-repo

Configuration

Required Environment Variables

  • GITHUB_TOKEN - GitHub Personal Access Token

Recommended Token Scopes

  • repo - Full repository access
  • workflow - GitHub Actions management
  • admin:repo_hook - Webhook management
  • admin:org - Team operations

Documentation

Technical Details

Built With

  • TypeScript 5.9+ - Type safety and modern JavaScript features
  • Octokit REST - Official GitHub REST API client
  • ES2022 Modules - Modern module system
  • Vitest - Fast unit testing framework

Testing

Comprehensive test suite with 51 passing tests covering:

  • GitHubClient operations
  • MCPServer request handling
  • Error handling
  • Logger functionality

Run tests:

npm test                    # Run once
npm run test:watch          # Watch mode
npm run test:coverage       # With coverage

Security

  • No secrets in code - Uses environment variables
  • Token scope validation - Requires appropriate permissions
  • Error sanitization - Sensitive data not exposed in errors
  • Rate limit aware - Works within GitHub's 5,000 req/hour limit

Acknowledgments

Built with:

Links

License

MIT License - see LICENSE file for details.


Ready to automate your GitHub workflows? Get started with the Quick Start Guide or explore the examples.