github-repo-structure-mcp 1.0.1

dotnet tool install --global github-repo-structure-mcp --version 1.0.1
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local github-repo-structure-mcp --version 1.0.1
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=github-repo-structure-mcp&version=1.0.1
                    
nuke :add-package github-repo-structure-mcp --version 1.0.1
                    

Help your AI agent understand any GitHub repository at a glance.

NuGet NuGet downloads Pack and Publish License: MIT

🌐 English | 한국어

github-repo-structure-mcp is a .NET global tool that fetches GitHub repository directory structures via the git/trees API and exposes them through a stdio MCP server. It lets AI coding agents see the layout of a repository without cloning it or browsing the web UI. A single API call returns the full recursive tree, rendered as an indented tree-style string.

Supports private repositories with a GitHub Personal Access Token.

Highlights

  • Fetch GitHub repository directory structures through MCP tools from Codex, Claude Code, GitHub Copilot CLI, Gemini CLI, OpenCode, or any provider that supports stdio MCP servers.
  • Register or remove the server with supported provider CLIs using mcp-install, mcp-remove, or mcp-uninstall.
  • Edit arbitrary mcp.json files directly for providers that do not have a built-in installer command.
  • Support for private repositories via GitHub Personal Access Token (interactive prompt, --token option, or GITHUB_PERSONAL_ACCESS_TOKEN env var).
  • Output a tree-style string with ├── and └── connectors, with configurable depth.

Install

dotnet tool install --global github-repo-structure-mcp

Update an existing install:

dotnet tool update --global github-repo-structure-mcp

Provider Setup

Use a supported provider CLI:

github-repo-structure-mcp mcp-install --provider codex
github-repo-structure-mcp mcp-install --provider claude
github-repo-structure-mcp mcp-install --provider copilot
github-repo-structure-mcp mcp-install --provider gemini
github-repo-structure-mcp mcp-install --provider opencode
github-repo-structure-mcp mcp-install --provider all

Remove the registration:

github-repo-structure-mcp mcp-remove --provider codex
github-repo-structure-mcp mcp-uninstall --provider claude
github-repo-structure-mcp mcp-remove --provider all

The default MCP server name is github-repo-structure. Override it when needed:

github-repo-structure-mcp mcp-install --provider codex --name github-repo-structure

The opencode provider edits ~/.config/opencode/opencode.json directly instead of using a CLI command.

GitHub Personal Access Token

To access private repositories or increase API rate limits, provide a GitHub Personal Access Token. The token is resolved in order:

  1. --token <PAT> command-line option
  2. GITHUB_PERSONAL_ACCESS_TOKEN environment variable
  3. Interactive console prompt (during mcp-install only)

When a token is provided during mcp-install, it is injected into the provider configuration as an environment variable so the MCP server can read it at runtime.

github-repo-structure-mcp mcp-install --provider codex --token ghp_xxxxxxxxxxxx

Custom mcp.json

For other providers, pass the target MCP config file directly:

github-repo-structure-mcp mcp-install --config "C:\path\to\mcp.json"

This adds:

{
  "mcpServers": {
    "github-repo-structure": {
      "command": "github-repo-structure-mcp",
      "args": []
    }
  }
}

With a token:

{
  "mcpServers": {
    "github-repo-structure": {
      "command": "github-repo-structure-mcp",
      "args": [],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxxxxxxxxxx"
      }
    }
  }
}

The config editor accepts JSON comments and trailing commas when reading. It writes standard formatted JSON and creates a .bak file before modifying an existing config.

MCP Tools

  • get_repo_structure: Fetches a GitHub repository directory structure as a tree-style string.

Parameters:

Parameter Type Default Description
owner string — Repository owner (e.g. github in github/github-mcp-server)
repo string — Repository name (e.g. github-mcp-server in github/github-mcp-server)
depth int 3 Depth limit for the tree output. Use 0 for unlimited depth.
maxDepth int 0 Maximum depth override. When > 0, overrides the depth parameter.
branch string? null Branch or commit SHA to fetch. Defaults to the repository's default branch.

The tool uses the GitHub git/trees API with recursive=1 to fetch the full tree in a single call, then renders it as a tree string with ├── and └── connectors. Directories are listed first (alphabetically), followed by files.

Manual Server Command

Running without arguments starts the stdio MCP server:

github-repo-structure-mcp

Show CLI help:

github-repo-structure-mcp help
github-repo-structure-mcp --help

Package Development

dotnet restore
dotnet build
dotnet test
dotnet pack

License

github-repo-structure-mcp is licensed under the MIT License.

Author

Created by Howon Lee (airtaxi).

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.1 148 7/30/2026
1.0.0 137 7/13/2026