Cover image
Try Now
2024-12-06

MCP -Server für die Interaktion mit einem Github -Repo

3 years

Works with Finder

1

Github Watches

1

Github Forks

4

Github Stars

MCP GitHub Repository Server

An MCP (Model Context Protocol) server that provides access to GitHub repository contents. This server allows AI assistants to browse and read files from specified GitHub repositories.

Demo

demo

Features

Resources

  • Access any file in a GitHub repository via URI
  • List repository contents and navigate directories
  • Support for branch-specific file access
  • File contents are served as plain text

Resource URIs

  • Base URL format: https://api.github.com/repos/{owner}/{repo}/contents/{path}
  • Supports both files and directories
  • Files are served with text/plain MIME type
  • Directories are served with application/x-directory MIME type

Configuration

The server requires the following environment variables:

GITHUB_PERSONAL_ACCESS_TOKEN=your_github_token
GITHUB_OWNER=repository_owner
GITHUB_REPO=repository_name
GITHUB_BRANCH=branch_name  # Optional

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Installation

To use with Claude Desktop, add the server configuration:

Config Location

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "mcp-server-github-repo": {
      "command": "/path/to/mcp-server-github-repo/build/index.js"
    }
  }
}

API Implementation

The server implements three main MCP endpoints:

  1. ListResources - Lists files and directories in the repository
  2. ReadResource - Retrieves contents of a specific file

Authentication

The server uses GitHub Personal Access Token for authentication. Make sure your token has appropriate permissions to access the repository contents.

Error Handling

The server includes error handling for:

  • Missing environment variables
  • GitHub API errors
  • Invalid paths (e.g., trying to read a directory as a file)
  • Authentication failures

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. Use the MCP Inspector for debugging:

npm run inspector

This will provide a URL to access debugging tools in your browser.

Security Notes

  • Keep your GitHub Personal Access Token secure
  • Consider using tokens with minimal required permissions
  • Be aware of repository size limitations when accessing large repositories

License

MIT

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Andris Teikmanis
  • Latvian GPT assistant for developing GPT applications

  • https://hubeiqiao.com
  • IT problem solver with clear, step-by-step guidance.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Navid RezaeiSarchoghaei
  • Professional Flask/SQLAlchemy code guide. Follow: https://x.com/navid_re

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • https://cantaspinar.com
  • Summarizes videos and answers related questions.

  • Khalid kalib
  • Write professional emails

  • https://tovuti.be
  • Oede knorrepot die vasthoudt an de goeie ouwe tied van 't boerenleven

  • ANGEL LEON
  • A world class elite tech co-founder entrepreneur, expert in software development, entrepreneurship, marketing, coaching style leadership and aligned with ambition for excellence, global market penetration and worldy perspectives.

  • apappascs
  • Entdecken Sie die umfassendste und aktuellste Sammlung von MCP-Servern auf dem Markt. Dieses Repository dient als zentraler Hub und bietet einen umfangreichen Katalog von Open-Source- und Proprietary MCP-Servern mit Funktionen, Dokumentationslinks und Mitwirkenden.

  • OffchainLabs
  • GO -Umsetzung des Ethereum -Beweises des Anteils

  • oatpp
  • Die Implementierung des Modellkontextprotokolls von Anthropic für OAT ++

  • huahuayu
  • Ein einheitliches API-Gateway zur Integration mehrerer Ethercan-ähnlicher Blockchain-Explorer-APIs mit Modellkontextprotokoll (MCP) für AI-Assistenten.

  • deemkeen
  • Steuern Sie Ihren MBOT2 mit einer Power Combo: MQTT+MCP+LLM

  • zhaoyunxing92
  • 本项目是一个钉钉 MCP (Message Connector Protocol )服务 , 提供了与钉钉企业应用交互的 api 接口。项目基于 Go 语言开发 , 支持员工信息查询和消息发送等功能。

    Reviews

    3 (1)
    Avatar
    user_7mjCK7wi
    2025-04-15

    I've been using the mcp-c by ZenWayne for a while now and it has significantly enhanced my productivity. The server is stable and user-friendly, making it an excellent choice for developers. Highly recommend checking it out if you're looking for a reliable solution! More info here: https://mcp.so/server/mcp-c/ZenWayne