A Model Context Protocol (MCP) server that gives Claude Code the ability to explore and understand any GitHub repository. Perfect for learning from existing codebases, understanding implementation patterns, or researching how other projects solve similar problems.
Ever wondered how VS Code implements its editor, how React handles state management, or how any open-source project structures their code? This MCP server lets Claude Code dive into any public repository to help you understand and learn from real-world implementations.
- π Instant Repository Access: Clone and explore any public GitHub repository
- π Navigate Codebases: Browse directory structures just like in your local environment
- π Read Source Code: Examine implementation details of any file
- π Smart Code Search: Find specific patterns, functions, or implementations across entire projects
- π‘ Learn by Example: Study how successful projects implement features you want to build
- π Safe Exploration: Read-only access ensures you're just learning, not modifying
// Explore how VS Code implements its text editor
await clone_repo({ url: "https://github.com/microsoft/vscode" })
await grep({ pattern: "TextEditor", path: "src" })
// Understand React's hooks implementation
await clone_repo({ url: "https://github.com/facebook/react" })
await cat({ path: "packages/react/src/ReactHooks.js" })
// Study Next.js routing architecture
await clone_repo({ url: "https://github.com/vercel/next.js" })
await ls({ path: "packages/next/src/client/components" })- Authentication: See how Supabase handles auth flows
- State Management: Study Redux or Zustand internals
- API Design: Learn from Stripe's SDK patterns
- Testing Strategies: Explore Jest or Vitest codebases
- Build Tools: Understand how Vite or Webpack work
# Clone this repository
git clone https://github.com/yourusername/github-repo-explorer-mcp.git
cd github-repo-explorer-mcp
# Install dependencies
npm install
# Build TypeScript files
npm run build# Use the provided shell script (recommended)
./run-github-mcp.sh
# Or run directly with npm
npm run dev# Add using Claude CLI
claude mcp add github-repo /path/to/github-repo-explorer-mcp/run-github-mcp.sh
# For example, if you cloned to your Projects folder:
claude mcp add github-repo /Users/yourusername/Projects/github-repo-explorer-mcp/run-github-mcp.sh
# The server will now be available in Claude Code sessionsClone a GitHub repository to the local filesystem.
{
url: string; // GitHub repository URL
name?: string; // Optional custom directory name
}List files and directories in the repository.
{
path?: string; // Optional path relative to repo root (defaults to root)
}Read file contents from the repository.
{
path: string; // Path to file relative to repo root
}Search for patterns within repository files.
{
pattern: string; // Search pattern (supports regex)
path?: string; // Optional path to search in
ignoreCase?: boolean; // Case-insensitive search
}repository_info- Shows current repository URL and local path
// Clone VS Code repository
await clone_repo({ url: "https://github.com/microsoft/vscode" })
// Find where the editor is implemented
await grep({ pattern: "class.*Editor", path: "src/vs/editor" })
// Explore the monaco editor structure
await ls({ path: "src/vs/editor/browser" })
// Read specific implementation
await cat({ path: "src/vs/editor/browser/editorBrowser.ts" })// Clone Supabase auth helpers
await clone_repo({ url: "https://github.com/supabase/auth-helpers" })
// Find OAuth implementations
await grep({ pattern: "OAuth|oauth", ignoreCase: true })
// Study the auth client structure
await ls({ path: "packages/shared/src" })// See how Vite handles HMR (Hot Module Replacement)
await clone_repo({ url: "https://github.com/vitejs/vite" })
await grep({ pattern: "hot.*update|hmr", path: "packages/vite/src", ignoreCase: true })
// Understand Turbopack's architecture
await clone_repo({ url: "https://github.com/vercel/turbo" })
await ls({ path: "crates/turbopack-core/src" })github-mcp-server/
βββ src/
β βββ index.ts # Main server implementation
βββ build/ # Compiled JavaScript output
βββ CLAUDE.md # Instructions for Claude Code
βββ package.json # Project dependencies
βββ tsconfig.json # TypeScript configuration
βββ run-github-mcp.sh # Shell script for running the server
- Node.js 16+
- npm or yarn
- TypeScript
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build for production
npm run build
# Run tests (if available)
npm test- π Only works with public GitHub repositories
- π File access is restricted to the cloned repository directory
- π‘οΈ Shell commands are properly escaped to prevent injection
- π« No authentication tokens are stored or transmitted
- π Cloned repositories are stored locally in
./repoby default
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details